conversations listlengths 2 2 |
|---|
[
{
"content": "Select a sample of 20% of the ProblemLog table where the problem status is 'open' using system sampling?\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 TAB... |
[
{
"content": "Set the S3 region where the data resides.\nSCHEMA: CREATE TABLE \"venue\" (\n \"venueId\" INTEGER NOT NULL,\n \"venueName\" VARCHAR(100),\n \"venueInfo\" JSON,\n PRIMARY KEY (\"venueId\")\n);\n\nCREATE TABLE \"author\" (\n \"authorId\" INTEGER NOT NULL,\n \"authorName\" VARCHAR(50),\n \"aut... |
[
{
"content": "Provide statistics about the maximum velocity in 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 ... |
[
{
"content": "What is the current value of the 'threads' setting?\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\" INTEGER,\n \"Seating_Ar... |
[
{
"content": "Create a sequence for generating product IDs starting from 1.\nSCHEMA: CREATE TABLE \"product\" (\n \"product_id\" INTEGER,\n \"product\" VARCHAR(255),\n \"dimensions\" VARCHAR(255),\n \"dpi\" REAL,\n \"pages_per_minute_color\" REAL,\n \"max_page_size\" VARCHAR(255),\n \"inter... |
[
{
"content": "What SQL query can be used to export all records from the 'debatepeople' table where the affirmative side won to a CSV file named 'affirmativewins.csv'?\nSCHEMA: ",
"role": "user"
},
{
"content": "COPY (SELECT * FROM debate_people WHERE If_Affirmative_Win = true) TO 'affirmative_wins.c... |
[
{
"content": "What are the values in the struct {'a': [1, 2, 3], 'b': 88} after unnesting?\nSCHEMA: CREATE TABLE \"medicine\" (\n \"id\" INTEGER,\n \"name\" VARCHAR(255),\n \"Trade_Name\" VARCHAR(255),\n \"FDA_approved\" BOOLEAN,\n \"additional_info\" JSON,\n primary key (\"id\")\n);\n\nCREATE... |
[
{
"content": "Instruction: Update the sales figure for the company with ID 1.\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 \"Profit... |
[
{
"content": "Load the CSV file 'flights.csv' starting from the 11th row, auto-infer options, and specify the column types for 'FlightDate' and 'UniqueCarrier'.\nSCHEMA: CREATE TABLE pilot (\n Pilot_Id INTEGER,\n Name VARCHAR(50),\n Age INTEGER,\n Additional_Info STRUCT(experience INTEGER, awards VA... |
[
{
"content": "For each unique title, find the maximum number of papers that cited it.\nSCHEMA: CREATE TABLE \"venue\" (\n \"venueId\" INTEGER NOT NULL,\n \"venueName\" VARCHAR(100),\n \"venueInfo\" JSON,\n PRIMARY KEY (\"venueId\")\n);\n\nCREATE TABLE \"author\" (\n \"authorId\" INTEGER NOT NULL,\n \"auth... |
[
{
"content": "Get the Unicode code of the first character in order details.\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),\n\"country\" VARCHAR(50),\n\"othe... |
[
{
"content": "Which sequences in the DuckDB instance have a maximum value greater than 1,000,000?\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_Cla... |
[
{
"content": "Find the sequence of Artist IDs for all artists from the USA, ordered by their ID.\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": "Identify events with more than 10,000 attendees and check if there are any infinite dates in the `event` table.\nSCHEMA: CREATE TABLE \"event\" (\n \"Event_ID\" INTEGER,\n \"Date\" DATE,\n \"Venue\" VARCHAR(255),\n \"Name\" VARCHAR(255),\n \"Event_Attendance\" INTEGER,\n \"Attend... |
[
{
"content": "Generate a SQL query to adjust the StartDate of all policies with the same year in StartDate and EndDate by adding the difference in months between EndDate and StartDate.\nSCHEMA: CREATE TABLE Customers (\n Customer_ID INTEGER NOT NULL,\n Customer_Details VARCHAR(255) NOT NULL,\n Customer... |
[
{
"content": "What are the current configuration settings in DuckDB?\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 ... |
[
{
"content": "Install, load, and generate data for the TPC-DS extension.\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 primar... |
[
{
"content": "Show the date of the ceremony of music festivals in the format \"Weekday d Month YYYY\" (e.g. \"Monday 2 March 2020\").\nSCHEMA: CREATE TABLE \"artist\" (\n \"Artist_ID\" INTEGER,\n \"Artist\" VARCHAR(255),\n \"Age\" INTEGER,\n \"Famous_Title\" VARCHAR(255),\n \"Famous_Release_date\... |
[
{
"content": "Delete the full-text index for the `corpus` table.\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\" V... |
[
{
"content": "Write a query that calculates the md5 hash of a given string using the `md5` function.\nSCHEMA: CREATE TABLE \"county_public_safety\" (\n \"County_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Population\" INTEGER,\n \"Police_officers\" INTEGER,\n \"Residents_per_officer\" INTEGER,\n ... |
[
{
"content": "Write the result of the query, which selects furniture with more than 5 components, to a Parquet file named 'expensive_furniture.parquet' with zstd compression.\nSCHEMA: CREATE TABLE \"manufacturer\" (\n \"Manufacturer_ID\" INTEGER,\n \"Open_Year\" FLOAT,\n \"Name\" VARCHAR(255),\n \"N... |
[
{
"content": "How many minutes passed between the LaunchedYear and Fate for missions involving Space Shuttles?\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 VARCHA... |
[
{
"content": "Show all non-internal views available in the DuckDB instance.\nSCHEMA: CREATE TABLE bank (\n branch_ID INTEGER PRIMARY KEY,\n bname VARCHAR(20),\n no_of_customers INTEGER,\n city VARCHAR(10),\n state VARCHAR(20),\n contact_info STRUCT(address VARCHAR, phone VARCHAR)\n);\n\nCREAT... |
[
{
"content": "Extract the string values from the union column.\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 PRIMARY KEY (... |
[
{
"content": "Delete all roller coasters in the country with CountryID 123.\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 V... |
[
{
"content": "How can I use Ibis to perform an equi-join between two DuckDB tables based on a common column?\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 Additi... |
[
{
"content": "Load the httpfs extension, set the GCS endpoint and credentials, and count the number of rows in the public Parquet file.\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_prov... |
[
{
"content": "What is the average opening year for the top 3 shop locations?\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\" VARCHAR(255),\n ... |
[
{
"content": "How can you modify the SQLite database and the result of subsequent operations can then be read using SQLite?\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": "Export the `membership_register_branch` table to a hive partitioned data set of parquet files for the year 2022, overwriting any existing directories.\nSCHEMA: CREATE TABLE \"member\" (\n \"Member_ID\" INTEGER,\n \"Card_Number\" VARCHAR(255),\n \"Name\" VARCHAR(255),\n \"Hometown\" VAR... |
[
{
"content": "Change the global `memory_limit` configuration option to 5GB.\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\" VARCHAR(100),\n ... |
[
{
"content": "Get the age of each representative by subtracting their birth year (from the `Lifespan` column) from the current year.\nSCHEMA: CREATE TABLE \"election\" (\n \"Election_ID\" INTEGER,\n \"Representative_ID\" INTEGER,\n \"Date\" DATE,\n \"Votes\" DOUBLE,\n \"Vote_Percent\" DOUBLE,\n ... |
[
{
"content": "How can I drop the `in_memory_table` table if it exists?\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 (\"Program_ID\")\n);\n... |
[
{
"content": "Get the data type of column1 from the mytable table.\nSCHEMA: CREATE TABLE \"course_arrange\" (\n\"Course_ID\" INTEGER,\n\"Teacher_ID\" INTEGER,\n\"Grade\" INTEGER,\n\"Class_Details\" VARCHAR(255),\nPRIMARY KEY (\"Course_ID\",\"Teacher_ID\",\"Grade\"),\nFOREIGN KEY (\"Course_ID\") REFERENCES \"co... |
[
{
"content": "Add a new column `venueRating` to the `venue` table, which will be filled with the default value 0.\nSCHEMA: CREATE TABLE \"venue\" (\n \"venueId\" INTEGER NOT NULL,\n \"venueName\" VARCHAR(100),\n \"venueInfo\" JSON,\n PRIMARY KEY (\"venueId\")\n);\n\nCREATE TABLE \"author\" (\n \"authorId\"... |
[
{
"content": "Create a new table `purchases` by reading data from a CSV file using the `read_csv_auto` function.\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_B... |
[
{
"content": "How does the query planner handle a query with a conjunction of conditions on indexed columns?\nSCHEMA: CREATE TABLE \"Breeds\" (\n\"breed_code\" VARCHAR(10) PRIMARY KEY ,\n\"breed_name\" VARCHAR(80),\n\"additional_info\" JSON\n);\n\nCREATE TABLE \"Charges\" (\n\"charge_id\" INTEGER PRIMARY KEY ,\... |
[
{
"content": "\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 key(\"id\")\n);\n\nCREATE TABLE \"operate_company\" (\n ... |
[
{
"content": "What is the player name and their team's name reversed for players older than 25?\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 \... |
[
{
"content": "Which schools are high schools and what grades do they offer?\nSCHEMA: CREATE TABLE \"driver\" (\n \"Driver_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Party\" VARCHAR(255),\n \"Home_city\" VARCHAR(255),\n \"Age\" INTEGER,\n \"Additional_Info\" JSON,\n PRIMARY KEY (\"Driver_ID\... |
[
{
"content": "How can I pivot the `repair_assignment` table on the `Status` column, counting the number of assignments for each technician-machine pair, grouped by `technician_id` and `Machine_ID`?\nSCHEMA: CREATE TABLE \"repair\" (\n \"repair_ID\" INTEGER,\n \"name\" VARCHAR(255),\n \"Launch_Date\" DA... |
[
{
"content": "How can we create a full-text search index for the 'stationcompany' table, indexing the 'AssociationDetails->companyname' field, while ignoring punctuation and non-alphabetic characters?\nSCHEMA: CREATE TABLE \"company\" (\n \"Company_ID\" INTEGER,\n \"Rank\" INTEGER,\n \"Company\" VARCHA... |
[
{
"content": "\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\" DATE,\n \"Production_code\" VARCHAR(255),\n PRIMARY KEY (\"Film_ID\")\n)... |
[
{
"content": "How can I read and combine data from 'team_stats_2021.csv' and 'team_stats_2022.csv' CSV files?\nSCHEMA: CREATE TABLE university (\n School_ID INTEGER,\n School VARCHAR(255),\n Location VARCHAR(255),\n Founded REAL,\n Affiliation VARCHAR(255),\n Enrollmen... |
[
{
"content": "What is the day value when extracting the parts of the infinite timestamp?\nSCHEMA: CREATE TABLE IF NOT EXISTS \"mountain\" (\n \"id\" INTEGER,\n \"name\" VARCHAR(255),\n \"Height\" DOUBLE,\n \"Prominence\" DOUBLE,\n \"Range\" VARCHAR(255),\n \"Country\" VARCHAR(255),\n \"Clim... |
[
{
"content": "How can I cast a string to an `INET` type with the value '192.168.0.1'?\nSCHEMA: CREATE TABLE candidate (\n Candidate_ID INTEGER,\n People_ID INTEGER,\n Poll_Source VARCHAR(255),\n Date DATE,\n Support_rate FLOAT,\n Consider_rate FLOAT,\n Oppose_rate FLOAT,\n Unsure_rate FL... |
[
{
"content": "List all unique indexes in the database.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT * FROM duckdb_indexes WHERE is_unique = true;",
"role": "assistant"
}
] |
[
{
"content": "Write a SQL query to delete the `user` table if it exists, without throwing an error.\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... |
[
{
"content": "Generate a CSV file 'employeeover30.csv' containing employees older than 30 years.\nSCHEMA: CREATE TABLE \"employee\" (\n \"Employee_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Age\" INTEGER,\n \"City\" VARCHAR(255),\n \"Contact_Details\" STRUCT(\n \"Phone\" VARCHAR(255),\n ... |
[
{
"content": "What SQL query would retrieve the 'People_ID' and the birth year in ISO date format (YYYY) from the 'people' table using the 'strftime' function?\nSCHEMA: CREATE TABLE candidate (\n Candidate_ID INTEGER,\n People_ID INTEGER,\n Poll_Source VARCHAR(255),\n Date DATE,\n Support_rate FL... |
[
{
"content": "Force a checkpoint on the database, even if no changes have been made.\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": "Create a FTS index for the evaluation table using the 'PerformanceRating.Review' column with the English Porter stemmer, converting all text to uppercase, and ignoring all non-alphabetic characters.\nSCHEMA: CREATE TABLE \"employee\" (\n \"Employee_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n ... |
[
{
"content": "How many DECIMAL columns are there in each table in the 'main' schema, and which tables have more than one DECIMAL column?\nSCHEMA: CREATE TABLE Addresses (\n Address_ID INTEGER NOT NULL,\n address_details VARCHAR(255),\n address_coordinates DOUBLE[],\n PRIMARY KEY (Address_ID),\n U... |
[
{
"content": "Create a sequence for generating performance IDs, starting from 1000 and incrementing by 1.\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... |
[
{
"content": "Return the device IDs along with the day of the month (zero-padded decimal) for all shops' open date.\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 ... |
[
{
"content": "How can I query for all captains with a class of 'Captain', age greater than 50, and having the key-value pair 'experience': 'veteran' in the JSON column 'additional_info', using partitioning to optimize the query?\nSCHEMA: CREATE TABLE \"captain\" (\n \"Captain_ID\" INTEGER,\n \"Name\" VARC... |
[
{
"content": "How can you create a JSON file named 'partial_data.json' containing only `column_1` and `column_2` for non-NULL rows in the `my_table` table?\nSCHEMA: ",
"role": "user"
},
{
"content": "COPY (SELECT column_1, column_2 FROM my_table WHERE column_3 IS NOT NULL) TO 'partial_data.json';",
... |
[
{
"content": "Find all students whose personal name starts with the letter 'A'.\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": "Write the players table to a remote Parquet file.\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 \tVARCHAR... |
[
{
"content": "List the problem status codes that are either 'OPEN' or 'IN_PROGRESS'.\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_lo... |
[
{
"content": "Create an interval of 2 months.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT INTERVAL 2 MONTH;",
"role": "assistant"
}
] |
[
{
"content": "Add an interval of 1 year multiplied by the 'Age' column (converted from integer type to date type) to the date '2022-01-01'.\nSCHEMA: CREATE TABLE \"employee\" (\n \"Employee_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Age\" INTEGER,\n \"City\" VARCHAR(255),\n \"Contact_Details\" ST... |
[
{
"content": "Retrieve all columns that start with 'id' or 'number' from the 'numbers' table.\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 ... |
[
{
"content": "Create a Parquet file in a GCS bucket containing the Entrepreneur_ID, Company, and Investor columns for investments made by 'Google'.\nSCHEMA: CREATE TABLE \"entrepreneur\" (\n \"Entrepreneur_ID\" INTEGER,\n \"People_ID\" INTEGER,\n \"Company\" VARCHAR(255),\n \"Money_Requested\" FLOAT... |
[
{
"content": "Fetch all columns from the `pilot` table and display the query plan.\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": "How can I read and combine two Parquet files, 'phonedata1.parquet' and 'phonedata2.parquet', assuming they have the same schema?\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT * FROM read_parquet(['phone_data1.parquet', 'phone_data2.parquet']);",
"role": "assistant"
}
] |
[
{
"content": "Set the S3 Uploader max filesize to 256GB, copy a subset of the Customers table to an S3 bucket using the specified max file size, and then reset the configuration option to its default value.\nSCHEMA: ",
"role": "user"
},
{
"content": "SET s3_uploader_max_filesize='256GB';\nCOPY (SELE... |
[
{
"content": "Insert a BLOB value with three bytes (170, 171, 172) into the 'addresscontent' column of the '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_count... |
[
{
"content": "How would you create a map with two key-value pairs using the MAP data type?\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT MAP(1, 'apple', 2, 'banana');",
"role": "assistant"
}
] |
[
{
"content": "Find the number of neighborhoods for cities in the South region by subtracting 1 from the array length.\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(... |
[
{
"content": "Create a sequence named `status_id_seq` that starts at 1, has a maximum value of 100, and will cycle back to the minimum value after reaching the maximum value.\nSCHEMA: CREATE TABLE station (\n id INTEGER PRIMARY KEY,\n name TEXT,\n location STRUCT(lat NUMERIC, long NUMERIC),\n dock_c... |
[
{
"content": "Calculate the time difference between two specific timestamps.\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);\n\nCREATE TABLE \"csu_fees\" ( \n \"Ca... |
[
{
"content": "What is the metadata of the non-existent Iceberg table 'data/iceberg/non_existent_table'? (This query should return an empty result.)\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT * FROM iceberg_metadata('data/iceberg/non_existent_table', ALLOW_MOVED_PATHS=true);",
"role": "as... |
[
{
"content": "Find the lowest account balance for each customer.\nSCHEMA: CREATE TABLE bank (\n branch_ID INTEGER PRIMARY KEY,\n bname VARCHAR(20),\n no_of_customers INTEGER,\n city VARCHAR(10),\n state VARCHAR(20),\n contact_info STRUCT(address VARCHAR, phone VARCHAR)\n);\n\nCREATE TABLE cus... |
[
{
"content": "Increase the memory limit to 5GB for the DuckDB instance.\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\" VARCHAR(... |
[
{
"content": "Which entrepreneurs, with the IDs 1, 2, and 3, have started companies, and what information is available about them?\nSCHEMA: CREATE TABLE \"entrepreneur\" (\n \"Entrepreneur_ID\" INTEGER,\n \"People_ID\" INTEGER,\n \"Company\" VARCHAR(255),\n \"Money_Requested\" FLOAT,\n \"Investor... |
[
{
"content": "Convert the `Template_Type_Code` and `Template_Type_Description` columns from the `Ref_Template_Types` table to an Excel file.\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... |
[
{
"content": "How would you create a full-text search index for bookings based on their status codes and returned damaged flags?\nSCHEMA: ",
"role": "user"
},
{
"content": "PRAGMA create_fts_index('Bookings', 'booking_id', 'booking_status_code', 'returned_damaged_yn');",
"role": "assistant"
}
... |
[
{
"content": "Can you create a FTS index for the `people` table using both the `Name` and `Biography` fields from the JSON `Additional_Info` column with the English 'porter' stemmer?\nSCHEMA: CREATE TABLE candidate (\n Candidate_ID INTEGER,\n People_ID INTEGER,\n Poll_Source VARCHAR(255),\n Date DAT... |
[
{
"content": "List all base tables in the database.\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 \"City_Info\" JSON,\n PRIMARY KEY... |
[
{
"content": "What SQL query should be used to get the title and the last five characters of the titles of all movies released after 2010?\nSCHEMA: CREATE TABLE \"actor\" (\n \"aid\" int,\n \"gender\" text,\n \"name\" text,\n \"nationality\" text,\n \"birth_city\" text,\n \"birth_year\" int,\... |
[
{
"content": "Count the number of staff members with a NULL gender or those who are female and named Jane.\nSCHEMA: CREATE TABLE \"Staff\" (\n\"staff_id\" INTEGER PRIMARY KEY,\n\"gender\" VARCHAR(1),\n\"first_name\" VARCHAR(80),\n\"last_name\" VARCHAR(80),\n\"email_address\" VARCHAR(255),\n\"phone_number\" VAR... |
[
{
"content": "How are the flights organized based on the airport_id in ascending order and then by company_id in descending order?\nSCHEMA: CREATE TABLE \"airport\" (\n \"id\" INTEGER,\n \"City\" VARCHAR(255),\n \"Country\" VARCHAR(255),\n \"IATA\" VARCHAR(255),\n \"ICAO\" VARCHAR(255),\n \"na... |
[
{
"content": "Insert a new city with specified `City_ID`, `Name`, `County_ID`, and `Location`.\nSCHEMA: CREATE TABLE \"county_public_safety\" (\n \"County_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Population\" INTEGER,\n \"Police_officers\" INTEGER,\n \"Residents_per_officer\" INTEGER,\n \"Ca... |
[
{
"content": "Set the ordering for NULLs to be 'NULLS FIRST'.\nSCHEMA: CREATE TABLE \"stadium\" (\n \"id\" INTEGER,\n \"name\" VARCHAR(255),\n \"Home_Games\" INTEGER,\n \"Average_Attendance\" REAL,\n \"Total_Attendance\" REAL,\n \"Capacity_Percentage\" REAL,\n \"Stadium_Info\" STRUCT(\n ... |
[
{
"content": "What is the minimum and maximum number of bytes in the names of all regions?\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 \"... |
[
{
"content": "Create a bitstring with bits set for each distinct year of working in the 'employment' table.\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 PRI... |
[
{
"content": "Create an index `idx_entrepreneur_investor` on the `Investor` column of the `entrepreneur` table to speed up queries that filter or sort by the `Investor` column.\nSCHEMA: CREATE TABLE \"entrepreneur\" (\n \"Entrepreneur_ID\" INTEGER,\n \"People_ID\" INTEGER,\n \"Company\" VARCHAR(255),\n... |
[
{
"content": "Get the unique and non-unique `Template_Type_Code` values from both `Ref_Template_Types` and `Templates` tables.\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... |
[
{
"content": "Instruction: \"List the teachers aged between 30 and 40, their hometowns, the courses they teach, and their class details.\"\nSCHEMA: CREATE TABLE \"course_arrange\" (\n\"Course_ID\" INTEGER,\n\"Teacher_ID\" INTEGER,\n\"Grade\" INTEGER,\n\"Class_Details\" VARCHAR(255),\nPRIMARY KEY (\"Course_ID\"... |
[
{
"content": "Load two Parquet files from the `battle_files` directory, interpreting the path as a [hive partitioned path](../partitioning/hive_partitioning).\nSCHEMA: CREATE TABLE ship (\n lost_in_battle INTEGER,\n id INTEGER\n );",
"role": "user"
},
{
"content": "SELECT * FROM re... |
[
{
"content": "Create a table `orchestra_data` from the `orchestra.csv` file using the `read_csv_auto` function with the `HEADER` parameter set to `true`.\nSCHEMA: CREATE TABLE \"conductor\" (\n \"Conductor_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Age\" INTEGER,\n \"Nationality\" VARCHAR(255),\n ... |
[
{
"content": "What SQL query should be used to export the result of a query that orders records by `column_2` in descending order to a JSON file named 'sorteddata.json'?\nSCHEMA: ",
"role": "user"
},
{
"content": "COPY (SELECT * FROM my_table ORDER BY column_2 DESC) TO 'sorted_data.json';",
"rol... |
[
{
"content": "How many constraints of each type are associated with the 'school' table?\nSCHEMA: CREATE TABLE \"driver\" (\n \"Driver_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Party\" VARCHAR(255),\n \"Home_city\" VARCHAR(255),\n \"Age\" INTEGER,\n \"Additional_Info\" JSON,\n PRIMARY KEY (... |
[
{
"content": "Set the number of threads to 1 and retrieve all columns from the `election` table where `Place` is less than 5, ordered by `Votes` in descending order.\nSCHEMA: CREATE TABLE \"election\" (\n \"Election_ID\" INTEGER,\n \"Representative_ID\" INTEGER,\n \"Date\" DATE,\n \"Votes\" DOUBLE,\... |
[
{
"content": "Create a table with an `inet` column and insert a row containing an IPv4 network address using CIDR notation.\nSCHEMA: CREATE TABLE \"Breeds\" (\n\"breed_code\" VARCHAR(10) PRIMARY KEY ,\n\"breed_name\" VARCHAR(80),\n\"additional_info\" JSON\n);\n\nCREATE TABLE \"Charges\" (\n\"charge_id\" INTEGER... |
[
{
"content": "How many campuses are located in the county 'Los Angeles'?\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);\n\nCREATE TABLE \"csu_fees\" ( \n \"Campus... |
[
{
"content": "Create a query that demonstrates the usage of the `nullif` function by returning null if the two input values are equal.\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_D... |
[
{
"content": "Load the httpfs extension, set up the credentials and GCS endpoint to read private data from a Google Cloud Storage bucket and filter the results based on Ranking.\nSCHEMA: CREATE TABLE \"phone\" (\n \"Name\" VARCHAR(255),\n \"Phone_ID\" INTEGER,\n \"Memory_in_G\" INTEGER,\n \"Carrier\... |
[
{
"content": "Read the first 10,000 rows of a CSV file using auto-detection.\nSCHEMA: CREATE TABLE \"Staff\" (\n\"staff_id\" INTEGER PRIMARY KEY,\n\"gender\" VARCHAR(1),\n\"first_name\" VARCHAR(80),\n\"last_name\" VARCHAR(80),\n\"email_address\" VARCHAR(255),\n\"phone_number\" VARCHAR(80),\n\"contact_history\"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.