conversations listlengths 2 2 |
|---|
[
{
"content": "What are the tables available in the current database?\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\" INTEGER\n ... |
[
{
"content": "Return the number of seconds in an interval of 213600 seconds.\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 PRIMARY KEY (People_ID)\n);\n\nC... |
[
{
"content": "How can I extract the 'name' field from the JSON objects in the `input.json` file and store it in a column named 'name'?\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT json_extract(data, '$.name') as name FROM read_json_auto('input.json');",
"role": "assistant"
}
] |
[
{
"content": "Count the number of set bits in the Max_speed field of the Storm_Info struct for all storms with damage greater than 1000 million USD.\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,... |
[
{
"content": "Increase the Sales column by 100 for all entries in the journal table where the date is in January 2022.\nSCHEMA: CREATE TABLE IF NOT EXISTS \"journal\" (\n \"Journal_ID\" INTEGER,\n \"Date\" DATE,\n \"Theme\" VARCHAR(255),\n \"Sales\" INTEGER,\n \"Extra_Info\" JSON,\n \"Authors\... |
[
{
"content": "What query would add a new column named `previous_winner` with a data type of `INTEGER` to the `competition` 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 ... |
[
{
"content": "Show information about the columns in the Addresses table, such as column names, data types, and whether they allow NULL values.\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_n... |
[
{
"content": "Find all bookings in the Eastern Time Zone for building 123 between January 1, 2022 and January 7, 2022.\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 be... |
[
{
"content": "What SQL query should be used to export a partial result of a query that selects `column_1` and `column_2` from `my_table` where `column_3` is not null to a JSON file named 'partialoutput.json' using the JSON format?\nSCHEMA: ",
"role": "user"
},
{
"content": "COPY (SELECT column_1, co... |
[
{
"content": "Delete all records in the `csu_fees` table where the `CampusFee` is greater than 5000 and `Year` is 2021.\nSCHEMA: CREATE TABLE \"Campuses\" (\n \"Id\" INTEGER PRIMARY KEY, \n \"Campus\" TEXT, \n \"Location\" TEXT, \n \"County\" TEXT, \n \"Year\" INTEGER,\n \"CampusInfo\" JSON\n)... |
[
{
"content": "How many values are there in the 'location' column for all Parquet files in the directory?\nSCHEMA: CREATE TABLE \"Addresses\" (\n\"address_id\" INTEGER PRIMARY KEY,\n\"line_1_number_building\" VARCHAR(80),\n\"city\" VARCHAR(50),\n\"zip_postcode\" VARCHAR(20),\n\"state_province_county\" VARCHAR(50... |
[
{
"content": "Insert a new TV channel with specific column values and use the default value for the id column.\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": "Find the point on the surface of the square defined by the point at coordinates (0.5, 0.5) using STPointOnSurface and STMakePoint functions.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT ST_PointOnSurface(ST_MakePoint(0.5, 0.5));",
"role": "assistant"
}
] |
[
{
"content": "How do I load data from a CSV file named 'rollercoasterswithfeatures.csv' with specific column names and types?\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 S... |
[
{
"content": "Get all columns and rows from the School table.\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\" TEXT,\n ... |
[
{
"content": "Find the average budget for each department and ranking, including the overall average budget for all departments.\nSCHEMA: CREATE TABLE \"department\" (\n \"Department_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Creation\" VARCHAR(255),\n \"Ranking\" INTEGER,\n \"Budget_in_Billions\... |
[
{
"content": "How can I import data from a CSV file named 'peopledata.csv' into the 'people' table using the CSV format, comma delimiter, double quote as the quote character, and header row?\nSCHEMA: CREATE TABLE perpetrator (\n Perpetrator_ID INTEGER,\n People_ID INTEGER,\n Date VARCHAR,\n Year DOU... |
[
{
"content": "Enable the progress bar for long queries.\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_Points FLOAT,\n Total_Points FL... |
[
{
"content": "What is the ISO date representation of the address start dates in the `Customer_Addresses` table?\nSCHEMA: CREATE TABLE \"Addresses\" (\n\"address_id\" INTEGER PRIMARY KEY,\n\"address_content\" VARCHAR(80),\n\"city\" VARCHAR(50),\n\"zip_postcode\" VARCHAR(20),\n\"state_province_county\" VARCHAR(50... |
[
{
"content": "Create a table with a NOACCENT collation and insert two medicine names. Now, select the rows where the name is either 'Motrin' or 'moxifloxacin'.\nSCHEMA: CREATE TABLE \"medicine\" (\n \"id\" INTEGER,\n \"name\" VARCHAR(255),\n \"Trade_Name\" VARCHAR(255),\n \"FDA_approved\" BOOLEAN,\n... |
[
{
"content": "What is the hash value for the duck emoji using the `hash` function?\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 ... |
[
{
"content": "Calculate the kurtosis of the 'Price_in_Dollar' column for the furniture manufactured by manufacturer with ID 1.\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\"... |
[
{
"content": "Insert a row of pilot record data using the VALUES clause.\nSCHEMA: CREATE TABLE \"aircraft\" (\n \"Aircraft_ID\" INTEGER,\n \"Order_Year\" INTEGER,\n \"Manufacturer\" VARCHAR(255),\n \"Model\" VARCHAR(255),\n \"Fleet_Series\" VARCHAR(255),\n \"Powertrain\" VARCHAR(255),\n \"F... |
[
{
"content": "Find markets and phones that do not overlap in location and are not located at the center of the market.\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\" JS... |
[
{
"content": "What data is stored in the SQLite table we created?\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 Status VARCHAR(255... |
[
{
"content": "Attach a new SQLite database file, create a table in it, insert a row into the table and query the table.\nSCHEMA: CREATE TABLE \"captain\" (\n \"Captain_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Ship_ID\" INTEGER,\n \"age\" INTEGER,\n \"Class\" VARCHAR(255),\n \"Rank\" VARCHAR(... |
[
{
"content": "Find orders with non-numeric shipping charges (NaN).\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\"address... |
[
{
"content": "Create a new teacher in the Postgres database with ID 1, named John Doe, aged 45, from New York, and who has taught students in classes 101 and 102.\nSCHEMA: CREATE TABLE \"course_arrange\" (\n\"Course_ID\" INTEGER,\n\"Teacher_ID\" INTEGER,\n\"Grade\" INTEGER,\n\"Class_Details\" VARCHAR(255),\nPR... |
[
{
"content": "Load a Parquet file over HTTP(S) using the `read_parquet()` function and the `httpfs` extension.\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 TABLE \"Pro... |
[
{
"content": "Import a JSON file named 'invoices.json' containing an array of invoices into the Invoices table.\nSCHEMA: CREATE TABLE \"Customers\" (\n\"customer_id\" INTEGER PRIMARY KEY,\n\"customer_name\" VARCHAR(80),\n\"customer_details\" VARCHAR(255),\n\"customer_orders\" INT[]\n);\n\nCREATE TABLE \"Invoice... |
[
{
"content": "Update a film title, illustrating the potential for unique constraint violations due to over-eager unique constraint checking.\nSCHEMA: CREATE TABLE \"film\" (\n \"Film_ID\" INTEGER,\n \"Rank_in_series\" INTEGER,\n \"Number_in_season\" INTEGER,\n \"Title\" VARCHAR(255),\n \"Director... |
[
{
"content": "Create a SQL query that calculates the convex hull of a set of two points with longitude 174.764173 and latitude -36.872456 in EPSG:4326 (WGS84) and transforms the result to EPSG:3857 using STTransform, STConvexHull, and STCollect functions.\nSCHEMA: ",
"role": "user"
},
{
"content": "... |
[
{
"content": "_Compare player names in a case-insensitive manner._\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 \tVARC... |
[
{
"content": "Export the `nomination` table to a Parquet file named 'nominationresult.parquet'.\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_Au... |
[
{
"content": "Return the current value of the `http_retry_wait_ms` configuration setting.\nSCHEMA: CREATE TABLE \"city\" (\n \"City_ID\" INTEGER,\n \"Official_Name\" VARCHAR(255),\n \"Status\" VARCHAR(255),\n \"Area_km_2\" DOUBLE,\n \"Population\" DOUBLE,\n \"Census_Ranking\" VARCHAR(255),\n ... |
[
{
"content": "Modify the data type of the `treatment_type_description` column in the `Treatment_Types` table to `VARCHAR(30)` and remove leading and trailing whitespace from the existing values.\nSCHEMA: CREATE TABLE \"Breeds\" (\n\"breed_code\" VARCHAR(10) PRIMARY KEY ,\n\"breed_name\" VARCHAR(80),\n\"addition... |
[
{
"content": "How can we use the `bit_count` and `bitstring_agg` functions to count the number of distinct wrestlers in the `Elimination` 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... |
[
{
"content": "Convert the `time` column from the `train` table to a VARCHAR data type.\nSCHEMA: CREATE TABLE \"train\" (\n \"id\" INTEGER,\n \"train_number\" INTEGER,\n \"name\" VARCHAR(255),\n \"origin\" VARCHAR(255),\n \"destination\" VARCHAR(255),\n \"time\" TIME,\n \"interval\" INTERVAL... |
[
{
"content": "Convert the rows of the `Problem_Log` table with a 'HARDWARE' category into Arrow IPC format.\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 TABLE \"Proble... |
[
{
"content": "Which order items were not delivered between January 1st, 2021 and December 31st, 2021?\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\"dat... |
[
{
"content": "Copy the match results with more than 100 points to a Parquet file with gzip compression and a row group size of 256,000 rows.\nSCHEMA: CREATE TABLE IF NOT EXISTS \"player\" (\n \"Player_ID\" INTEGER,\n \"Sponsor_name\" VARCHAR(255),\n \"Player_name\" VARCHAR(255),\n \"Gender\" VARCHA... |
[
{
"content": "What is the maximum character length for each VARCHAR column, along with their table name, in the entire database, ordered by column index?\nSCHEMA: CREATE TABLE \"GEOGRAPHIC\" (\n \"CITY_NAME\" VARCHAR(255) CONSTRAINT pk_geo PRIMARY KEY,\n \"COUNTY\" VARCHAR(255),\n \"REGION\" VARCHAR(2... |
[
{
"content": "Generate a hash for each movie title in the movie table.\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_year IN... |
[
{
"content": "How can I export the `Institution` table to an S3 bucket with partitions based on the `Type` and `Enrollment` columns?\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... |
[
{
"content": "Which songs have a highest position on the charts lower than 5?\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 \"Birt... |
[
{
"content": "Create a sublist from the `Array_Column` of the `mission` table for a specific mission ID.\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)... |
[
{
"content": "Calculate the total attendance of all events.\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 TA... |
[
{
"content": "List climbers from the USA and Canada with more than 8000 points.\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 \"Climbers\" INT[], \n... |
[
{
"content": "Find the names and nationalities of all actors whose names start with the letter 'a' (case-insensitive).\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_in... |
[
{
"content": "Reset the memory limit to its default value and show a list of all available settings.\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... |
[
{
"content": "How can I generate data for the TPC-DS benchmark with a scale factor of 1?\nSCHEMA: CREATE TABLE \"railway\" (\n \"Railway_ID\" INTEGER,\n \"Railway\" VARCHAR(255),\n \"Builder\" VARCHAR(255),\n \"Built\" VARCHAR(255),\n \"Wheels\" VARCHAR(255),\n \"Location\" VARCHAR(255),\n ... |
[
{
"content": "Delete the `myschema` schema and all its dependent objects.\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 TABLE \"Problem_Log\" (\n\"problem_log_id\" INTE... |
[
{
"content": "Find all columns in the 'College' table where the state is 'CA'.\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 \tpN... |
[
{
"content": "As a language model, you would generate this SQL query to manually synchronize data in the default database without aborting any transactions.\nSCHEMA: CREATE TABLE \"member\" (\n \"Member_ID\" INTEGER,\n \"Card_Number\" VARCHAR(255),\n \"Name\" VARCHAR(255),\n \"Hometown\" VARCHAR(255... |
[
{
"content": "Create a table called `products_sold` with three columns, `product_id`, `quantity`, and `sale_date`, only if it doesn't already exist.\nSCHEMA: CREATE TABLE Addresses (\n Address_ID INTEGER NOT NULL,\n address_details VARCHAR(255),\n address_coordinates DOUBLE[],\n PRIMARY KEY (Address... |
[
{
"content": "What is the minimum and maximum launch date for programs from the USA?\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 (\"Progr... |
[
{
"content": "Get the current local timestamp, which corresponds to the local date and time in the current time zone.\nSCHEMA: CREATE TABLE \"buildings\" (\n \"id\" INTEGER,\n \"name\" VARCHAR(255),\n \"City\" VARCHAR(255),\n \"Height\" INTEGER,\n \"Stories\" INTEGER,\n \"Status\" VARCHAR(255)... |
[
{
"content": "Create the md5 hash of the 'shipname' value from the 'MapColumn' for ships with a tonnage greater than 5000 in the 'ship' table.\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... |
[
{
"content": "Create a pivot table for financial transactions, grouped by account ID, with the sum of transaction amounts for each transaction type.\nSCHEMA: ",
"role": "user"
},
{
"content": "PIVOT Financial_Transactions ON transaction_type USING SUM(transaction_amount) GROUP BY account_id;",
"... |
[
{
"content": "Get the top 3 wrestlers with the longest days held as champions.\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... |
[
{
"content": "\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\" VARCHAR(255)[]\n);\n\nCREATE TABLE \"Catalogs\" (\n\"catalog_id\" INTEGER PRIMARY KEY,\n\"catalog_name\" VARCHAR(50... |
[
{
"content": "Generate hash values for the event names in the `party_events` table.\nSCHEMA: CREATE TABLE \"region\" (\n \"Region_ID\" INTEGER PRIMARY KEY,\n \"Region_name\" VARCHAR(255),\n \"Date\" DATE,\n \"Label\" VARCHAR(255),\n \"Format\" VARCHAR(255),\n \"Catalog... |
[
{
"content": "Generate a query that formats the first value of the `Statement_Map_Column` column in the `Statements` table to display the number in Excel's Currency format, for statement with ID 123.\nSCHEMA: CREATE TABLE Ref_Document_Types (\n Document_Type_Code CHAR(15) NOT NULL,\n Document_Type_Name VA... |
[
{
"content": "Create a new enum type 'performancetype' with five possible values: 'concert', 'recital', 'opera', 'ballet', and 'musical'.\nSCHEMA: CREATE TABLE member (\n Member_ID INT,\n Name VARCHAR(255),\n Nationality VARCHAR(255),\n Role VARCHAR(255),\n Additional_Info JS... |
[
{
"content": "Calculate the arccosine of the DayNumber for all calendar dates between '2022-01-01' and '2022-01-10' inclusive.\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... |
[
{
"content": "How can you read all CSV files starting with 'people' and unify the columns by position?\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 INTEGER,\n Injured INTE... |
[
{
"content": "What are the names and types of the columns in the Parquet file for the `elimination` table, specifically for the columns 'EliminationID', 'WrestlerID', 'Team', 'EliminatedBy', 'EliminationMove', 'Time', and 'WrestlerStats'?\nSCHEMA: CREATE TABLE wrestler (\n Wrestler_ID INTEGER,\n Name VAR... |
[
{
"content": "Create a table with a union column and insert values with different data types. Then, retrieve the tag names indicating which alternative the union is currently holding, but only for the rows where the tag is 'num'.\nSCHEMA: CREATE TABLE \"artist\" (\n \"Artist_ID\" INTEGER,\n \"Name\" VARCH... |
[
{
"content": "Generate a CSV file named 'john_doe_products.csv' that includes the code, name, and price of all products manufactured by companies founded by John Doe, using headers for the columns.\nSCHEMA: CREATE TABLE Manufacturers (\n Code INTEGER,\n Name VARCHAR(255) NOT NULL,\n Headquarter VARCHAR(255) ... |
[
{
"content": "Truncate the date April 20, 1992 to the nearest 2-month interval, with an offset of 1 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\" INTEGER,\n ... |
[
{
"content": "Import and add new exhibitions with unique themes to the `exhibition` 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 (\"Ar... |
[
{
"content": "Read all Parquet files from the 'test_folder' directory.\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(... |
[
{
"content": "Compare the query plan with and without FSST vectors for a SELECT statement.\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 \"Average\" I... |
[
{
"content": "What is the effect of running a CHECKPOINT command within a transaction that ultimately fails or is rolled back?\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_Ba... |
[
{
"content": "How would you extract 1000 random rows from the Projects table using reservoir sampling with a fixed seed?\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 ... |
[
{
"content": "How can I calculate the total quantity, as a DECIMAL(10,2), for each order in the OrderItems table, by joining with the CustomerOrders table?\nSCHEMA: CREATE TABLE \"Customer_Addresses\" (\n\"customer_id\" INTEGER NOT NULL,\n\"premise_id\" INTEGER NOT NULL,\n\"date_address_from\" DATETIME NOT NUL... |
[
{
"content": "Set the search path to include 'db1' and 'db2' and query tables 'tbl1' and 'tbl2' using their simple names.\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... |
[
{
"content": "How can I read a CSV file named 'church.csv' with specific column types and headers using the `read_csv` function?\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 VARC... |
[
{
"content": "Attach a remote PostgreSQL database with authentication and query the 'conference' table with a condition.\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 INT... |
[
{
"content": "Insert new rows into the `entrepreneur` table with auto-incremented primary keys and return the inserted rows.\nSCHEMA: CREATE TABLE \"entrepreneur\" (\n \"Entrepreneur_ID\" INTEGER,\n \"People_ID\" INTEGER,\n \"Company\" VARCHAR(255),\n \"Money_Requested\" FLOAT,\n \"Investor\" VAR... |
[
{
"content": "Create a buffer around a point at the coordinates (1.0, 2.0) with a radius of 0.5, and then reverse the order of the coordinates in the resulting geometry.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT ST_Reverse(ST_Buffer(ST_Point(1.0, 2.0), 0.5));",
"role": "assistant"
}
] |
[
{
"content": "How can you retrieve the value of a key-value pair in a map using the elementat function?\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT element_at(map { 'key1': 5, 'key2': 43 }, 'key1');",
"role": "assistant"
}
] |
[
{
"content": "Generate the query plan and analyze the execution time for selecting the Product Name, Manufacturer Name, and Price from the Products table, joining with the Manufacturers table, filtering Manufacturers with a Revenue greater than 500,000, ordering by Price in descending order, and limiting the re... |
[
{
"content": "Sum the price in dollars for each number of factories in the \"manufacturer\" table.\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_Inf... |
[
{
"content": "Select a sample of 2% of the cinema table using Bernoulli sampling, focusing on cinema IDs and capacities.\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)[], ... |
[
{
"content": "Add an interval to a TIMESTAMPTZ value using the ICU extension.\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 \"Residence\" VARCHAR(255),\n \"Occupation\" VA... |
[
{
"content": "Import CSV data from a file with errors, ignoring the rows with errors, and create a table based on the schema provided in the documentation.\nSCHEMA: CREATE TABLE \"stadium\" (\n \"Stadium_ID\" INTEGER,\n \"Location\" VARCHAR(255),\n \"Name\" VARCHAR(255),\n \"Capacity\" INTEGER,\n ... |
[
{
"content": "Get the details of employees who were hired on January 1, 2000.\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 \"C... |
[
{
"content": "Find happy hour events with a non-NULL struct containing a NULL staff name.\nSCHEMA: CREATE TABLE \"shop\" (\n \"Shop_ID\" INTEGER,\n \"Address\" VARCHAR(255),\n \"Num_of_staff\" INTEGER,\n \"Score\" REAL,\n \"Open_Year\" INTEGER,\n \"Staff_List\" INT[], \n PRIMARY KEY (\"Shop... |
[
{
"content": "How can I pivot the 'musical' table based on the 'Year' column, calculating the sum of 'NumberofAwards' (from the JSON 'AwardDetails' column) for each year, and then filter the results to show only those with a total greater than 5?\nSCHEMA: CREATE TABLE \"musical\" (\n\"Musical_ID\" INTEGER,\n\"... |
[
{
"content": "As a language model, you might provide the following instruction: \n\"Perform a no-op VACUUM command to ensure DuckDB's compatibility with PostgreSQL.\"\nSCHEMA: CREATE TABLE \"employee\" (\n \"Employee_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Age\" INTEGER,\n \"City\" VARCHAR(255),\... |
[
{
"content": "Create a JSON string from a date value.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT '2023-05-12'::DATE::JSON;",
"role": "assistant"
}
] |
[
{
"content": "Create a separate column for each ship type and calculate the total tonnage for each battle.\nSCHEMA: CREATE TABLE ship (\n lost_in_battle INTEGER,\n id INTEGER\n );",
"role": "user"
},
{
"content": "PIVOT ship ON ship_type USING SUM(tonnage) GROUP BY lost_in_battle;"... |
[
{
"content": "Compute the 10-logarithm of (Quantity + 1) for all devices in the shop with ID 1.\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_Platform... |
[
{
"content": "Convert the VARCHAR type Addressroad to BLOB type and then decode it back to VARCHAR.\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... |
[
{
"content": "Count the number of rows in `table_name` where the `column_name` equals 'somevalue', even if the column is of a different type than the provided value.\nSCHEMA: CREATE TABLE People (\n person_id INTEGER NOT NULL,\n first_name TEXT,\n middle_name TEXT,\n last_name TEXT,... |
[
{
"content": "Read multiple CSV files with different schemas and a WHERE clause, unifying the columns by name. Note that the schema unification by name will handle the different number of columns between the files.\nSCHEMA: CREATE TABLE \"captain\" (\n \"Captain_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n ... |
[
{
"content": "Unpivot the `Memory_in_G` and `Price` columns from the `phone` table and order the result set by `Phone_ID` and `Attribute`.\nSCHEMA: CREATE TABLE \"phone\" (\n \"Name\" VARCHAR(255),\n \"Phone_ID\" INTEGER,\n \"Memory_in_G\" INTEGER,\n \"Carrier\" VARCHAR(255),\n \"Price\" DOUBLE,\... |
[
{
"content": "Read data from a Parquet file stored in an S3-compatible object storage server using S3 API with per-request configuration.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT * FROM 's3://bucket/file.parquet?s3_region=region&s3_session_token=session_token';",
"role": "assistant"
... |
[
{
"content": "Convert the given timestamp in GMT to a timestamp in the 'America/Denver' time zone using the local time.\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 \"F... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.