instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserId AND Posts.CommunityOwnedDate IS NULL GROUP BY TagName ORDER BY UpVotes DESC ...
sede
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE ship ( TYPE VARCHAR, Nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the type and nationality of ships?
SELECT TYPE, Nationality FROM ship
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE R...
SELECT (YEAR(LastAccessDate) + (CAST(MONTH(LastAccessDate) AS FLOAT) / 12)) AS GraphPoint, COUNT(*) AS NumUsers FROM Users WHERE (YEAR(LastAccessDate) != YEAR(CURRENT_TIMESTAMP()) OR MONTH(LastAccessDate) != MONTH(CURRENT_TIMESTAMP())) GROUP BY YEAR(LastAccessDate), MONTH(LastAccessDate) ORDER BY YEAR(LastAccessDate), ...
sede
CREATE TABLE table_48902 ( "State" text, "Preliminary" real, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest preliminary when swimsuit is less than 8.822, inte...
SELECT MIN("Preliminary") FROM table_48902 WHERE "Swimsuit" < '8.822' AND "Interview" > '8.744' AND "Evening Gown" > '9.333'
wikisql
CREATE TABLE table_36920 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Third has a Second of agnieszka ogrodniczek?
SELECT "Third" FROM table_36920 WHERE "Second" = 'agnieszka ogrodniczek'
wikisql
CREATE TABLE table_28349 ( "Road race" text, "Distance" text, "Location" text, "Country" text, "Month held" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times a year is the Paris 20k road race held?
SELECT COUNT("Month held") FROM table_28349 WHERE "Road race" = 'Paris 20K'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "RDW"
mimicsql_data
CREATE TABLE table_19439 ( "Season" text, "Coach" text, "Overall" text, "Conference" text, "Standing" text, "Postseason" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Ram's conference record when they were the CBI champions?
SELECT "Conference" FROM table_19439 WHERE "Postseason" = 'CBI Champions'
wikisql
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, investo...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100 ORDER BY date_of_transaction DESC
nvbench
CREATE TABLE table_name_35 ( record VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record after the fight that lasted 8:17?
SELECT record FROM table_name_35 WHERE time = "8:17"
sql_create_context
CREATE TABLE table_204_238 ( id number, "#" number, "title" text, "producer(s)" text, "performer (s)" text, "time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is total number of title ?
SELECT COUNT("title") FROM table_204_238
squall
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth)
nvbench
CREATE TABLE table_261895_1 ( type VARCHAR, nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many categories fall under the category of britons?
SELECT COUNT(type) FROM table_261895_1 WHERE nickname = "Britons"
sql_create_context
CREATE TABLE table_name_21 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2002 tournament has 2008 career statistics?
SELECT 2002 FROM table_name_21 WHERE 2008 = "career statistics"
sql_create_context
CREATE TABLE table_66628 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of gold with less than 1 silver, from Belgium?
SELECT COUNT("Gold") FROM table_66628 WHERE "Silver" < '1' AND "Nation" = 'belgium'
wikisql
CREATE TABLE table_28589 ( "Engine Family" text, "Cylinder Layout" text, "Displacement(s)" text, "Injection type" text, "Years produced" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The cylinder layout v8 is produced in what years?
SELECT "Years produced" FROM table_28589 WHERE "Cylinder Layout" = 'V8'
wikisql
CREATE TABLE table_name_67 ( player VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player is from Fiji?
SELECT player FROM table_name_67 WHERE country = "fiji"
sql_create_context
CREATE TABLE table_1818471_1 ( species VARCHAR, afinsa VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every species when Afinsa is 639?
SELECT species FROM table_1818471_1 WHERE afinsa = 639
sql_create_context
CREATE TABLE table_name_1 ( attendance VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Game 2 has how much attendance?
SELECT attendance FROM table_name_1 WHERE game = 2
sql_create_context
CREATE TABLE Ref_Service_Types ( Service_Type_Code CHAR(15), Parent_Service_Type_Code CHAR(15), Service_Type_Description VARCHAR(255) ) CREATE TABLE Bookings_Services ( Order_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Stores ( Store_ID VARCHAR(100), Address_ID INTEGER, Marketing_Reg...
SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name ORDER BY COUNT(Store_Name) DESC
nvbench
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperda...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'samia razaq' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_203_568 ( id number, "town/village" text, "population" number, "postal code" text, "municipality" text, "island" text, "location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- f mjin and fro ba are located on which island...
SELECT "island" FROM table_203_568 WHERE "town/village" = 'famjin'
squall
CREATE TABLE table_name_16 ( points INTEGER, driver VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were S bastien Bourdais' lowest points when there were less than 63 laps?
SELECT MIN(points) FROM table_name_16 WHERE driver = "sébastien bourdais" AND laps < 63
sql_create_context
CREATE TABLE table_23484 ( "Year" text, "Horsepower" text, "Torque" text, "Fuel System" text, "Compression Ratio" text, "RPO" text, "Applications" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most applications for 1986
SELECT MAX("Applications") FROM table_23484 WHERE "Year" = '1986'
wikisql
CREATE TABLE table_24574438_1 ( gn_divisions VARCHAR, ds_division VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of gn divisions for mannar
SELECT COUNT(gn_divisions) FROM table_24574438_1 WHERE ds_division = "Mannar"
sql_create_context
CREATE TABLE table_26041144_16 ( period VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the period if the player is Hashan Tillakaratne?
SELECT period FROM table_26041144_16 WHERE player = "Hashan Tillakaratne"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-75223') AND NOT patient.unitdischargetime IS ...
eicu
CREATE TABLE table_72238 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "Team" FROM table_72238 WHERE "Location Attendance" = 'Philips Arena 18,227'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.icd9_code = "3799"
mimicsql_data
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, ...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '63411800' AND t_kc22.STA_DATE BETWEEN '2002-11-23' AND '2008-08-03' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_name_68 ( model VARCHAR, year VARCHAR, fuel_or_propulsion VARCHAR, manufacturer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the model with fuel or propulsion of diesel and orion manufacturer in 2005
SELECT model FROM table_name_68 WHERE fuel_or_propulsion = "diesel" AND manufacturer = "orion" AND year = 2005
sql_create_context
CREATE TABLE table_51663 ( "Tournament" text, "Wins" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament has the highest number of cuts while also having 4 top 25 appeara...
SELECT MAX("Cuts made") FROM table_51663 WHERE "Top-25" = '4'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Small-to-small intestinal anastomosis"
mimicsql_data
CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE club ( Club_ID int, name te...
SELECT T1.name, COUNT(T1.name) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID GROUP BY T1.name ORDER BY COUNT(T1.name) DESC
nvbench
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, ...
SELECT Id AS "post_link", Body, Score FROM Posts WHERE LENGTH(Title) < 20 AND ParentId IS NULL
sede
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
SELECT zyjybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '08644482' AND zyjybgb.BGRQ BETWEEN '2006-10-22' AND '2014-07...
css
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '63517576' AND t_kc22.STA_DATE BETWEEN '2000-01-29' AND '2018-01-05' AND t_kc22.SELF_PAY_PRO < 0.39
css
CREATE TABLE table_2899987_2 ( network VARCHAR, origin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which of the networks originate in Xalapa?
SELECT network FROM table_2899987_2 WHERE origin = "Xalapa"
sql_create_context
CREATE TABLE table_name_90 ( date VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Game of game 3?
SELECT date FROM table_name_90 WHERE game = "game 3"
sql_create_context
CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), pro...
SELECT customer_first_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id
nvbench
CREATE TABLE table_name_54 ( gold INTEGER, silver INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest number of golds for teams with 0 silver?
SELECT MIN(gold) FROM table_name_54 WHERE silver < 0
sql_create_context
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '69070860143' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '69070860143'
css
CREATE TABLE table_70661 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average roll for Fairfield school?
SELECT AVG("Roll") FROM table_70661 WHERE "Name" = 'fairfield school'
wikisql
CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DATE ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amo...
SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code
nvbench
CREATE TABLE table_49558 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Jay Haas place?
SELECT "Place" FROM table_49558 WHERE "Player" = 'jay haas'
wikisql
CREATE TABLE table_67416 ( "Year" text, "Championship" text, "54 holes" text, "Winning score" text, "Margin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the winning score in the PGA Championship?
SELECT "Winning score" FROM table_67416 WHERE "Championship" = 'pga championship'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '85618311' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2746.51)
css
CREATE TABLE table_66055 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Mascot has an Enrollment of 640?
SELECT "Mascot" FROM table_66055 WHERE "Enrollment" = '640'
wikisql
CREATE TABLE table_20159025_1 ( driver VARCHAR, part_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the driver when the time in part 3 was 1:31.386?
SELECT driver FROM table_20159025_1 WHERE part_1 = "1:31.386"
sql_create_context
CREATE TABLE table_name_27 ( starting_point VARCHAR, terminus VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the starting point of the route that has its terminus at Ecat/Rosa Park Transit Center?
SELECT starting_point FROM table_name_27 WHERE terminus = "ecat/rosa park transit center"
sql_create_context
CREATE TABLE table_25595 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text, "18-49 Rating/Share" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 18-49 r...
SELECT "18-49 Rating/Share" FROM table_25595 WHERE "Title" = 'Pilot'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT COUNT(*) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '72776229' AND txmzjzjlb.JZKSRQ BETWEEN '2002-03-03' AND '2006-02-09' AND txmzjzjlb.YLJGDM = '7840461' UNION SELECT COUNT(*) FROM hz_info JOIN ftxmzjzjlb ON...
css
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Revenue)
nvbench
CREATE TABLE table_name_88 ( team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 1st leg for Team 2 Concepto Egile?
SELECT 1 AS st_leg FROM table_name_88 WHERE team_2 = "concepto egile"
sql_create_context
CREATE TABLE table_2840500_3 ( player VARCHAR, nhl_team VARCHAR, position VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the person that plays left wing and is from canada that plays on the st. louis blues
SELECT player FROM table_2840500_3 WHERE position = "Left Wing" AND nationality = "Canada" AND nhl_team = "St. Louis Blues"
sql_create_context
CREATE TABLE table_72468 ( "Name" text, "First operational" text, "Numeral system" text, "Computing mechanism" text, "Programming" text, "Turing complete" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the turing complete with name being ...
SELECT "Turing complete" FROM table_72468 WHERE "Name" = 'Atanasoff–Berry Computer (US)'
wikisql
CREATE TABLE table_55851 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Laps for andrea de cesaris?
SELECT AVG("Laps") FROM table_55851 WHERE "Driver" = 'andrea de cesaris'
wikisql
CREATE TABLE table_name_79 ( segment_c VARCHAR, episode VARCHAR, segment_a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Segment C that has an Episode lower than 230, and a Segment A consisting of wax figures?
SELECT segment_c FROM table_name_79 WHERE episode < 230 AND segment_a = "wax figures"
sql_create_context
CREATE TABLE table_name_72 ( manager_1 VARCHAR, shirt_sponsor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the manager with the Hewlett-Packard shirt sponsor?
SELECT manager_1 FROM table_name_72 WHERE shirt_sponsor = "hewlett-packard"
sql_create_context
CREATE TABLE table_51703 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who constructed pedro diniz's car?
SELECT "Constructor" FROM table_51703 WHERE "Driver" = 'pedro diniz'
wikisql
CREATE TABLE table_name_65 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score on 1 August 2008?
SELECT score FROM table_name_65 WHERE date = "1 august 2008"
sql_create_context
CREATE TABLE table_23967 ( "Round" real, "Choice" real, "Player" text, "Position" text, "Height" text, "Weight" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much does the player from Southern California weight?
SELECT "Weight" FROM table_23967 WHERE "College" = 'Southern California'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID
nvbench
CREATE TABLE table_14769 ( "Gersdorf" text, "Gershausen" text, "Heddersdorf" text, "Kemmerode" text, "Kirchheim" text, "Reckerode ****" text, "Reimboldsh." text, "Rotterterode" text, "Willingshain" text ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT "Willingshain" FROM table_14769 WHERE "Kirchheim" = '1,126'
wikisql
CREATE TABLE table_name_41 ( result VARCHAR, week VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game after week 6 against the cleveland browns?
SELECT result FROM table_name_41 WHERE week < 6 AND opponent = "cleveland browns"
sql_create_context
CREATE TABLE table_19432 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Class AA winner when Plains was Class A winner and Lubb...
SELECT "Class AA" FROM table_19432 WHERE "Class A" = 'Plains' AND "Class AAAAA" = 'Lubbock'
wikisql
CREATE TABLE player ( player_id number, player text, years_played text, total_wl text, singles_wl text, doubles_wl text, team number ) CREATE TABLE team ( team_id number, name text ) CREATE TABLE country ( country_id number, country_name text, capital text, official...
SELECT player FROM match_season WHERE college = "UCLA"
spider
CREATE TABLE table_name_44 ( japanese_title VARCHAR, disc VARCHAR, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Japanese title has a Disc smaller than 12, and an Artist of k z murashita?
SELECT japanese_title FROM table_name_44 WHERE disc < 12 AND artist = "kōzō murashita"
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description...
SELECT b.Name AS tag, COUNT(*) AS holders FROM Badges AS b, Users AS u WHERE b.Class = 1 AND b.TagBased = 1 AND u.Id = b.UserId GROUP BY b.Name ORDER BY holders DESC
sede
CREATE TABLE student ( city_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the code of city where most of students are living in.
SELECT city_code FROM student GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_48 ( commercial_operation VARCHAR, gross_capacity VARCHAR, electricity_grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Commercial Operation has both a Gross Capacity of 417 mw and an Electricity Grid 27.12.1971?
SELECT commercial_operation FROM table_name_48 WHERE gross_capacity = "417 mw" AND electricity_grid = "27.12.1971"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '04680290185'
css
CREATE TABLE table_name_18 ( second VARCHAR, third VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the second when Mikkel Krause is the third?
SELECT second FROM table_name_18 WHERE third = "mikkel krause"
sql_create_context
CREATE TABLE table_name_79 ( birth VARCHAR, became_queen VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the person who became queen on 15 April 1820 born?
SELECT birth FROM table_name_79 WHERE became_queen = "15 april 1820"
sql_create_context
CREATE TABLE table_38802 ( "Season" text, "Races" real, "Podiums" real, "Pole" real, "FLap" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the sum of Podiums that has the Season of 2006, and the Races larger than 16?
SELECT SUM("Podiums") FROM table_38802 WHERE "Season" = '2006' AND "Races" > '16'
wikisql
CREATE TABLE table_train_144 ( "id" int, "retinal_dystrophy" bool, "mini_mental_state_examination_mmse" int, "memory_box" float, "body_weight" float, "neutrophil_count" int, "moca_score" int, "severe_dementia" bool, "dementia" bool, "macular_degeneration" bool, "diabetic_reti...
SELECT * FROM table_train_144 WHERE neutrophil_count = 1200 OR platelet_cell_count < 120000
criteria2sql
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6314589' AND gwyjzb.MED_ORG_DEPT_NM = '小儿肛肠外科' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6314589' AND fgwyjzb.MED_ORG_DEPT_NM = '小儿肛肠外科') A...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.short_title = "Infusion of vasopressor"
mimicsql_data
CREATE TABLE table_29518 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the season ab...
SELECT "No. in season" FROM table_29518 WHERE "Directed by" = 'Brad Tanenbaum' AND "No. in series" > '241.0'
wikisql
CREATE TABLE table_24503 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Why did Robert L. Bacon (r) vacate?
SELECT "Reason for change" FROM table_24503 WHERE "Vacator" = 'Robert L. Bacon (R)'
wikisql
CREATE TABLE table_79928 ( "Election" text, "Votes" real, "Vote %" real, "Seats" real, "Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the vote % for seats of 9
SELECT "Vote %" FROM table_79928 WHERE "Seats" = '9'
wikisql
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, date_day, days, flight WHERE (((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > fli...
atis
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '93103311' AND jybgb.BGRQ BETWEEN '2015-06-29' AND '2017-12-17' UNI...
css
CREATE TABLE table_24486462_1 ( disposable_usd_growth VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the rank is 26, what is the disposable USD growth?
SELECT disposable_usd_growth FROM table_24486462_1 WHERE rank = 26
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, ha...
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12927)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, ...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8244) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-12' ORDER BY labevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE table_43813 ( "Club" text, "League goals" text, "FA Cup goals" text, "League Cup goals" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Club has a League Cup goals of 0, and a FA Cup goals of 1, and a Total larger tha...
SELECT "Club" FROM table_43813 WHERE "League Cup goals" = '0' AND "FA Cup goals" = '1' AND "Total" > '11' AND "League goals" = '13'
wikisql
CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255)...
SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details
nvbench
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dis...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sodium phosphate' A...
mimic_iii
CREATE TABLE Catalog_Structure ( catalog_level_number INTEGER, catalog_id INTEGER, catalog_level_name VARCHAR(50) ) CREATE TABLE Attribute_Definitions ( attribute_id INTEGER, attribute_name VARCHAR(30), attribute_data_type VARCHAR(10) ) CREATE TABLE Catalog_Contents_Additional_Attributes ( ...
SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 ORDER BY catalog_level_number
nvbench
CREATE TABLE table_51288 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver has a grid of 3?
SELECT "Driver" FROM table_51288 WHERE "Grid" = '3'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number...
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-54801') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '4998470' AND txmzjzjlb.JZKSRQ BETWEEN '2010-09-19' AND '2020-11-18' AND txmzjzjlb.WDBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '4998470' AND ftxmzjzjlb.JZKSRQ BETWEEN '2010-09-19' AND '2020-11-18' AND ftxmzjzjlb.WDBZ > 0
css
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, J...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE table_name_97 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record with a Date with december 9?
SELECT record FROM table_name_97 WHERE date = "december 9"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE MED_SER_ORG_NO = '9055373' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')
css
CREATE TABLE table_75165 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time did team kawasaki zx10 1000cc have?
SELECT "Time" FROM table_75165 WHERE "Team" = 'kawasaki zx10 1000cc'
wikisql
CREATE TABLE table_204_521 ( id number, "rank" number, "name" text, "nationality" text, "time (hand)" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which competitor finished immediately after karl hahnel ?
SELECT "name" FROM table_204_521 WHERE "rank" = (SELECT "rank" FROM table_204_521 WHERE "name" = 'karl hahnel') + 1
squall
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQ...
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '5621712' AND wdmzjzjlb.RYDJSJ > '2005-05-30' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '5621712' AND bdmzjzjlb.RYDJSJ > '2005-05-30'
css