conversations listlengths 2 2 |
|---|
[
{
"content": "What are the column details for the 'mountain' table using the information_schema?\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 \"Cli... |
[
{
"content": "Read all Parquet files that match the glob pattern from 'folder1' and 'folder2'.\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 TABLE \"Ref_... |
[
{
"content": "Load JSON data from the file 'largejsondata.json' with a maximum object size of 1 GB.\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 \"Catego... |
[
{
"content": "How can I export the entire database to a target directory in Parquet format with Snappy compression?\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 ... |
[
{
"content": "Reset the `custom_extension_repository` setting to its default value.\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 ... |
[
{
"content": "Get the number of days between the Unix system day zero (epoch) and 20 September, 1992.\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... |
[
{
"content": "Export the 'event' table to a Parquet file with ZSTD compression.\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... |
[
{
"content": "Create a specific date value in DuckDB using the ISO 8601 format.\nSCHEMA: CREATE TABLE \"swimmer\" (\n \"ID\" INTEGER,\n \"name\" VARCHAR(255),\n \"Nationality\" VARCHAR(255),\n \"meter_100\" FLOAT,\n \"meter_200\" FLOAT,\n \"meter_300\" FLOAT,\n \"meter_400\" FLOAT,\n \"m... |
[
{
"content": "What are the names of pilots and the aircraft models they flew, including pilots who have not flown any aircraft and aircraft that have not been flown by any pilot?\nSCHEMA: CREATE TABLE \"aircraft\" (\n \"Aircraft_ID\" INTEGER,\n \"Order_Year\" INTEGER,\n \"Manufacturer\" VARCHAR(255),\n... |
[
{
"content": "Create a SQL query that concatenates the college name and state columns from the College table into a single column named 'collegeinfo'.\nSCHEMA: CREATE TABLE College \n ( cName \tVARCHAR(20) NOT NULL,\n state \tVARCHAR(2),\n enr \tINTEGER,\n cInfo \tJSON,\n PRIMARY KEY (cNa... |
[
{
"content": "Retrieve the third element of a list using the listextract function.\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\" INTE... |
[
{
"content": "Display the time that results from subtracting 3 hours from 05:00:00.\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 \"Ci... |
[
{
"content": "What is the size of the largest temporary 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\nCREATE TABLE Products... |
[
{
"content": "Show me the table schema, table name, column name, and data type for the 'Accounts', 'Customers', and 'Customers_Cards' tables.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT table_schema, table_name, column_name, data_type\nFROM information_schema.columns\nWHERE table_name IN ('Ac... |
[
{
"content": "Load a CSV file into a table called 'basketball_team'.\nSCHEMA: CREATE TABLE university (\n School_ID INTEGER,\n School VARCHAR(255),\n Location VARCHAR(255),\n Founded REAL,\n Affiliation VARCHAR(255),\n Enrollment REAL,\n Nickname VARCHAR(255),\n... |
[
{
"content": "Load the MySQL extension and attach a MySQL database. Query the data from a table in the MySQL database.\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)... |
[
{
"content": "Rank people by their height in descending order using Window Functions and Ordering by Height.\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 ... |
[
{
"content": "Which products have a price greater than $100.00?\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\nCREATE TABLE Produc... |
[
{
"content": "Create a table named `machine_quality` that contains the `Machine_ID` and a classification of the machine's quality based on the `quality_rank`.\nSCHEMA: CREATE TABLE \"repair\" (\n \"repair_ID\" INTEGER,\n \"name\" VARCHAR(255),\n \"Launch_Date\" DATE,\n \"Notes\" VARCHAR(255),\n \... |
[
{
"content": "Create a table `tbl` with a `GEOMETRY` column after loading the `spatial` extension.\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 \"Powertrai... |
[
{
"content": "Find all paths between a specific school (e.g. SchoolID = 1) and a driver (e.g. DriverID = 5) in the schoolbus table, where the path contains a specific value (e.g. 3).\nSCHEMA: CREATE TABLE \"driver\" (\n \"Driver_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Party\" VARCHAR(255),\n \"Ho... |
[
{
"content": "Which churches were opened in the year 2000, and what month were they opened?\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 (Peop... |
[
{
"content": "Generate two rows with city names and IDs as part of a FROM clause.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT * FROM (VALUES ('Paris', 1), ('Berlin', 2)) Locations(City, Id);",
"role": "assistant"
}
] |
[
{
"content": "Get the current date and time as a TIMESTAMPTZ value in the current timezone\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... |
[
{
"content": "Load data from a JSON file named `my_data.json` into specific columns (`column1` and `column2`) of an existing table called `my_table`.\nSCHEMA: ",
"role": "user"
},
{
"content": "COPY my_table (column1, column2) FROM 'my_data.json';",
"role": "assistant"
}
] |
[
{
"content": "Calculate the average number of phones in stock across all markets, excluding markets with an unknown number of phones in stock.\nSCHEMA: CREATE TABLE \"phone\" (\n \"Name\" VARCHAR(255),\n \"Phone_ID\" INTEGER,\n \"Memory_in_G\" INTEGER,\n \"Carrier\" VARCHAR(255),\n \"Price\" DOUB... |
[
{
"content": "Remove any trailing spaces and underscores from the `Service_Type_Code` column in the `Services` table.\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 Partici... |
[
{
"content": "Load the sakila.db SQLite database and make it accessible for querying.\nSCHEMA: ",
"role": "user"
},
{
"content": "ATTACH 'sakila.db' AS sakila (TYPE SQLITE);\nUSE sakila;",
"role": "assistant"
}
] |
[
{
"content": "Generate a query that unpivots the gymnast table, stacking all the event points into two columns: `event` and `points`.\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 Para... |
[
{
"content": "Read parquet files from an S3 bucket named `my-bucket` and return all columns and rows from the `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... |
[
{
"content": "Convert a timestamp in GMT to a timestamp in the given timezone using the date parts of the timestamp.\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),... |
[
{
"content": "How many students are there in each school, formatted in AM/PM format, in 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... |
[
{
"content": "Generate a hash value for the attendees of weddings that took place between 2000 and 2010.\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 PRIM... |
[
{
"content": "How would you drop the 'Age' column from the 'artist' table in SQL?\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 PRIMARY... |
[
{
"content": "Read all data from partitioned Parquet files in S3 bucket 'my-bucket/partitioned' and include the filename as a column.\nSCHEMA: CREATE TABLE \"buildings\" (\n \"id\" INTEGER,\n \"name\" VARCHAR(255),\n \"City\" VARCHAR(255),\n \"Height\" INTEGER,\n \"Stories\" INTEGER,\n \"Statu... |
[
{
"content": "Get the row IDs, staff IDs, and problem IDs for the first 5 problems assigned to a staff member.\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": "\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 (\"Entrepreneur_ID\"),\n FOREIGN KEY (\"People... |
[
{
"content": "Generate a bitstring for the `shop` table, with bits set for each distinct number of staff members, ranging from 1 to 10.\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 \... |
[
{
"content": "Create a CSV file containing information about flights that took place on January 1st, 2022, using a pipe as the delimiter, a caret as the escape character, and forcing the 'Vehicle_Flight_number' and 'Pilot' columns to be quoted.\nSCHEMA: CREATE TABLE \"airport\" (\n \"id\" INTEGER,\n \"Cit... |
[
{
"content": "Create a bitstring with a predefined length of 64, with the value '111111111111111111111111' left-padded with zeroes if necessary.\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT bitstring('111111111111111111111111', 64);",
"role": "assistant"
}
] |
[
{
"content": "Analyze and display the query plan with execution statistics for selecting all columns from the `Apartment_Buildings` table where `building_id` is less than 10.\nSCHEMA: CREATE TABLE Apartments (\n apt_id INTEGER NOT NULL ,\n building_id INTEGER NOT NULL,\n apt_type_code CHAR(15),\n a... |
[
{
"content": "Insert a single vehicle record into the Vehicles table.\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),\n\"country\" VARCHAR(50),\n\"loc... |
[
{
"content": "Replace with: \"Find the candidates whose PeopleID is less than 1 billion.\"\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_ra... |
[
{
"content": "What is the summary information (min, max, avg, std, approx_unique) for the Votes column in the player table, filtered by Gender being Female?\nSCHEMA: CREATE TABLE IF NOT EXISTS \"player\" (\n \"Player_ID\" INTEGER,\n \"Sponsor_name\" VARCHAR(255),\n \"Player_name\" VARCHAR(255),\n \... |
[
{
"content": "Export the contents of 'mytable' to a JSON file named 'output.json'.\nSCHEMA: ",
"role": "user"
},
{
"content": "COPY (SELECT * FROM my_table) TO 'output.json';",
"role": "assistant"
}
] |
[
{
"content": "How can you read parquet files from the 'properties' directory with a specific folder structure and let the system automatically infer if the provided files are in a hive partitioned hierarchy?\nSCHEMA: CREATE TABLE \"Ref_Feature_Types\" (\n\"feature_type_code\" VARCHAR(20) PRIMARY KEY,\n\"feature... |
[
{
"content": "Load JSON data from 'input.json' into table 'tbl' with specific format and additional options.\nSCHEMA: ",
"role": "user"
},
{
"content": "COPY tbl FROM 'input.json' (FORMAT 'json', STRIP_outer_array 'true', STRIP_null_values 'true');",
"role": "assistant"
}
] |
[
{
"content": "Count the number of rows with a non-null `log_entry_fix` column in a Parquet file stored in Google Cloud Storage using HMAC keys.\nSCHEMA: CREATE TABLE \"Problem_Category_Codes\" (\n\"problem_category_code\" VARCHAR(20) PRIMARY KEY,\n\"problem_category_description\" VARCHAR(80),\n\"additional_info... |
[
{
"content": "What will be the result of casting a double value 123.45 to an integer in DuckDB?\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(rati... |
[
{
"content": "Query data from the 'mytable' table in the 'mydb' PostgreSQL database using the postgres_scan function.\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)... |
[
{
"content": "Find all CHECK constraints that enforce a positive value in the current DuckDB instance.\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": "Generate a query that pivots the `mission` table based on `Ship_ID` and `Launched_Year`, and calculates the sum and average of `Speed_knots` for each combination.\nSCHEMA: CREATE TABLE mission (\n Mission_ID INTEGER,\n Ship_ID INTEGER,\n Code VARCHAR(255),\n Launched_Year INTEGER,\n ... |
[
{
"content": "How can I set the amount of threads for parallel query execution to 8?\nSCHEMA: CREATE TABLE \"election\" (\n \"Election_ID\" INTEGER,\n \"Representative_ID\" INTEGER,\n \"Date\" DATE,\n \"Votes\" DOUBLE,\n \"Vote_Percent\" DOUBLE,\n \"Seats\" DOUBLE,\n \"Place\" DOUBLE,\n ... |
[
{
"content": "Return the size of the map (or the number of entries in the map).\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT cardinality(map([4, 2], ['a', 'b']));",
"role": "assistant"
}
] |
[
{
"content": "Get the ID and birth year of all entrepreneurs from their JSON data in the format 'YYYY'.\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 \"Ent... |
[
{
"content": "Create a CSV file named 'type1documents.csv' containing the `document_name` and `document_structure_code` columns of the `Documents` table for documents with a `document_type_code` of 'TYPE1'. Use a semicolon as the delimiter, include a header line, and force quotes for the `document_name` column.... |
[
{
"content": "What are the unique values of the 'benefit' key in the `overpayment_details_map` column in the `Benefits_Overpayments` table?\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 INTE... |
[
{
"content": "Get the birth year of each person by truncating their birth date to the year.\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 FLO... |
[
{
"content": "Delete all rows from the people table where the date of birth is before 1990-01-01.\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 \"Entrepren... |
[
{
"content": "Create a table with a union column, insert two rows with union values, and select the string value of the union where the union has a string tag, and the integer value where the union has an integer tag.\nSCHEMA: CREATE TABLE \"program\" (\n \"Program_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n... |
[
{
"content": "Create a table `ontime` and load data from 'flights.csv' using automatic format detection.\nSCHEMA: ",
"role": "user"
},
{
"content": "COPY ontime FROM 'flights.csv' (AUTO_DETECT true);",
"role": "assistant"
}
] |
[
{
"content": "Create a table named `business_list_table` with two list columns: `business_ids` for storing a list of business IDs and `business_names` for storing a list of business names.\nSCHEMA: CREATE TABLE \"checkin\" (\n \"cid\" INTEGER,\n \"business_id\" VARCHAR(255) REFERENCES \"business\"(\"busi... |
[
{
"content": "Format the OpenDate column in the shop table as 'YYYY-MM-DD'.\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": "What is the SQL query for inserting multiple rows in degrees table using a transaction?\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 ... |
[
{
"content": "Set the extension directory to a new path, show the current value, reset the extension directory, and show the current value again.\nSCHEMA: CREATE TABLE \"captain\" (\n \"Captain_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Ship_ID\" INTEGER,\n \"age\" INTEGER,\n \"Class\" VARCHAR(25... |
[
{
"content": "Import the data from the CSV file 'newshops.csv' and insert it into the `shop` table.\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": "Get the course, teacher, room, and time details where there are NULL values in the room or time.\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\"),\... |
[
{
"content": "How do I write the results of a query on the 'phone' table (selecting only phones with more than 128GB memory) to a Parquet file named 'highmemoryphones.parquet'?\nSCHEMA: CREATE TABLE \"phone\" (\n \"Name\" VARCHAR(255),\n \"Phone_ID\" INTEGER,\n \"Memory_in_G\" INTEGER,\n \"Carrier\"... |
[
{
"content": "How would you sample 10% of the `GEOGRAPHIC` table using system sampling before the join with the `RESTAURANT` table?\nSCHEMA: CREATE TABLE \"GEOGRAPHIC\" (\n \"CITY_NAME\" VARCHAR(255) CONSTRAINT pk_geo PRIMARY KEY,\n \"COUNTY\" VARCHAR(255),\n \"REGION\" VARCHAR(255),\n \"NEIGHBORHO... |
[
{
"content": "Which ParticipantIDs have a 2-logarithm greater than 3? Return the ParticipantID and its 2-logarithm, sorted in descending order by the 2-logarithm.\nSCHEMA: CREATE TABLE Services (\n Service_ID INTEGER NOT NULL,\n Service_Type_Code CHAR(15) NOT NULL,\n Service_Details JSON,\n PRIMARY... |
[
{
"content": "What are the table names, column names, and their ordinal positions for all tables in the 'main' schema, ordered by table name and ordinal position?\nSCHEMA: CREATE TABLE ship (\n lost_in_battle INTEGER,\n id INTEGER\n );",
"role": "user"
},
{
"content": "SELECT table... |
[
{
"content": "Create a full-text search index for the `race` table, indexing the `Race_ID`, `Name`, `Class`, `Date`, and `Track_ID` columns using the English stemmer, no stopwords, and ignoring all non-alphabetic lowercase characters.\nSCHEMA: CREATE TABLE race (\n Race_ID INTEGER,\n Name VARCHAR... |
[
{
"content": "Find the name of the stadiums, the player, the injury, and the average attendance for each injury incident, using the stadium's average attendance instead of the capacity percentage.\nSCHEMA: CREATE TABLE \"stadium\" (\n \"id\" INTEGER,\n \"name\" VARCHAR(255),\n \"Home_Games\" INTEGER,\n... |
[
{
"content": "Calculate the average random value between 0 and 1 for each marketid in the phonemarket table.\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 P... |
[
{
"content": "How can you export the `artwork` table to a JSON file named 'artwork.json' containing a JSON array of records?\nSCHEMA: CREATE TABLE \"festival_detail\" (\n \"Festival_ID\" INTEGER,\n \"Festival_Name\" VARCHAR(255),\n \"Chair_Name\" VARCHAR(255),\n \"Location\" VARCHAR(255),\n \"Yea... |
[
{
"content": "What SQL query should be used to export a JSON file named 'artistswithA.json' containing an array of objects with ArtistID and Artist columns for all artists whose names contain the letter 'A', using the JSON format?\nSCHEMA: CREATE TABLE \"artist\" (\n \"Artist_ID\" INTEGER,\n \"Artist\" VA... |
[
{
"content": "Group classical performances by month and display the orchestra ID, performance date, and month bucket.\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 \"Co... |
[
{
"content": "Get the count of records for each distinct `did` in the `domain_publication` table, including cases where there are no records for a given `did`.\nSCHEMA: CREATE TABLE \"author\" (\n \"aid\" INTEGER,\n \"homepage\" VARCHAR(255),\n \"name\" VARCHAR(255),\n \"oid\" INTEGER,\n \"autho... |
[
{
"content": "Get the user name and role code of users from a Parquet file where the role code is either 'admin' or 'moderator'.\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 \"... |
[
{
"content": "Change the class of a race with RaceID 1 to 'Class 2' using the Appender to insert data into the `race` table and then update the table to change the class of the race.\nSCHEMA: CREATE TABLE race (\n Race_ID INTEGER,\n Name VARCHAR(255),\n Class VARCHAR(255),\n Date DA... |
[
{
"content": "Read data from a Parquet file located in an S3 bucket using Hive partitioning.\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 \"count... |
[
{
"content": "How do we create a full-text search index for the Invoices table using the 'invoicenumber' and 'invoicedetails' columns?\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\... |
[
{
"content": "What is the metadata of the `lineitem_iceberg` table, allowing moved paths?\nSCHEMA: CREATE TABLE \"musical\" (\n\"Musical_ID\" INTEGER,\n\"Name\" TEXT\n);",
"role": "user"
},
{
"content": "SELECT * FROM iceberg_metadata('data/iceberg/lineitem_iceberg', ALLOW_MOVED_PATHS=true);",
... |
[
{
"content": "How can I export the database to a target directory in Avro format?\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_hist... |
[
{
"content": "Which TV series have cast members that are also in the list ['John Doe', 'Jane Doe']?\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_aspec... |
[
{
"content": "List airports with more than 10 million passengers.\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 Aircraft_ID INTE... |
[
{
"content": "Which country has the highest common population (represented as bitwise AND) among all countries?\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(2... |
[
{
"content": "Change the data type of the `Customer_Details` column in the `Customers` table to `VARCHAR(100)`. Note that this operation might require rewriting the table, and it may take some time for larger tables.\nSCHEMA: CREATE TABLE Customers (\n Customer_ID INTEGER NOT NULL,\n Customer_Details VARC... |
[
{
"content": "Which aircraft are used at airports and have a name most similar to 'Boeing 747' according to the Jaro similarity metric?\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 PRIMA... |
[
{
"content": "What columns and data types are included in the 'song' parquet file?\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 \... |
[
{
"content": "Select 30% of the stationcompany table using tablesample with reservoir sampling.\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\" R... |
[
{
"content": "Create a table with a map column and insert a row with a map. Then, query for rows where the map contains a key with a value of NULL.\nSCHEMA: ",
"role": "user"
},
{
"content": "CREATE TABLE map_table (map_col MAP(INT, DOUBLE));\nINSERT INTO map_table VALUES (map {1: 42.001, 5: -32.1})... |
[
{
"content": "Select a sample of 10% of the rows from the College table using system sampling.\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 N... |
[
{
"content": "Add a new template for S3 uploader configuration with a specified 's3_uploader_max_parts_per_file' value.\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 (T... |
[
{
"content": "Generate a JSON representing the Substrait plan for a SELECT query on the `crossfit` table with all columns.\nSCHEMA: ",
"role": "user"
},
{
"content": "CALL get_substrait_json('SELECT * FROM crossfit');",
"role": "assistant"
}
] |
[
{
"content": "Write the Guests table to a hive partitioned data set of CSV files, partitioned by the gender code, and with unique filenames.\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_... |
[
{
"content": "Get all records from the `hiring` table where the `Employee_ID` is present in either the `employee` or `shop` table.\nSCHEMA: CREATE TABLE \"employee\" (\n \"Employee_ID\" INTEGER,\n \"Name\" VARCHAR(255),\n \"Age\" INTEGER,\n \"City\" VARCHAR(255),\n \"Contact_Details\" STRUCT(\n ... |
[
{
"content": "Get the values of a map\nSCHEMA: ",
"role": "user"
},
{
"content": "SELECT map_values(map([100, 5], [42, 43]));",
"role": "assistant"
}
] |
[
{
"content": "Order the culturecompany table by GroupEquityShareholding being NULL first, and then by Awards being NULL, both in descending order.\nSCHEMA: CREATE TABLE \"book_club\" (\n \"book_club_id\" INTEGER,\n \"Year\" INTEGER,\n \"Author_or_Editor\" VARCHAR(100),\n \"Book_Title\" VARCHAR(100),... |
[
{
"content": "What is the most recent date of revision for each catalog?\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\"cata... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.