conversations
listlengths
2
2
[ { "content": "Use DuckDB's `INSTALL` and `LOAD` commands to load an extension from local storage after decompressing it using the Python script provided in the documentation.\nSCHEMA: CREATE TABLE bank (\n branch_ID INTEGER PRIMARY KEY,\n bname VARCHAR(20),\n no_of_customers INTEGER,\n city VARCHAR...
[ { "content": "Show me the paths of temporary files that are larger than 100 MB.\nSCHEMA: CREATE TABLE station (\n id INTEGER PRIMARY KEY,\n name TEXT,\n location STRUCT(lat NUMERIC, long NUMERIC),\n dock_count INTEGER,\n city TEXT,\n installation_date TIMESTAMP\n);\n\nCREATE TABLE status (\n ...
[ { "content": "What is the number of milliseconds since the epoch for a given timestamp?\nSCHEMA: CREATE TABLE gymnast (\n Gymnast_ID INT,\n Floor_Exercise_Points FLOAT,\n Pommel_Horse_Points FLOAT,\n Rings_Points FLOAT,\n Vault_Points FLOAT,\n Parallel_Bars_Points FLOAT,\n Horizontal_Bar_Po...
[ { "content": "For all TVseries that belong to a channel with \"Cartoon\" in its name, extract the director's name from the JSON data in the Cast column.\nSCHEMA: CREATE TABLE \"TV_Channel\" (\n \"id\" VARCHAR(255),\n \"series_name\" VARCHAR(255),\n \"Country\" VARCHAR(255),\n \"Language\" VARCHAR(25...
[ { "content": "List the number of buildings in each city and the total number of buildings, while also indicating whether each row corresponds to a city or the total.\nSCHEMA: CREATE TABLE \"buildings\" (\n \"id\" INTEGER,\n \"name\" VARCHAR(255),\n \"City\" VARCHAR(255),\n \"Height\" INTEGER,\n \...
[ { "content": "Which SQL query can be used to export the records of people taller than 170 cm to a CSV file named 'tallpeople.csv' with columns delimited by a pipe character and including a header line?\nSCHEMA: CREATE TABLE candidate (\n Candidate_ID INTEGER,\n People_ID INTEGER,\n Poll_Source VARCHAR(...
[ { "content": "Load all columns and rows from the 'input.parquet' Parquet file.\nSCHEMA: CREATE TABLE \"entrepreneur\" (\n \"Entrepreneur_ID\" INTEGER,\n \"People_ID\" INTEGER,\n \"Company\" VARCHAR(255),\n \"Money_Requested\" FLOAT,\n \"Investor\" VARCHAR(255),\n \"Entrepreneur_Info\" JSON,\n ...
[ { "content": "Create a sequence for generating show IDs, starting from 10000 and incrementing by 1 for each new ID, without allowing the sequence to cycle back to the starting value after reaching the maximum value.\nSCHEMA: CREATE TABLE \"conductor\" (\n \"Conductor_ID\" INTEGER,\n \"Name\" VARCHAR(255),...
[ { "content": "Reset the memory limit of the system back to its default value.\nSCHEMA: CREATE TABLE pilot (\n Pilot_Id INTEGER,\n Name VARCHAR(50),\n Age INTEGER,\n Additional_Info STRUCT(experience INTEGER, awards VARCHAR(255)[]),\n PRIMARY KEY (Pilot_Id)\n);\n\nCREATE TABLE aircraft (\n Airc...
[ { "content": "Export the order items of product 123 to a gzip-compressed JSON array file.\nSCHEMA: CREATE TABLE \"Customer_Addresses\" (\n\"customer_id\" INTEGER NOT NULL,\n\"premise_id\" INTEGER NOT NULL,\n\"date_address_from\" DATETIME NOT NULL,\n\"address_type_code\" VARCHAR(15) NOT NULL,\n\"date_address_to...
[ { "content": "Create a timestamp for each person's birth date in the `people` table using the `Personal_Info` struct.\nSCHEMA: CREATE TABLE \"body_builder\" (\n \"Body_Builder_ID\" INTEGER,\n \"People_ID\" INTEGER,\n \"Snatch\" FLOAT,\n \"Clean_Jerk\" FLOAT,\n \"Total\" FLOAT,\n \"Body_Builde...
[ { "content": "For each customer, get their order ID, order status code, and the order status code of their previous order.\nSCHEMA: CREATE TABLE \"Customer_Addresses\" (\n\"customer_id\" INTEGER NOT NULL,\n\"premise_id\" INTEGER NOT NULL,\n\"date_address_from\" DATETIME NOT NULL,\n\"address_type_code\" VARCHAR...
[ { "content": "Sample 10% of the joined `mountain` and `camera_lens` tables using the `SYSTEM` sampling method and order the results by `mountain.Height` in descending order.\nSCHEMA: CREATE TABLE IF NOT EXISTS \"mountain\" (\n \"id\" INTEGER,\n \"name\" VARCHAR(255),\n \"Height\" DOUBLE,\n \"Promine...
[ { "content": "Insert the records from the CSV file 'newschooldata.csv' into the `School` table using `INSERT INTO` and `SELECT *`.\nSCHEMA: CREATE TABLE \"School\" (\n \"School_id\" TEXT,\n \"School_name\" TEXT,\n \"Location\" TEXT,\n \"Mascot\" TEXT,\n \"Enrollment\" INTEGER,\n \"IHSAA_Class\...
[ { "content": "What is the timestamp with millisecond precision?\nSCHEMA: CREATE TABLE \"checkin\" (\n \"cid\" INTEGER,\n \"business_id\" VARCHAR(255) REFERENCES \"business\"(\"business_id\"),\n \"count\" INTEGER,\n \"day\" VARCHAR(255),\n \"checkin_info\" JSON,\n primary key(\"cid\")\n);\n\nC...
[ { "content": "What are the minimum, maximum, average, standard deviation, and approximate uniqueness for the non-null `type` values in the `mill` table?\nSCHEMA: CREATE TABLE \"bridge\" (\n \"architect_id\" INTEGER,\n \"id\" INTEGER,\n \"name\" VARCHAR,\n \"location\" VARCHAR,\n ...
[ { "content": "Calculate the time one week later from 9:00 AM for a specific festival.\nSCHEMA: CREATE TABLE \"festival_detail\" (\n \"Festival_ID\" INTEGER,\n \"Festival_Name\" VARCHAR(255),\n \"Chair_Name\" VARCHAR(255),\n \"Location\" VARCHAR(255),\n \"Year\" INTEGER,\n \"Num_of_Audience\" I...
[ { "content": "Calculate the cosine similarity between the 'Gold' and 'Silver' medals of a specific club's match results.\nSCHEMA: CREATE TABLE IF NOT EXISTS \"player\" (\n \"Player_ID\" INTEGER,\n \"Sponsor_name\" VARCHAR(255),\n \"Player_name\" VARCHAR(255),\n \"Gender\" VARCHAR(255),\n \"Resid...
[ { "content": "Count the number of airports in each country, grouped by their ICAO codes.\nSCHEMA: CREATE TABLE \"airport\" (\n \"id\" INTEGER,\n \"City\" VARCHAR(255),\n \"Country\" VARCHAR(255),\n \"IATA\" VARCHAR(255),\n \"ICAO\" VARCHAR(255),\n \"name\" VARCHAR(255),\n \"Airport_Info\" J...
[ { "content": "Reset the threads configuration option to its default value for the current session.\nSCHEMA: CREATE TABLE \"festival_detail\" (\n \"Festival_ID\" INTEGER,\n \"Festival_Name\" VARCHAR(255),\n \"Chair_Name\" VARCHAR(255),\n \"Location\" VARCHAR(255),\n \"Year\" INTEGER,\n \"Num_of...
[ { "content": "Get the internal schema of the Parquet file for the Addresses table.\nSCHEMA: CREATE TABLE \"Products\" (\n\"product_id\" INTEGER PRIMARY KEY,\n\"product_type_code\" VARCHAR(15),\n\"product_name\" VARCHAR(80),\n\"product_price\" DOUBLE PRECISION NULL,\n\"product_reviews\" STRUCT(rating INTEGER, c...
[ { "content": "Construct an interval with mixed units of 1 month and 1 day.\nSCHEMA: ", "role": "user" }, { "content": "SELECT INTERVAL '1 month 1 day';", "role": "assistant" } ]
[ { "content": "Get the CREATE TABLE statement for the 'company' table.\nSCHEMA: CREATE TABLE \"company\" (\n \"Company_ID\" INTEGER,\n \"Rank\" INTEGER,\n \"Company\" VARCHAR(255),\n \"Headquarters\" VARCHAR(255),\n \"Main_Industry\" VARCHAR(255),\n \"Sales_billion\" REAL,\n \"Profits_billio...
[ { "content": "Create a query that reads parquet files from a hive partitioned dataset with specified hive types.\nSCHEMA: CREATE TABLE \"musical\" (\n\"Musical_ID\" INTEGER,\n\"Name\" TEXT\n);", "role": "user" }, { "content": "SELECT * FROM read_parquet('actors/*/*/*.parquet', hive_partitioning=1, ...
[ { "content": "Create a new SQLite database, create a table named 'tbl' with columns 'id' and 'name', and insert a row with id 42 and name 'DuckDB'.\nSCHEMA: CREATE TABLE \"Course_Authors_and_Tutors\" (\n \"author_id\" INTEGER PRIMARY KEY,\n \"author_tutor_ATB\" VARCHAR(3),\n \"login_name\" VARCHAR(40),...
[ { "content": "Export the 'Transactions' table to a CSV file named 'transactions.csv' with columns delimited by a comma and including a header line.\nSCHEMA: CREATE TABLE \"Investors\" (\n\"investor_id\" INTEGER PRIMARY KEY,\n\"Investor_details\" VARCHAR(255),\n\"investor_json\" JSON\n);\n\nCREATE TABLE \"Lots\"...
[ { "content": "List the names of furniture with a market rate greater than 2 (in base-2 logarithm) along with their base-2 logarithm of market rate.\nSCHEMA: CREATE TABLE \"manufacturer\" (\n \"Manufacturer_ID\" INTEGER,\n \"Open_Year\" FLOAT,\n \"Name\" VARCHAR(255),\n \"Num_of_Factories\" INTEGER,\...
[ { "content": "Calculate the natural logarithm of the release year of movies using the `ln()` function.\nSCHEMA: CREATE TABLE \"actor\" (\n \"aid\" int,\n \"gender\" text,\n \"name\" text,\n \"nationality\" text,\n \"birth_city\" text,\n \"birth_year\" int,\n \"additional_info\" STRUCT(city...
[ { "content": "Find all poker players that share the same `People_ID` as the player with `Poker_Player_ID` 100, by traversing the `People_ID` foreign key recursively.\nSCHEMA: CREATE TABLE poker_player (\n Poker_Player_ID INTEGER,\n People_ID INTEGER,\n Final_Table_Made DOUBLE,\n Best_Finish DOUBLE,\...
[ { "content": "Save the details of all Real Madrid games from the 2022 season to a CSV file named 'realmadridgames.csv' with column names as the first row and a semicolon (;) as the column delimiter.\nSCHEMA: CREATE TABLE \"stadium\" (\n \"id\" INTEGER,\n \"name\" VARCHAR(255),\n \"Home_Games\" INTEGER,...
[ { "content": "What are the column names and data types for the 'Manufacturers' table in the specified database?\nSCHEMA: CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255) NOT NULL,\n Headquarter VARCHAR(255) NOT NULL,\n Founder VARCHAR(255) NOT NULL,\n Revenue REAL,\n Contact_Info JSON,\n ...
[ { "content": "Which attendees were present at weddings held in the year 2020, presented as a list of IDs?\nSCHEMA: CREATE TABLE people (\n People_ID INT,\n Name VARCHAR(255),\n Country VARCHAR(255),\n Is_Male BOOLEAN,\n Age INT,\n Address STRUCT(street VARCHAR, city VARCHAR, zip INT),\n PRI...
[ { "content": "Check if a point is within 5 random school locations.\nSCHEMA: CREATE TABLE \"School\" (\n \"School_id\" TEXT,\n \"School_name\" TEXT,\n \"Location\" TEXT,\n \"Mascot\" TEXT,\n \"Enrollment\" INTEGER,\n \"IHSAA_Class\" TEXT,\n \"IHSAA_Football_Class\" TEXT,\n \"County\" TEX...
[ { "content": "Set the default collation to NOCASE and select firstname and lastname from Staff table where firstname is 'JoHn'. This query demonstrates setting the default collation and using it in a case-insensitive search.\nSCHEMA: CREATE TABLE \"Addresses\" (\n\"address_id\" INTEGER PRIMARY KEY,\n\"line_1_nu...
[ { "content": "Suppose you have created a new Enum type 'newmood'. How can you use this Enum type in the 'currentmood' column of the 'person' table?\nSCHEMA: CREATE TABLE \"actor\" (\n \"aid\" int,\n \"gender\" text,\n \"name\" text,\n \"nationality\" text,\n \"birth_city\" text,\n \"birth_yea...
[ { "content": "Find the average official ratings per month for all performances.\nSCHEMA: CREATE TABLE \"conductor\" (\n \"Conductor_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Age\" INTEGER,\n \"Nationality\" VARCHAR(255),\n \"Year_of_Work\" INTEGER,\n \"Conductor_Info\" STRUCT(\n \"Birt...
[ { "content": "Count the number of grapheme clusters in the festival names from 2015 onwards and order them in descending order.\nSCHEMA: CREATE TABLE \"festival_detail\" (\n \"Festival_ID\" INTEGER,\n \"Festival_Name\" VARCHAR(255),\n \"Chair_Name\" VARCHAR(255),\n \"Location\" VARCHAR(255),\n \"...
[ { "content": "Replace with natural language instruction: Install and load the ICU extension, then set the calendar to Japanese.\nSCHEMA: CREATE TABLE \"Attribute_Definitions\" (\n\"attribute_id\" INTEGER PRIMARY KEY,\n\"attribute_name\" VARCHAR(30),\n\"attribute_data_type\" VARCHAR(10),\n\"attribute_values\" VA...
[ { "content": "List the top 5 Parquet files with the highest maximum temperature values in the 'weather' folder, including the filename.\nSCHEMA: CREATE TABLE station (\n id INTEGER PRIMARY KEY,\n name TEXT,\n location STRUCT(lat NUMERIC, long NUMERIC),\n dock_count INTEGER,\n city TEXT,\n inst...
[ { "content": "Count the number of distinct players in the `player` table using bitstring aggregation.\nSCHEMA: CREATE TABLE \"school\" (\n \"School_ID\" INTEGER,\n \"School\" VARCHAR(255),\n \"Location\" VARCHAR(255),\n \"Enrollment\" REAL,\n \"Founded\" REAL,\n \"Denomination\" VARCHAR(255),\...
[ { "content": "Find the first starting index of the specified substring '010' within the bitstring '1110101' in the store table.\nSCHEMA: CREATE TABLE \"product\" (\n \"product_id\" INTEGER,\n \"product\" VARCHAR(255),\n \"dimensions\" VARCHAR(255),\n \"dpi\" REAL,\n \"pages_per_minute_color\" REA...
[ { "content": "Generate a Substrait BLOB plan for counting the number of students in the `Students` table.\nSCHEMA: CREATE TABLE People (\n person_id INTEGER NOT NULL,\n first_name TEXT,\n middle_name TEXT,\n last_name TEXT,\n cell_mobile_number VARCHAR(40),\n email_add...
[ { "content": "Get all the races that were held in the year 2022 using the Appender to insert data into the `race` table and then query the table to get the races for the specified date range.\nSCHEMA: CREATE TABLE race (\n Race_ID INTEGER,\n Name VARCHAR(255),\n Class VARCHAR(255),\n ...
[ { "content": "How can I read all CSV files from 'data/subdir1' and 'data/subdir2' directories, unifying the schemas by name and outputting a 'filename' column?\nSCHEMA: CREATE TABLE \"Songs\" ( \n\t\"SongId\" INTEGER PRIMARY KEY, \n\t\"Title\" TEXT,\n\t\"InstrumentList\" TEXT[]\n);\n\nCREATE TABLE \"Albums\" ( ...
[ { "content": "Delete the FTS index for the artist table.\nSCHEMA: CREATE TABLE \"artist\" (\n \"Artist_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Country\" VARCHAR(255),\n \"Year_Join\" INTEGER,\n \"Age\" INTEGER,\n \"Artist_Info\" JSON,\n PRIMARY KEY (\"Artist_ID\")\n);\n\nCREATE TABLE \"e...
[ { "content": "As a language model, display the shortened train names (trimmed if length > 10) while ignoring case sensitivity.\nSCHEMA: CREATE TABLE \"railway\" (\n \"Railway_ID\" INTEGER,\n \"Railway\" VARCHAR(255),\n \"Builder\" VARCHAR(255),\n \"Built\" VARCHAR(255),\n \"Wheels\" VARCHAR(255),...
[ { "content": "How can I query the 'company', 'employment', and 'people' tables from the MySQL database, showing the company name and the average age of their employees?\nSCHEMA: CREATE TABLE people (\n People_ID INTEGER,\n Age INTEGER,\n Name VARCHAR(255),\n Nationality VARCHAR(255),\n Graduatio...
[ { "content": "Find the start and end of the month for the Music Festival 2022 concert, truncated to the nearest month.\nSCHEMA: CREATE TABLE \"stadium\" (\n \"Stadium_ID\" INTEGER,\n \"Location\" VARCHAR(255),\n \"Name\" VARCHAR(255),\n \"Capacity\" INTEGER,\n \"Highest\" INTEGER,\n \"Lowest\"...
[ { "content": "How many years have passed since each shop with a finite open date started its operation?\nSCHEMA: CREATE TABLE \"device\" (\n \"Device_ID\" INTEGER,\n \"Device\" VARCHAR(255),\n \"Carrier\" VARCHAR(255),\n \"Package_Version\" VARCHAR(255),\n \"Applications\" JSON,\n \"Software_...
[ { "content": "Generate a table of timestamps in the half open range, stepping by 45 minutes, starting from March 1st, 2022 13:30:00 to March 2nd, 2022 13:30:00.\nSCHEMA: CREATE TABLE People (\n person_id INTEGER NOT NULL,\n first_name TEXT,\n middle_name TEXT,\n last_name TEXT,\n ...
[ { "content": "List all local temporary tables in the database.\nSCHEMA: CREATE TABLE \"Songs\" ( \n\t\"SongId\" INTEGER PRIMARY KEY, \n\t\"Title\" TEXT,\n\t\"InstrumentList\" TEXT[]\n);\n\nCREATE TABLE \"Albums\" ( \n\t\"AId\" INTEGER PRIMARY KEY, \n\t\"Title\" TEXT, \n\t\"Year\" INTEGER, \n\t\"Label\" TEXT, \n...
[ { "content": "How can I find the ID, name, and the number of years since the creation of each bridge as of March 15th, 2023, using the `datediff` function?\nSCHEMA: CREATE TABLE \"bridge\" (\n \"architect_id\" INTEGER,\n \"id\" INTEGER,\n \"name\" VARCHAR,\n \"location\" VARCHAR,\n ...
[ { "content": "Select the Velocity column from the flight.parquet file located at the given HTTPS URL where the Date column is equal to '2022-01-01'.\nSCHEMA: CREATE TABLE \"airport\" (\n \"id\" INTEGER,\n \"City\" VARCHAR(255),\n \"Country\" VARCHAR(255),\n \"IATA\" VARCHAR(255),\n \"ICAO\" VARCH...
[ { "content": "Which manufacturers do not have a name starting with 'M' followed by one or more lowercase letters and ending with 'ter'?\nSCHEMA: CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255) NOT NULL,\n Headquarter VARCHAR(255) NOT NULL,\n Founder VARCHAR(255) NOT NULL,\n Revenue REAL,\n...
[ { "content": "Create multiple records in the `employment` table with the given details in a single query.\nSCHEMA: CREATE TABLE people (\n People_ID INTEGER,\n Age INTEGER,\n Name VARCHAR(255),\n Nationality VARCHAR(255),\n Graduation_College VARCHAR(255),\n Education_History JSON,\n PRIMA...
[ { "content": "List all news reports with a non-null content.\nSCHEMA: CREATE TABLE \"event\" (\n \"Event_ID\" INTEGER,\n \"Date\" DATE,\n \"Venue\" VARCHAR(255),\n \"Name\" VARCHAR(255),\n \"Event_Attendance\" INTEGER,\n \"Attendees_List\" INT[],\n PRIMARY KEY (\"Event_ID\")\n);\n\nCREATE T...
[ { "content": "List the names and column counts of all views in the 'main' schema.\nSCHEMA: CREATE TABLE \"Course_Authors_and_Tutors\" (\n \"author_id\" INTEGER PRIMARY KEY,\n \"author_tutor_ATB\" VARCHAR(3),\n \"login_name\" VARCHAR(40),\n \"password\" VARCHAR(40),\n \"personal_name\" VARCHAR(80)...
[ { "content": "Get the bit length of the sequence identity to human protein for the first 5 protein entries.\nSCHEMA: CREATE TABLE \"building\" (\n \"building_id\" VARCHAR(255),\n \"Name\" VARCHAR(255),\n \"Street_address\" VARCHAR(255),\n \"Years_as_tallest\" VARCHAR(255),\n \"Height_feet\" INTEG...
[ { "content": "Generate a query that counts the number of features for each roller coaster and categorizes it as 'Many', 'Some', or 'Few'.\nSCHEMA: CREATE TABLE roller_coaster (\n Roller_Coaster_ID INTEGER,\n Name VARCHAR(255),\n Park VARCHAR(255),\n Country_ID INTEGER,\n Length REAL,\n Height ...
[ { "content": "Attempt to retrieve the value at a non-existent key from a map, demonstrating that a map returns an empty list if a key is not found.\nSCHEMA: ", "role": "user" }, { "content": "SELECT map { 'key1': 5, 'key2': 43 }['key4'];", "role": "assistant" } ]
[ { "content": "Get the number of months in an interval of 14 months.\nSCHEMA: CREATE TABLE IF NOT EXISTS \"regions\" (\n \"REGION_ID\" BIGINT NOT NULL,\n \"REGION_NAME\" VARCHAR(25),\n \"REGION_EMPLOYEES\" INT[],\n PRIMARY KEY (\"REGION_ID\")\n);\n\nCREATE TABLE IF NOT EXISTS \"countries\" (\n \"COUNTRY_ID\...
[ { "content": "Find the Hamming distance between two strings 'duck' and 'luck'.\nSCHEMA: CREATE TABLE \"GEOGRAPHIC\" (\n \"CITY_NAME\" VARCHAR(255) CONSTRAINT pk_geo PRIMARY KEY,\n \"COUNTY\" VARCHAR(255),\n \"REGION\" VARCHAR(255),\n \"NEIGHBORHOODS\" VARCHAR(255)[],\n);\n\nCREATE TABLE \"RESTAURAN...
[ { "content": "What are the columns that are part of a unique constraint for the 'company' table in the DuckDB instance?\nSCHEMA: CREATE TABLE people (\n People_ID INTEGER,\n Age INTEGER,\n Name VARCHAR(255),\n Nationality VARCHAR(255),\n Graduation_College VARCHAR(255),\n Education_History JS...
[ { "content": "\nSCHEMA: CREATE TABLE Customers (\n Customer_ID INTEGER NOT NULL,\n Customer_Details VARCHAR(255) NOT NULL,\n Customer_Contacts JSON,\n PRIMARY KEY (Customer_ID)\n);\n\nCREATE TABLE Staff (\n Staff_ID INTEGER NOT NULL,\n Staff_Details VARCHAR(255) NOT NULL,\n Staff_Contacts J...
[ { "content": "Create a macro named `loan_details` that returns the loan details for a given loan ID and use the macro in a query to retrieve loan details for a specific loan ID from the `bank` table.\nSCHEMA: CREATE TABLE bank (\n branch_ID INTEGER PRIMARY KEY,\n bname VARCHAR(20),\n no_of_customers I...
[ { "content": "Get all school details with a 'DetailsUnion' value of 'Private'.\nSCHEMA: CREATE TABLE \"school\" (\n \"School_ID\" INTEGER,\n \"School\" VARCHAR(255),\n \"Location\" VARCHAR(255),\n \"Enrollment\" REAL,\n \"Founded\" REAL,\n \"Denomination\" VARCHAR(255),\n \"Boys_or_Girls\" ...
[ { "content": "What are the table names, column names, and their character octet length for all VARCHAR and CHAR data types in the database?\nSCHEMA: CREATE TABLE \"school\" (\n \"School_ID\" INTEGER,\n \"School\" VARCHAR(255),\n \"Location\" VARCHAR(255),\n \"Enrollment\" REAL,\n \"Founded\" REAL...
[ { "content": "Update a row in a table in a SQLite database.\nSCHEMA: CREATE TABLE \"body_builder\" (\n \"Body_Builder_ID\" INTEGER,\n \"People_ID\" INTEGER,\n \"Snatch\" FLOAT,\n \"Clean_Jerk\" FLOAT,\n \"Total\" FLOAT,\n \"Body_Builder_Info\" STRUCT(Snatch FLOAT, Clean_Jerk FLOAT, Total FLOA...
[ { "content": "Get the author, scores, result, feedback score, and feedback comment for all submissions from MIT.\nSCHEMA: CREATE TABLE workshop (\n Workshop_ID INTEGER,\n Date VARCHAR,\n Venue VARCHAR,\n Name VARCHAR,\n Attendees INT[], \n PRIMARY KEY (Workshop_ID)\n);\n\nCREATE TABLE submissi...
[ { "content": "How can I export data from 'musical' table into a 'output.parquet' file using COPY statement?\nSCHEMA: CREATE TABLE \"musical\" (\n\"Musical_ID\" INTEGER,\n\"Name\" TEXT\n);", "role": "user" }, { "content": "COPY musical TO 'output.parquet' (FORMAT PARQUET);", "role": "assistant" ...
[ { "content": "Partition and overwrite the 's3://my-bucket/partitioned' directory with 'Office_locations' table data based on companyid column.\nSCHEMA: CREATE TABLE \"buildings\" (\n \"id\" INTEGER,\n \"name\" VARCHAR(255),\n \"City\" VARCHAR(255),\n \"Height\" INTEGER,\n \"Stories\" INTEGER,\n ...
[ { "content": "Create an index 'officelocationindex' on the compound key of 'buildingid' and 'companyid' of the 'Officelocations' table.\nSCHEMA: CREATE TABLE \"buildings\" (\n \"id\" INTEGER,\n \"name\" VARCHAR(255),\n \"City\" VARCHAR(255),\n \"Height\" INTEGER,\n \"Stories\" INTEGER,\n \"Sta...
[ { "content": "Insert a new customer and return the customerid and customername of the inserted row.\nSCHEMA: CREATE TABLE \"Customer_Addresses\" (\n\"customer_id\" INTEGER NOT NULL,\n\"premise_id\" INTEGER NOT NULL,\n\"date_address_from\" DATETIME NOT NULL,\n\"address_type_code\" VARCHAR(15) NOT NULL,\n\"date_...
[ { "content": "Extract the tag value from a UNION value\nSCHEMA: CREATE TABLE race (\n Race_ID INTEGER,\n Name VARCHAR(255),\n Class VARCHAR(255),\n Date DATE,\n Track_ID INTEGER,\n Track_Info ROW(Name VARCHAR(255), Location VARCHAR(255), Seating DOUBLE, Year_Opened DOU...
[ { "content": "What is the result of performing a system sampling of 5% on the join result of Staff and ProblemLog tables?\nSCHEMA: CREATE TABLE \"Problem_Category_Codes\" (\n\"problem_category_code\" VARCHAR(20) PRIMARY KEY,\n\"problem_category_description\" VARCHAR(80),\n\"additional_info\" JSON\n);\n\nCREATE ...
[ { "content": "As a language model, extract the third bit (indexed 2) from the bitstring '0110010'.\nSCHEMA: CREATE TABLE \"county\" (\n \"County_Id\" INTEGER,\n \"County_name\" TEXT\n);", "role": "user" }, { "content": "SELECT get_bit('0110010'::bit, 2) as extracted_bit;", "role": "assist...
[ { "content": "Create a sequence for generating product codes starting from 1000.\nSCHEMA: CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255) NOT NULL,\n Headquarter VARCHAR(255) NOT NULL,\n Founder VARCHAR(255) NOT NULL,\n Revenue REAL,\n Contact_Info JSON,\n PRIMARY KEY (Code) \n);\n\nCR...
[ { "content": "Find the name of each bridge and its corresponding architect, along with the bridge's length in meters.\nSCHEMA: CREATE TABLE \"bridge\" (\n \"architect_id\" INTEGER,\n \"id\" INTEGER,\n \"name\" VARCHAR,\n \"location\" VARCHAR,\n \"length_meters\" DOUBLE,\n ...
[ { "content": "How would you order the `movie` table by the `Budget_million` column in ascending order, with `NULL` values appearing last?\nSCHEMA: CREATE TABLE \"book_club\" (\n \"book_club_id\" INTEGER,\n \"Year\" INTEGER,\n \"Author_or_Editor\" VARCHAR(100),\n \"Book_Title\" VARCHAR(100),\n \"P...
[ { "content": "What are the columns with default values in the reference tables 'Ref_Characteristic_Types', 'Ref_Colors', and 'Ref_Product_Categories'?\nSCHEMA: CREATE TABLE \"Ref_Characteristic_Types\" (\n\"characteristic_type_code\" VARCHAR(15) PRIMARY KEY,\n\"characteristic_type_description\" VARCHAR(80),\n\"...
[ { "content": "Read data from all Parquet files in the 's3://my-bucket/partitioned/part_col_a=1/part_col_b=2/' directory that match the pattern 'data_*.parquet'.\nSCHEMA: CREATE TABLE \"mountain\" (\n \"Mountain_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Height\" FLOAT,\n \"Prominence\" FLOAT,\n \...
[ { "content": "How do I export the entire database to a target directory in Parquet format?\nSCHEMA: CREATE TABLE \"book_club\" (\n \"book_club_id\" INTEGER,\n \"Year\" INTEGER,\n \"Author_or_Editor\" VARCHAR(100),\n \"Book_Title\" VARCHAR(100),\n \"Publisher\" VARCHAR(100),\n \"Category\" VARC...
[ { "content": "Create a table named `ip_table` with an `INET` column and insert some sample data.\nSCHEMA: CREATE TABLE \"artist\" (\n \"Artist_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Country\" VARCHAR(255),\n \"Year_Join\" INTEGER,\n \"Age\" INTEGER,\n \"Artist_Info\" JSON,\n PRIMARY KEY...
[ { "content": "Read the `broadcast_log.csv` file using custom delimiter `|` and column types.\nSCHEMA: CREATE TABLE \"program\" (\n \"Program_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Origin\" VARCHAR(255),\n \"Launch\" REAL,\n \"Owner\" VARCHAR(255),\n \"Program_Info\" JSON,\n PRIMARY KEY ...
[ { "content": "Get the list of all primary key constraints in the DuckDB instance.\nSCHEMA: ", "role": "user" }, { "content": "SELECT * FROM duckdb_constraints WHERE constraint_type = 'PRIMARY KEY';", "role": "assistant" } ]
[ { "content": "* Remove the `tpch` extension from the DuckDB database.\nSCHEMA: CREATE TABLE poker_player (\n Poker_Player_ID INTEGER,\n People_ID INTEGER,\n Final_Table_Made DOUBLE,\n Best_Finish DOUBLE,\n Money_Rank DOUBLE,\n Earnings DOUBLE,\n Additional_Info JSON,\n PRIMARY KEY (Poker...
[ { "content": "Which columns in the 'concert' table have a character maximum length restriction?\nSCHEMA: CREATE TABLE \"stadium\" (\n \"Stadium_ID\" INTEGER,\n \"Location\" VARCHAR(255),\n \"Name\" VARCHAR(255),\n \"Capacity\" INTEGER,\n \"Highest\" INTEGER,\n \"Lowest\" INTEGER,\n \"Averag...
[ { "content": "Reset the `disabled_filesystems` configuration option to its default value.\nSCHEMA: CREATE TABLE Services (\n Service_ID INTEGER NOT NULL,\n Service_Type_Code CHAR(15) NOT NULL,\n Service_Details JSON,\n PRIMARY KEY (Service_ID)\n);\n\nCREATE TABLE Participants (\n Participant_ID ...
[ { "content": "Change the global configuration option 'threads' to 8 across the entire DuckDB instance.\nSCHEMA: CREATE TABLE Ref_Template_Types (\n Template_Type_Code CHAR(15) NOT NULL,\n Template_Type_Description VARCHAR(255) NOT NULL,\n Template_Type_Details JSON,\n PRIMARY KEY (Template_Type_Code...
[ { "content": "Select 10% of the `phone` table using bernoulli sampling.\nSCHEMA: CREATE TABLE \"phone\" (\n \"Name\" VARCHAR(255),\n \"Phone_ID\" INTEGER,\n \"Memory_in_G\" INTEGER,\n \"Carrier\" VARCHAR(255),\n \"Price\" DOUBLE,\n \"Features\" JSON,\n PRIMARY KEY (\"Phone_ID\")\n);\n\nCREA...
[ { "content": "Find all colleges whose name starts with the letter 'A'.\nSCHEMA: CREATE TABLE College \n ( cName \tVARCHAR(20) NOT NULL,\n state \tVARCHAR(2),\n enr \tINTEGER,\n cInfo \tJSON,\n PRIMARY KEY (cName)\n );\n\nCREATE TABLE Player\n ( pID\t\t\tINTEGER NOT NULL,\n \tpName \t...
[ { "content": "Export the contents of `my_large_table` to multiple JSON files, one per thread, without compression.\nSCHEMA: ", "role": "user" }, { "content": "COPY (SELECT * FROM my_large_table) TO 'large_table_parts.json' (FORMAT JSON, PER_THREAD_OUTPUT true, COMPRESSION 'none');", "role": "ass...
[ { "content": "Export the `manufacturers` table to a gzip compressed CSV file.\nSCHEMA: CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255) NOT NULL,\n Headquarter VARCHAR(255) NOT NULL,\n Founder VARCHAR(255) NOT NULL,\n Revenue REAL,\n Contact_Info JSON,\n PRIMARY KEY (Code) \n);\n\nCREAT...
[ { "content": "What is the current version of DuckDB being used?\nSCHEMA: CREATE TABLE \"author\" (\n \"aid\" INTEGER,\n \"homepage\" VARCHAR(255),\n \"name\" VARCHAR(255),\n \"oid\" INTEGER,\n \"author_info\" ROW(value VARCHAR(255), id INTEGER),\n PRIMARY KEY(\"aid\")\n);\n\nCREATE TABLE \"co...
[ { "content": "What is the purpose of this set of SQL queries? It creates a table named 'tbl' with a single integer column in the 'my_schema' schema and then retrieves all rows from that table.\nSCHEMA: CREATE TABLE Services (\n Service_ID INTEGER NOT NULL,\n Service_Type_Code CHAR(15) NOT NULL,\n Serv...
[ { "content": "Export the entire database to a target directory in CSV format with a pipe delimiter.\nSCHEMA: CREATE TABLE Ref_Template_Types (\n Template_Type_Code CHAR(15) NOT NULL,\n Template_Type_Description VARCHAR(255) NOT NULL,\n Template_Type_Details JSON,\n PRIMARY KEY (Template_Type_Code)\n...
[ { "content": "Create a new table `osm_data` from the `.osm.pbf` file using `ST_Read` table function.\nSCHEMA: ", "role": "user" }, { "content": "CREATE TABLE osm_data AS SELECT * FROM ST_Read('some/file/path/filename.osm.pbf');", "role": "assistant" } ]
[ { "content": "Create a new table 'ontime' by loading data from 'flights.csv' using auto detection, header with line number 1, delimiter '|', and unifying columns by name.\nSCHEMA: CREATE TABLE \"Ref_Characteristic_Types\" (\n\"characteristic_type_code\" VARCHAR(15) PRIMARY KEY,\n\"characteristic_type_descriptio...
[ { "content": "Truncate a timestamp with time zone to a specific interval using the `time_bucket` function.\nSCHEMA: CREATE TABLE \"Ref_Characteristic_Types\" (\n\"characteristic_type_code\" VARCHAR(15) PRIMARY KEY,\n\"characteristic_type_description\" VARCHAR(80),\n\"nested_column\" VARCHAR(80)[]\n);\n\nCREATE ...
[ { "content": "Generate a query that demonstrates the use of a materialized CTE to improve performance by storing the result of a subquery that filters proteins with a sequence length greater than 500.\nSCHEMA: CREATE TABLE \"building\" (\n \"building_id\" VARCHAR(255),\n \"Name\" VARCHAR(255),\n \"Stre...