conversations listlengths 2 2 |
|---|
[
{
"content": "What is the date five days before the current date?\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_address VARCHAR(40),\n login_name VA... |
[
{
"content": "How can I read two Parquet files ('perpetrator1.parquet' and 'perpetrator2.parquet') with the same schema and treat them as a single table?\nSCHEMA: CREATE TABLE perpetrator (\n Perpetrator_ID INTEGER,\n People_ID INTEGER,\n Date VARCHAR,\n Year DOUBLE,\n Location VARCHAR,\n Coun... |
[
{
"content": "Demonstrate the optimized logical plan for calculating the average order items per premises type.\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 NU... |
[
{
"content": "What value does the 'infinity' special value represent as a TIMESTAMP?\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 REAL,\n Speed VARCHAR(255),\n Opened DATE,\n ... |
[
{
"content": "Extract the fifth character from the string 'DuckDB' using the array_extract function.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT array_extract('DuckDB', 5) AS fifth_character;",
"role": "assistant"
}
] |
[
{
"content": "Set the directory to which to write temp files to '/tmp'.\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\")\... |
[
{
"content": "Which Christian school was founded first?\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\" VARCHAR(255),\n \"Da... |
[
{
"content": "Which elimination moves are most commonly used in matches?\nSCHEMA: CREATE TABLE wrestler (\n Wrestler_ID INTEGER,\n Name VARCHAR(255),\n Reign VARCHAR(255),\n Days_held VARCHAR(255),\n Location VARCHAR(255),\n Event VARCHAR(255),\n Wrestler_Info STRUCT(Name VARCHAR(255), Rei... |
[
{
"content": "What is the total damage caused by storms with wind speeds over 100 mph in each region, and which regions had the most damage?\nSCHEMA: CREATE TABLE storm (\n Storm_ID INTEGER,\n Name VARCHAR(255),\n Dates_active VARCHAR(255),\n Max_speed INTEGER,\n Damage_millions_USD REAL,\n Nu... |
[
{
"content": "How can you create a new table named `sales_copy` with the same schema as the `sales` table but without any data?\nSCHEMA: CREATE TABLE \"entrepreneur\" (\n \"Entrepreneur_ID\" INTEGER,\n \"People_ID\" INTEGER,\n \"Company\" VARCHAR(255),\n \"Money_Requested\" FLOAT,\n \"Investor\" ... |
[
{
"content": "Create a table with a union column and insert values with different data types. Then, select all rows with the 'num' tag.\nSCHEMA: CREATE TABLE \"body_builder\" (\n \"Body_Builder_ID\" INTEGER,\n \"People_ID\" INTEGER,\n \"Snatch\" FLOAT,\n \"Clean_Jerk\" FLOAT,\n \"Total\" FLOAT,\... |
[
{
"content": "Create an Arrow IPC stream from the `phone_market` table, filtering rows with a `Num_of_stock` greater than 100.\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 \"Featu... |
[
{
"content": "How would you import orchestra data without header from a CSV file, assuming the CSV file has the same column order as the table?\nSCHEMA: CREATE TABLE \"conductor\" (\n \"Conductor_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Age\" INTEGER,\n \"Nationality\" VARCHAR(255),\n \"Year_of... |
[
{
"content": "Get the details of the `bit_count` function.\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\" VARCHAR(255),\n \... |
[
{
"content": "Which tables have an estimated size larger than the 'browser' table?\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT database_name, schema_name, table_name, estimated_size FROM duckdb_tables WHERE estimated_size > (SELECT estimated_size FROM duckdb_tables WHERE table_name = 'browser... |
[
{
"content": "Load data from `input.csv` into the `TV_series` table, specifying column names and header presence.\nSCHEMA: CREATE TABLE \"TV_Channel\" (\n \"id\" VARCHAR(255),\n \"series_name\" VARCHAR(255),\n \"Country\" VARCHAR(255),\n \"Language\" VARCHAR(255),\n \"Content\" VARCHAR(255),\n ... |
[
{
"content": "Get the Minister name and the era when they took office for the regions with RegionID equal to 1.\nSCHEMA: CREATE TABLE \"region\" (\n \"Region_ID\" INTEGER PRIMARY KEY,\n \"Region_name\" VARCHAR(255),\n \"Date\" DATE,\n \"Label\" VARCHAR(255),\n \"Format\" VARC... |
[
{
"content": "What is the Levenshtein distance between the ship names and mission codes for all missions of ships from the USA, excluding exact matches?\nSCHEMA: CREATE TABLE mission (\n Mission_ID INTEGER,\n Ship_ID INTEGER,\n Code VARCHAR(255),\n Launched_Year INTEGER,\n Location VARCHAR(255),\... |
[
{
"content": "List all movies that do not have the word 'the' in their title.\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_of_birth VARCHAR, birth_... |
[
{
"content": "Update the `Fastest_Qualifying` column in the `match` table with the corresponding `Name` from the `pilot` table.\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 (... |
[
{
"content": "Generate a query that displays the year, total horses, and the total horses from the previous year for each record in the `farm` table.\nSCHEMA: CREATE TABLE \"city\" (\n \"City_ID\" INTEGER,\n \"Official_Name\" VARCHAR(255),\n \"Status\" VARCHAR(255),\n \"Area_km_2\" DOUBLE,\n \"Po... |
[
{
"content": "Show the metadata of all internal (built-in) columns.\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\" DATETIME,\n\"addres... |
[
{
"content": "Given the schema, write a query that calculates a new date for each customer in NY by adding their account balance (modulo 365) days to January 1st, 2022. Limit the result to 5 rows.\nSCHEMA: CREATE TABLE bank (\n branch_ID INTEGER PRIMARY KEY,\n bname VARCHAR(20),\n no_of_customers INTE... |
[
{
"content": "How can I filter the unpivoted results to only show events with points greater than 15?\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 Hor... |
[
{
"content": "Create a new table called `player_summary` by importing data from a CSV file named `player_data.csv` and selecting the `Player`, `Team`, `Singles_Wins`, and `Doubles_Wins` columns.\nSCHEMA: CREATE TABLE \"country\" (\n \"Country_id\" INTEGER,\n \"Country_name\" VARCHAR(255),\n \"Capital\"... |
[
{
"content": "Extract the third element from the list ['a', 'b', 'c']\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT list_extract(['a', 'b', 'c'], 3) AS extracted_value;",
"role": "assistant"
}
] |
[
{
"content": "List the number of ships in each nationality.\nSCHEMA: CREATE TABLE mission (\n Mission_ID INTEGER,\n Ship_ID INTEGER,\n Code VARCHAR(255),\n Launched_Year INTEGER,\n Location VARCHAR(255),\n Speed_knots INTEGER,\n Fate VARCHAR(255),\n Union_Column UNION(num INT, str VARCHA... |
[
{
"content": "Find the name of the TV channel that airs the cartoon series 'Rick and Morty'.\nSCHEMA: CREATE TABLE \"TV_Channel\" (\n \"id\" VARCHAR(255),\n \"series_name\" VARCHAR(255),\n \"Country\" VARCHAR(255),\n \"Language\" VARCHAR(255),\n \"Content\" VARCHAR(255),\n \"Pixel_aspect_ratio... |
[
{
"content": "Show metadata about all primary key constraints.\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\nCREATE TABLE ... |
[
{
"content": "What are the names and data types of the user-defined columns in the 'main' schema?\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT column_name, data_type FROM duckdb_columns WHERE schema_oid = (SELECT oid FROM duckdb_schemas WHERE schema_name = 'main' AND internal = false);",
"... |
[
{
"content": "Show all internal (built-in) tables.\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),\n \"middle_name\" VARCHAR(... |
[
{
"content": "How can I sort the `storm` table by `Damage_millions_USD` in descending order, moving NULL values to the end?\nSCHEMA: CREATE TABLE storm (\n Storm_ID INTEGER,\n Name VARCHAR(255),\n Dates_active VARCHAR(255),\n Max_speed INTEGER,\n Damage_millions_USD REAL,\n Number_Deaths INTEG... |
[
{
"content": "Create a new table with the NOACCENT collation, insert names from the people table with the NOACCENT collation, and find people named 'jOHN' regardless of accents.\nSCHEMA: CREATE TABLE gymnast (\n Gymnast_ID INT,\n Floor_Exercise_Points FLOAT,\n Pommel_Horse_Points FLOAT,\n Rings_Poin... |
[
{
"content": "Which are the top 5 tracks with the most races?\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_Ope... |
[
{
"content": "Get the name, access count, and section title for all documents that can be read in read-only mode.\nSCHEMA: CREATE TABLE \"Roles\" (\n \"role_code\" VARCHAR(15) PRIMARY KEY,\n \"role_description\" VARCHAR(80),\n \"role_users\" INT[]\n);\n\nCREATE TABLE \"Users\" (\n \"user_id\" INTEG... |
[
{
"content": "Load data from the `input.json` file into the existing table named `my_table`.\nSCHEMA: ",
"role": "user"
},
{
"content": "COPY my_table FROM 'input.json';",
"role": "assistant"
}
] |
[
{
"content": "What is the current access mode of the database?\nSCHEMA: CREATE TABLE \"member\" (\n \"Member_ID\" INTEGER,\n \"Card_Number\" VARCHAR(255),\n \"Name\" VARCHAR(255),\n \"Hometown\" VARCHAR(255),\n \"Level\" INTEGER,\n \"Previous_Branches\" INT[], \n PRIMARY KEY (\"Member_ID\")... |
[
{
"content": "How can I load data from a JSON file located in a specific directory (`/path/to/json`) into an existing table called `my_table`?\nSCHEMA: ",
"role": "user"
},
{
"content": "COPY my_table FROM '/path/to/json/data.json';",
"role": "assistant"
}
] |
[
{
"content": "Read three Parquet files and treat them as a single table, assuming they have the same schema.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT * FROM read_parquet(['browser1.parquet', 'browser2.parquet', 'browser3.parquet']);",
"role": "assistant"
}
] |
[
{
"content": "Create a Substrait BLOB plan for calculating the average settled amount per policy type.\nSCHEMA: CREATE TABLE Customers (\n Customer_ID INTEGER NOT NULL,\n Customer_Details VARCHAR(255) NOT NULL,\n Customer_Addresses VARCHAR(255)[],\n PRIMARY KEY (Customer_ID)\n);\n\nCREATE TABLE Cust... |
[
{
"content": "Generate a bitstring with bits set for each distinct SchoolID value in the university table where Enrollment is greater than 20000.\nSCHEMA: CREATE TABLE university (\n School_ID INTEGER,\n School VARCHAR(255),\n Location VARCHAR(255),\n Founded REAL,\n Affiliat... |
[
{
"content": "List the metadata about the views available in the DuckDB instance.\nSCHEMA: CREATE TABLE member (\n Member_ID INT,\n Name VARCHAR(255),\n Nationality VARCHAR(255),\n Role VARCHAR(255),\n Additional_Info JSON,\n PRIMARY KEY (Member_ID)\n );\n\n CREA... |
[
{
"content": "Read a JSON object from a file with unstructured format.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT * FROM read_json_objects('my_file1.json', format='unstructured');",
"role": "assistant"
}
] |
[
{
"content": "How would you select a sample of 10 random rows from the `people` table?\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, C... |
[
{
"content": "Read all JSON files from 'sales2021' and 'sales2022' directories and treat them as a single table.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT * FROM read_json(['sales_2021/*.json', 'sales_2022/*.json']);",
"role": "assistant"
}
] |
[
{
"content": "Get a list of all indexes associated with the 'hosting_city' table.\nSCHEMA: CREATE TABLE \"city\" (\n \"City_ID\" INTEGER PRIMARY KEY,\n \"City\" VARCHAR(255),\n \"Hanzi\" VARCHAR(255),\n \"Hanyu_Pinyin\" VARCHAR(255),\n \"Regional_Population\" INTEGER,\n ... |
[
{
"content": "List the top 3 college locations along with their minimum college ID.\nSCHEMA: CREATE TABLE \"member\" (\n \"Member_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Country\" VARCHAR(255),\n \"College_ID\" INTEGER,\n \"Achievements\" VARCHAR(255)\n );",
"role":... |
[
{
"content": "How many customers are there in the sakila.db SQLite database?\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 D... |
[
{
"content": "Import the CSV file named 'broadcastshares.csv' into the 'broadcastshare' table using semicolon as the delimiter, single quotes as the quoting string, forcing quotes for ChannelID and ProgramID columns, and ignoring any errors.\nSCHEMA: CREATE TABLE \"program\" (\n \"Program_ID\" INTEGER,\n ... |
[
{
"content": "Unzip the downloaded extension and install it for use in the current DuckDB session.\nSCHEMA: CREATE TABLE \"Roles\" (\n \"role_code\" VARCHAR(15) PRIMARY KEY,\n \"role_description\" VARCHAR(80),\n \"role_users\" INT[]\n);\n\nCREATE TABLE \"Users\" (\n \"user_id\" INTEGER PRIMARY KEY,... |
[
{
"content": "Check if the FORCE CHECKPOINT command aborts the transaction and executes the checkpoint operation.\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)... |
[
{
"content": "Show the metadata of all boolean data types available in the DuckDB instance.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT * FROM duckdb_types() WHERE type_category = 'BOOLEAN';",
"role": "assistant"
}
] |
[
{
"content": "Which person has the minimum X coordinate value in their location that overlaps with the given polygon? Return their ID and the minimum X value.\nSCHEMA: CREATE TABLE candidate (\n Candidate_ID INTEGER,\n People_ID INTEGER,\n Poll_Source VARCHAR(255),\n Date DATE,\n Support_rate FLO... |
[
{
"content": "* Extract the microseconds from the provided timestamp.\nSCHEMA: CREATE TABLE \"film\" (\n \"Film_ID\" INTEGER,\n \"Title\" VARCHAR(255),\n \"Studio\" VARCHAR(255),\n \"Director\" VARCHAR(255),\n \"Gross_in_dollar\" INTEGER,\n \"Film_Locations\" VARCHAR[], \n PRIMARY KEY (\"Fi... |
[
{
"content": "Load all parquet files from both folder1 and folder2 into a single table.\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 ... |
[
{
"content": "Generate a list of subscripts (indices) for the query's input array.\nSCHEMA: CREATE TABLE \"artist\" (\n \"Artist_ID\" INTEGER,\n \"Artist\" VARCHAR(255),\n \"Age\" INTEGER,\n \"Famous_Title\" VARCHAR(255),\n \"Famous_Release_date\" DATE,\n \"Awards\" VARCHAR(255)[],\n PRIMAR... |
[
{
"content": "What are the County ID, Name, and Population from the CSV files with a name ending in '.csv' located in the 'county_data' folder?\nSCHEMA: CREATE TABLE \"county_public_safety\" (\n \"County_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Population\" INTEGER,\n \"Police_officers\" INTEGER,\... |
[
{
"content": "Query missions launched between 1990 and 2020, and calculate the age of each mission in years using TIMESTAMPTZ and datepart\nSCHEMA: CREATE TABLE mission (\n Mission_ID INTEGER,\n Ship_ID INTEGER,\n Code VARCHAR(255),\n Launched_Year INTEGER,\n Location VARCHAR(255),\n Speed_kno... |
[
{
"content": "Import the CSV file 'phones.csv' and explicitly define the column types.\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... |
[
{
"content": "What SQL query would you use to set the number of threads to a specific value, for example, 2?\nSCHEMA: CREATE TABLE Customer_Master_Index (\n master_customer_id INTEGER NOT NULL,\n cmi_details VARCHAR(255),\n cmi_details_struct STRUCT(name VARCHAR, age INTEGER),\n PRIMARY KEY (master_... |
[
{
"content": "Fetch all records from the Transactions_Lots table where the JSON field 'tl_json' contains a key-value pair with the key 'description' and the value contains the word 'sold' in a case-insensitive manner, using the escape character '!'.\nSCHEMA: CREATE TABLE \"Investors\" (\n\"investor_id\" INTEGER... |
[
{
"content": "Load data from multiple Parquet files located on an S3 bucket, adding a column with the file name for each row.\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, \... |
[
{
"content": "Write the `member` table to a hive partitioned data set of parquet files, with unique filenames based on the `Level` column.\nSCHEMA: CREATE TABLE \"member\" (\n \"Member_ID\" INTEGER,\n \"Card_Number\" VARCHAR(255),\n \"Name\" VARCHAR(255),\n \"Hometown\" VARCHAR(255),\n \"Level\" ... |
[
{
"content": "Replace with the instruction: \"Retrieve the sales information along with the unit price and total cost of the items sold, using the nearest lower unit price value for sales without an exact match.\"\nSCHEMA: CREATE TABLE \"course_arrange\" (\n\"Course_ID\" INTEGER,\n\"Teacher_ID\" INTEGER,\n\"Gr... |
[
{
"content": "Check if any competition year in the `competition` table is an infinite value.\nSCHEMA: CREATE TABLE \"club\" (\n \"Club_ID\" INTEGER,\n \"name\" VARCHAR(255),\n \"Region\" VARCHAR(255),\n \"Start_year\" INTEGER,\n \"Club_Info\" STRUCT(\n \"Region\" VARCHAR(255),\n \"S... |
[
{
"content": "Check if there is any climber from the country where the mountain 'Everest' is located.\nSCHEMA: CREATE TABLE \"mountain\" (\n \"Mountain_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Height\" FLOAT,\n \"Prominence\" FLOAT,\n \"Range\" VARCHAR(255),\n \"Country\" VARCHAR(255),\n ... |
[
{
"content": "Return the current value of the `extension_directory` setting.\nSCHEMA: CREATE TABLE \"singer\" (\n \"Singer_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Birth_Year\" REAL,\n \"Net_Worth_Millions\" REAL,\n \"Citizenship\" VARCHAR(255),\n \"Additional_Info\" STRUCT(\n \"Birth... |
[
{
"content": "Create a new user-defined type 'moviegenre' as an Enum with predefined values.\nSCHEMA: CREATE TABLE \"film\" (\n \"Film_ID\" INTEGER,\n \"Rank_in_series\" INTEGER,\n \"Number_in_season\" INTEGER,\n \"Title\" VARCHAR(255),\n \"Directors\" VARCHAR(255)[], \n \"Original_air_date\" ... |
[
{
"content": "Rebuild statistics for the 'Year' and 'Performers' columns in the 'concert' table.\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 \"Avera... |
[
{
"content": "Import the data from 'additional_people.parquet' parquet file into the existing `people` table.\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 ... |
[
{
"content": "Calculate the sine of the first element in the `Students_Taught` list for teachers younger than 30. Will the system implicitly cast the integer to a double?\nSCHEMA: CREATE TABLE \"course_arrange\" (\n\"Course_ID\" INTEGER,\n\"Teacher_ID\" INTEGER,\n\"Grade\" INTEGER,\n\"Class_Details\" VARCHAR(2... |
[
{
"content": "Find the school most similar to 'Duckington' using Jaro-Winkler similarity.\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_... |
[
{
"content": "How many schools have a budget table entry within 0.01 degrees of longitude and latitude?\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_Footba... |
[
{
"content": "Create a new table named `top_rated_programs` with the top 10 programs based on their average rating.\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\" ... |
[
{
"content": "Update the data in the SQLite table and then query the table to see the updated data.\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\nCRE... |
[
{
"content": "How can I get a 1% sample using Bernoulli sampling from the subquery that filters people taller than 150 cm?\nSCHEMA: CREATE TABLE perpetrator (\n Perpetrator_ID INTEGER,\n People_ID INTEGER,\n Date VARCHAR,\n Year DOUBLE,\n Location VARCHAR,\n Country VARCHAR,\n Killed INTEGE... |
[
{
"content": "Check the wrestlers who were eliminated before 30 minutes in any match, limiting the results to 10, using object caching to speed up the query.\nSCHEMA: CREATE TABLE wrestler (\n Wrestler_ID INTEGER,\n Name VARCHAR(255),\n Reign VARCHAR(255),\n Days_held VARCHAR(255),\n Location VA... |
[
{
"content": "Get the third element of the `Wrestler_Stats` array for the wrestler with `Wrestler_ID` 1.\nSCHEMA: CREATE TABLE wrestler (\n Wrestler_ID INTEGER,\n Name VARCHAR(255),\n Reign VARCHAR(255),\n Days_held VARCHAR(255),\n Location VARCHAR(255),\n Event VARCHAR(255),\n Wrestler_In... |
[
{
"content": "Convert the ASCII character code of the leftmost character in a string for the title of the first film.\nSCHEMA: CREATE TABLE \"film\" (\n \"Film_ID\" INTEGER,\n \"Rank_in_series\" INTEGER,\n \"Number_in_season\" INTEGER,\n \"Title\" VARCHAR(255),\n \"Directors\" VARCHAR(255)[], \n ... |
[
{
"content": "How can I select a sample of 10 rows from the `player` table?\nSCHEMA: CREATE TABLE \"club\" (\n \"Club_ID\" INTEGER,\n \"name\" VARCHAR(255),\n \"Region\" VARCHAR(255),\n \"Start_year\" INTEGER,\n \"Club_Info\" STRUCT(\n \"Region\" VARCHAR(255),\n \"Start_year\" INTEG... |
[
{
"content": "Create a table named `Test` with two columns, `column1` and `Column2`, and then query the table to select all records.\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 N... |
[
{
"content": "What is the sum of a specific column across three Parquet files?\nSCHEMA: CREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15) NOT NULL,\n Document_Type_Name VARCHAR(255) NOT NULL,\n Document_Type_Description VARCHAR(255) NOT NULL,\n Document_Type_Array_Column VARCHAR(255)[]... |
[
{
"content": "Read all Parquet files that match the glob pattern at any depth in the 'museum_data' directory.\nSCHEMA: CREATE TABLE \"museum\" (\n \"Museum_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Num_of_Staff\" INTEGER,\n \"Open_Year\" INTEGER,\n \"Staff_List\" INT[], \n PRIMARY KEY (\"Muse... |
[
{
"content": "\nSCHEMA: CREATE TABLE \"Ref_Feature_Types\" (\n\"feature_type_code\" VARCHAR(20) PRIMARY KEY,\n\"feature_type_name\" VARCHAR(80),\n\"feature_type_attributes\" JSON\n);\n\nCREATE TABLE \"Ref_Property_Types\" (\n\"property_type_code\" VARCHAR(20) PRIMARY KEY,\n\"property_type_description\" VARCHAR(... |
[
{
"content": "Calculate the interpolation of factorial for the `People_ID` column, limiting the results to `People_ID` values less than 5.\nSCHEMA: CREATE TABLE perpetrator (\n Perpetrator_ID INTEGER,\n People_ID INTEGER,\n Date VARCHAR,\n Year DOUBLE,\n Location VARCHAR,\n Country VARCHAR,\n ... |
[
{
"content": "Export the `exhibition_record` table to an S3 bucket, partitioned by both `Artist_ID` and `Year` columns.\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\"... |
[
{
"content": "Show the other_details of transactions where the length of the string is more than 50 characters.\nSCHEMA: CREATE TABLE \"Investors\" (\n\"investor_id\" INTEGER PRIMARY KEY,\n\"Investor_details\" VARCHAR(255),\n\"investor_json\" JSON\n);\n\nCREATE TABLE \"Lots\" (\n\"lot_id\" INTEGER PRIMARY KEY,\... |
[
{
"content": "Which wrestlers appear more than once in the wrestler table?\nSCHEMA: CREATE TABLE wrestler (\n Wrestler_ID INTEGER,\n Name VARCHAR(255),\n Reign VARCHAR(255),\n Days_held VARCHAR(255),\n Location VARCHAR(255),\n Event VARCHAR(255),\n Wrestler_Info STRUCT(Name VARCHAR(255), R... |
[
{
"content": "Create another table with a union column and insert some values. Then, select all the values from both tables using the UNION ALL operator.\nSCHEMA: CREATE TABLE \"entrepreneur\" (\n \"Entrepreneur_ID\" INTEGER,\n \"People_ID\" INTEGER,\n \"Company\" VARCHAR(255),\n \"Money_Requested\"... |
[
{
"content": "Which furniture items have the maximum number of components?\nSCHEMA: CREATE TABLE \"manufacturer\" (\n \"Manufacturer_ID\" INTEGER,\n \"Open_Year\" FLOAT,\n \"Name\" VARCHAR(255),\n \"Num_of_Factories\" INTEGER,\n \"Num_of_Shops\" INTEGER,\n \"Contact_Info\" STRUCT(\n \"A... |
[
{
"content": "Generate and load the Substrait extension in DuckDB.\nSCHEMA: CREATE TABLE \"musical\" (\n\"Musical_ID\" INTEGER,\n\"Name\" TEXT\n);",
"role": "user"
},
{
"content": "INSTALL substrait;\nLOAD substrait;",
"role": "assistant"
}
] |
[
{
"content": "How can I read two CSV files, 'farmcompetitiondata1.csv' and 'farmcompetitiondata2.csv', and add an extra 'filename' column to the result to indicate which row came from which file?\nSCHEMA: CREATE TABLE \"city\" (\n \"City_ID\" INTEGER,\n \"Official_Name\" VARCHAR(255),\n \"Status\" VARC... |
[
{
"content": "Describe the schema of the result for the query that retrieves the FestivalID and FestivalName columns from the festivaldetail table where the year is 2022 and the number of audiences is greater than 10000.\nSCHEMA: CREATE TABLE \"festival_detail\" (\n \"Festival_ID\" INTEGER,\n \"Festival_N... |
[
{
"content": "Create a new table in a SQLite database file by copying an existing table.\nSCHEMA: CREATE TABLE \"TV_Channel\" (\n \"id\" VARCHAR(255),\n \"series_name\" VARCHAR(255),\n \"Country\" VARCHAR(255),\n \"Language\" VARCHAR(255),\n \"Content\" VARCHAR(255),\n \"Pixel_aspect_ratio_PAR... |
[
{
"content": "Set the time zone to America/Los_Angeles for DuckDB.\nSCHEMA: CREATE TABLE Apartments (\n apt_id INTEGER NOT NULL ,\n building_id INTEGER NOT NULL,\n apt_type_code CHAR(15),\n apt_number CHAR(10),\n bathroom_count INTEGER,\n bedroom_count INTEGER,\n room_count CHAR(5),\n a... |
[
{
"content": "Get the name of the club and their total rank points for the top-ranked club.\nSCHEMA: CREATE TABLE \"club\" (\n \"Club_ID\" INTEGER,\n \"name\" VARCHAR(255),\n \"Region\" VARCHAR(255),\n \"Start_year\" INTEGER,\n \"Club_Info\" STRUCT(\n \"Region\" VARCHAR(255),\n \"St... |
[
{
"content": "Get the seconds part of the date from the 'flight' table.\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\" JSON,\n primary... |
[
{
"content": "Attempt to drop the FTS index for a nonexistent 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\nCREA... |
[
{
"content": "Set the checkpoint threshold to 5GB, add a new column to the Person table, and then trigger a manual checkpoint.\nSCHEMA: ",
"role": "user"
},
{
"content": "SET checkpoint_threshold='5GB';\nALTER TABLE Person ADD COLUMN new_column INTEGER;\nCHECKPOINT;",
"role": "assistant"
}
] |
[
{
"content": "Set the autoloadknownextensions configuration option to false, and then select all columns and rows from the medicine table.\nSCHEMA: CREATE TABLE \"medicine\" (\n \"id\" INTEGER,\n \"name\" VARCHAR(255),\n \"Trade_Name\" VARCHAR(255),\n \"FDA_approved\" BOOLEAN,\n \"additional_info... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.