instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_202_196 ( id number, "ethnicity" text, "1880" text, "1899" text, "1913" text, "19301" text, "1956" text, "1966" text, "1977" text, "1992" text, "2002" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which et...
SELECT "ethnicity" FROM table_202_196 ORDER BY "1992" DESC LIMIT 1
squall
CREATE TABLE table_62852 ( "Nat." text, "Name" text, "Moving from" text, "Type" text, "Transfer window" text, "Ends" real, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Type has a Nat of geo?
SELECT "Type" FROM table_62852 WHERE "Nat." = 'geo'
wikisql
CREATE TABLE table_23958917_1 ( stacks VARCHAR, unit_capacity__2009_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of stacks for 1 & 2 235 mw 3 & 4 88.2 mw
SELECT COUNT(stacks) FROM table_23958917_1 WHERE unit_capacity__2009_ = "1 & 2 235 MW 3 & 4 88.2 MW"
sql_create_context
CREATE TABLE ROLES ( role_description VARCHAR, role_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the description for role name 'Proof Reader'.
SELECT role_description FROM ROLES WHERE role_name = "Proof Reader"
sql_create_context
CREATE TABLE table_293465_1 ( production_in_2010__1 INTEGER, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When sweden is the country what is the highest production in 2010 (1,000 ton)?
SELECT MAX(production_in_2010__1), 000 AS _ton_ FROM table_293465_1 WHERE country = "Sweden"
sql_create_context
CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, P...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_56298 ( "Model" text, "Years" text, "Engine code" text, "Power" text, "Torque" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During which years was the Model 318td (diesel) with the Engine code of m47d20 manufactured?
SELECT "Years" FROM table_56298 WHERE "Engine code" = 'm47d20' AND "Model" = '318td (diesel)'
wikisql
CREATE TABLE table_41524 ( "Episode" real, "Title" text, "Story" text, "Adapted by" text, "Director" text, "Airdate" text, "Exists?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the title of the episode that martin worth wrote the...
SELECT "Title" FROM table_41524 WHERE "Story" = 'martin worth'
wikisql
CREATE TABLE product_categories ( production_type_code text, product_type_description text, vat_rating number ) CREATE TABLE financial_transactions ( transaction_id number, account_id number, invoice_number number, transaction_type text, transaction_date time, transaction_amount num...
SELECT transaction_type, SUM(transaction_amount) FROM financial_transactions GROUP BY transaction_type
spider
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Date_of_Birth, Weight FROM people
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047'...
eicu
CREATE TABLE table_650 ( "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. -- How many of the epis...
SELECT COUNT("No. in series") FROM table_650 WHERE "Title" = 'Guerillas in the Mist'
wikisql
CREATE TABLE table_18421 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What candidates were in the election when a republican was re-elected?
SELECT "Candidates" FROM table_18421 WHERE "Result" = 'Re-elected' AND "Party" = 'Republican'
wikisql
CREATE TABLE table_name_53 ( term_start VARCHAR, born_died VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Term Start, when Born-Died is Prime Ministers 1939 - 1943?
SELECT term_start FROM table_name_53 WHERE born_died = "prime ministers 1939 - 1943"
sql_create_context
CREATE TABLE table_13259034_2 ( game_site VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the teams play on October 16, 1977?
SELECT game_site FROM table_13259034_2 WHERE date = "October 16, 1977"
sql_create_context
CREATE TABLE table_31221 ( "Skip (Club)" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the L when the W is 4...
SELECT MIN("L") FROM table_31221 WHERE "W" = '4'
wikisql
CREATE TABLE table_41928 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Bills points" real, "Opponents" real, "Bills first downs" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Bills first downs ...
SELECT MIN("Bills first downs") FROM table_41928 WHERE "Date" = 'oct. 29' AND "Bills points" > '23'
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND prescriptions.drug = "Dextrose 50%"
mimicsql_data
CREATE TABLE table_17505751_5 ( league INTEGER, total VARCHAR, copa_del_rey VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when the total is 8 and copa del rey is 0 what is the minimum league
SELECT MIN(league) FROM table_17505751_5 WHERE total = 8 AND copa_del_rey = 0
sql_create_context
CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, s...
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY acc_bal
nvbench
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 COUNT(*) FROM zyjybgb WHERE zyjybgb.JZLSH = '97977330567' UNION SELECT COUNT(*) FROM mzjybgb WHERE mzjybgb.JZLSH = '97977330567'
css
CREATE TABLE table_10918 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the hometown of the player who went to lsu?
SELECT "Hometown" FROM table_10918 WHERE "College" = 'lsu'
wikisql
CREATE TABLE table_name_35 ( attendance INTEGER, date VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Attendance after Week 4 on October 10, 1971?
SELECT AVG(attendance) FROM table_name_35 WHERE date = "october 10, 1971" AND week > 4
sql_create_context
CREATE TABLE operate_company ( id int, name text, Type text, Principal_activities text, Incorporated_in text, Group_Equity_Shareholding real ) CREATE TABLE airport ( id int, City text, Country text, IATA text, ICAO text, name text ) CREATE TABLE flight ( id int, ...
SELECT T1.name, T1.id FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id
nvbench
CREATE TABLE table_29542 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the election for georgia's 3rd district?
SELECT "Result" FROM table_29542 WHERE "District" = 'Georgia''s 3rd'
wikisql
CREATE TABLE table_15162479_8 ( nominee VARCHAR, vote_to_evict VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many nominee's had a vote to evict percentage of 3.92%
SELECT COUNT(nominee) FROM table_15162479_8 WHERE vote_to_evict = "3.92%"
sql_create_context
CREATE TABLE table_29794 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code(s)" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "Written by" FROM table_29794 WHERE "Title" = 'The One on the Last Night'
wikisql
CREATE TABLE table_name_60 ( attendance VARCHAR, week VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the attendance for week larger than 10 and result of l 22-21
SELECT attendance FROM table_name_60 WHERE week > 10 AND result = "l 22-21"
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '谵妄' AND jyjgzbb.JCZBDM = '976...
css
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT (SELECT OVE_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '00023755669') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '00023755669')
css
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
CREATE TABLE movie ( movie_id int, Title text, Year int, Director text, Budget_million real, Gross_worldwide int ) CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text, movie_id text ) CREAT...
SELECT Category, COUNT(*) FROM book_club GROUP BY Category
nvbench
CREATE TABLE Catalog_Structure ( catalog_level_number INTEGER, catalog_id INTEGER, catalog_level_name VARCHAR(50) ) CREATE TABLE Catalog_Contents ( catalog_entry_id INTEGER, catalog_level_number INTEGER, parent_entry_id INTEGER, previous_entry_id INTEGER, next_entry_id INTEGER, cata...
SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name ORDER BY catalog_entry_name
nvbench
CREATE TABLE procedures ( 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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2167" AND diagnoses.short_title = "Pressure ulcer, hip"
mimicsql_data
CREATE TABLE table_name_76 ( to_par VARCHAR, country VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par of the player from the United States with a t1 place?
SELECT to_par FROM table_name_76 WHERE country = "united states" AND place = "t1"
sql_create_context
CREATE TABLE table_2886617_8 ( position VARCHAR, nhl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the draft pick for Toronto Maple Leafs play?
SELECT position FROM table_2886617_8 WHERE nhl_team = "Toronto Maple Leafs"
sql_create_context
CREATE TABLE table_71838 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How close to par was Tom Kite when he played?
SELECT "To par" FROM table_71838 WHERE "Player" = 'tom kite'
wikisql
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGR...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '20186568174'
css
CREATE TABLE table_52828 ( "Player" text, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did Eddie Hughes play for the Jazz?
SELECT "Years for Jazz" FROM table_52828 WHERE "Player" = 'eddie hughes'
wikisql
CREATE TABLE table_name_77 ( season VARCHAR, league VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Season has a League of bezirksliga?
SELECT season FROM table_name_77 WHERE league = "bezirksliga"
sql_create_context
CREATE TABLE table_name_48 ( neck VARCHAR, bullet VARCHAR, base VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Neck has a Bullet of 10.566 (.416), and a Base of 14.78 (.582)?
SELECT neck FROM table_name_48 WHERE bullet = "10.566 (.416)" AND base = "14.78 (.582)"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'hypernatremia - due to volume depletion' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105' GROUP BY STRFTIME('%y', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dod_year <= "2154.0"
mimicsql_data
CREATE TABLE artists ( id INTEGER, name VARCHAR(120) ) CREATE TABLE customers ( id INTEGER, first_name VARCHAR(40), last_name VARCHAR(20), company VARCHAR(80), address VARCHAR(70), city VARCHAR(40), state VARCHAR(40), country VARCHAR(40), postal_code VARCHAR(10), phone V...
SELECT billing_country, COUNT(*) FROM invoices GROUP BY billing_country ORDER BY COUNT(*) DESC LIMIT 5
nvbench
CREATE TABLE table_15988037_24 ( place VARCHAR, perfect_40s VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all the places where the number of perfect 40s is 0 and the average is 27.25?
SELECT place FROM table_15988037_24 WHERE perfect_40s = 0 AND average = "27.25"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-27704')) AND treatment.treatmentname = 'sedative agent - diazepam' AND STRFT...
eicu
CREATE TABLE table_15037 ( "Name" text, "Geographic code" text, "Type" text, "Households" real, "Population (2004)" real, "Foreign population" real, "Moroccan population" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest for...
SELECT MAX("Foreign population") FROM table_15037 WHERE "Population (2004)" = '7641'
wikisql
CREATE TABLE table_27992 ( "Edition" text, "Class" text, "Legs" real, "In-Port Races" text, "Entries" text, "Start" text, "Finish" text, "Winning yacht" text, "Winning skipper" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the ...
SELECT COUNT("Finish") FROM table_27992 WHERE "Entries" = '15' AND "Winning yacht" = 'L''Esprit d''Equipe'
wikisql
CREATE TABLE table_13636_1 ( turing_complete VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the turing complete with name being atanasoff berry computer (us)
SELECT turing_complete FROM table_13636_1 WHERE name = "Atanasoff–Berry Computer (US)"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, ...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= ...
eicu
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDat...
SELECT AVG(Reputation) AS average_rep, MIN(Reputation) AS min_rep, MAX(Reputation) AS max_rep, COUNT(*) AS num_users FROM Users WHERE Reputation > 1
sede
CREATE TABLE table_name_84 ( driver VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the driver with the grid of 13?
SELECT driver FROM table_name_84 WHERE grid = 13
sql_create_context
CREATE TABLE table_13163 ( "Province" text, "Rd 1" real, "Rd 2 1" text, "Rd 3" real, "Rd 4" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Rd 3 has a Rd 2 1 of 0+1?
SELECT "Rd 3" FROM table_13163 WHERE "Rd 2 1" = '0+1'
wikisql
CREATE TABLE table_78071 ( "Member" text, "Party" text, "Electorate" text, "State" text, "Term in office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what state was the electorate fowler?
SELECT "State" FROM table_78071 WHERE "Electorate" = 'fowler'
wikisql
CREATE TABLE table_name_52 ( laps INTEGER, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Laps is the highest one that has a Time/Retired of +3.370 secs?
SELECT MAX(laps) FROM table_name_52 WHERE time_retired = "+3.370 secs"
sql_create_context
CREATE TABLE table_204_798 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what position did this racer finish at his only world race walking cup competition ?...
SELECT "position" FROM table_204_798 WHERE "competition" = 'world race walking cup'
squall
CREATE TABLE table_name_6 ( dates VARCHAR, squadron VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the dates of squadron 33?
SELECT dates FROM table_name_6 WHERE squadron = "squadron 33"
sql_create_context
CREATE TABLE table_name_78 ( country VARCHAR, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when Year(s) Won is '1962'?
SELECT country FROM table_name_78 WHERE year_s__won = "1962"
sql_create_context
CREATE TABLE table_name_20 ( area_in_acres__ha_ VARCHAR, park_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the area in acres (ha) for the park bald eagle state park?
SELECT area_in_acres__ha_ FROM table_name_20 WHERE park_name = "bald eagle state park"
sql_create_context
CREATE TABLE table_55359 ( "Player" text, "Team" text, "Opponent" text, "Year" real, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player played in 2000?
SELECT "Player" FROM table_55359 WHERE "Year" = '2000'
wikisql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) ...
SELECT meter_700, ID FROM swimmer
nvbench
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM zyjybgb JOIN jyjgzbb ON zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE zyjybgb.JZLSH = '84548610152' AND jyjgzbb.JCRXM LIKE '李%' UNION SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM mzjybgb JOIN jyjgzbb ON mzjybgb.YLJG...
css
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID ...
SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY DESC
nvbench
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT FLX_MED_ORG_ID FROM t_kc21 WHERE MED_CLINIC_ID = '43267723179'
css
CREATE TABLE table_name_76 ( drawn INTEGER, against VARCHAR, lost VARCHAR, position VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Drawn is the average one that has a Position smaller than 9, and Points smaller than 22, and ...
SELECT AVG(drawn) FROM table_name_76 WHERE position < 9 AND points < 22 AND lost < 9 AND against > 29
sql_create_context
CREATE TABLE table_51809 ( "Name" text, "Built" text, "Wheels" text, "Fuel/ Trans" text, "Status" text, "Colour" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the manufacturer, found under the Built column, that made locomotives with a ...
SELECT "Built" FROM table_51809 WHERE "Fuel/ Trans" = 'diesel-electric'
wikisql
CREATE TABLE table_1507423_4 ( avg_finish VARCHAR, avg_start VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average finish when the average start was 18.4?
SELECT avg_finish FROM table_1507423_4 WHERE avg_start = "18.4"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_65558 ( "Elector" text, "Nationality" text, "Cardinalatial order and title" text, "Elevated" text, "Elevator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was Cardinal-Deacon of S. Giorgio in Velabro elevated?
SELECT "Elevated" FROM table_65558 WHERE "Cardinalatial order and title" = 'cardinal-deacon of s. giorgio in velabro'
wikisql
CREATE TABLE table_22858557_1 ( year INTEGER, outcome VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year where the runner-up outcome was at its basic minimum?
SELECT MIN(year) FROM table_22858557_1 WHERE outcome = "Runner-up"
sql_create_context
CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) -- Using valid SQLite, answer the following questions ...
SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY Country
nvbench
CREATE TABLE table_name_55 ( january VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which January has an Opponent of toronto maple leafs?
SELECT january FROM table_name_55 WHERE opponent = "toronto maple leafs"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2115.0"
mimicsql_data
CREATE TABLE table_203_577 ( id number, "tenure" text, "coach" text, "years" number, "record" text, "pct." number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the only coach to serve for only six years ?
SELECT "coach" FROM table_203_577 WHERE "years" = 6
squall
CREATE TABLE table_name_53 ( hanyu_pinyin VARCHAR, hanzi VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Pinyin for ?
SELECT hanyu_pinyin FROM table_name_53 WHERE hanzi = "依兰县"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Cardiac dysrhythmias NEC" AND prescriptions.route = "IH"
mimicsql_data
CREATE TABLE table_name_4 ( product VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the amount of grain in 2001?
SELECT 2001 FROM table_name_4 WHERE product = "grain"
sql_create_context
CREATE TABLE table_13707 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent in the final on 24 November 2008?
SELECT "Opponent in the final" FROM table_13707 WHERE "Date" = '24 november 2008'
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 WHERE demographic.ethnicity = "ASIAN" AND demographic.age < "80"
mimicsql_data
CREATE TABLE table_12521 ( "Name" text, "Bodyweight" real, "Snatch" real, "Clean & Jerk" real, "Total (kg)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest weight snatched for a lifter who had a clean and jerk less than 185?
SELECT MIN("Snatch") FROM table_12521 WHERE "Clean & Jerk" < '185'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "78551"
mimicsql_data
CREATE TABLE table_name_22 ( date VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the result 3-1?
SELECT date FROM table_name_22 WHERE result = "3-1"
sql_create_context
CREATE TABLE table_24610 ( "Season" text, "Timeslot Times listed are Eastern time" text, "Season premiere" text, "Season finale" text, "TV season" text, "Ranking" real, "Viewers (in millions of households)" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "Season finale" FROM table_24610 WHERE "Ranking" = '73'
wikisql
CREATE TABLE table_name_61 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result on February 18, 2003?
SELECT result FROM table_name_61 WHERE date = "february 18, 2003"
sql_create_context
CREATE TABLE table_44883 ( "Round" real, "Pick" real, "Position" text, "Nationality" text, "College/Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Nationality, when Round is less than 2, and when Pick is '24'?
SELECT "Nationality" FROM table_44883 WHERE "Round" < '2' AND "Pick" = '24'
wikisql
CREATE TABLE table_203_372 ( id number, "from" number, "to" number, "name" text, "party" text, "position" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which party won the most number of time ?
SELECT "party" FROM table_203_372 GROUP BY "party" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Rosiglitazone Maleate"
mimicsql_data
CREATE TABLE table_47101 ( "Round" real, "Pick #" real, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Round, when Pick # is greater than 70, and when Position is Tackle?
SELECT AVG("Round") FROM table_47101 WHERE "Pick #" > '70' AND "Position" = 'tackle'
wikisql
CREATE TABLE roles ( role_code text, role_name text, role_description text ) CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE employees ( employee_id number, role_code text, employee_name text, gen...
SELECT T2.day_number, T1.date_stored FROM all_documents AS T1 JOIN ref_calendar AS T2 ON T1.date_stored = T2.calendar_date
spider
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 AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5908391' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-09-17' AND '2006-10-06'
css
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, ...
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 = 739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial b...
mimic_iii
CREATE TABLE table_14253123_1 ( zip_code_prefix_es_ VARCHAR, _percentage_of_boundary_by_water VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the % of boundary by water is 63% what is the overall number of zip code prefix(es)?
SELECT COUNT(zip_code_prefix_es_) FROM table_14253123_1 WHERE _percentage_of_boundary_by_water = "63%"
sql_create_context
CREATE TABLE medicine ( name VARCHAR, trade_name VARCHAR, FDA_approved VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names and trade names of the medicines which has 'Yes' value in the FDA record?
SELECT name, trade_name FROM medicine WHERE FDA_approved = 'Yes'
sql_create_context
CREATE TABLE table_66486 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of the new zealand team that had fb listed under notes?
SELECT "Rank" FROM table_66486 WHERE "Notes" = 'fb' AND "Country" = 'new zealand'
wikisql
CREATE TABLE table_204_926 ( id number, "#" text, "player" text, "country" text, "score" text, "to par" number, "money ($)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which competitor received the saem score as sandra haynie ?
SELECT "player" FROM table_204_926 WHERE "player" <> 'sandra haynie' AND "score" = (SELECT "score" FROM table_204_926 WHERE "player" = 'sandra haynie')
squall
CREATE TABLE table_name_17 ( opponent VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent, when Event is RITC 22 - Rage In The Cage 22?
SELECT opponent FROM table_name_17 WHERE event = "ritc 22 - rage in the cage 22"
sql_create_context
CREATE TABLE table_name_25 ( year INTEGER, result VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year is the result 6th in munich, west germany?
SELECT SUM(year) FROM table_name_25 WHERE result = "6th" AND venue = "munich, west germany"
sql_create_context
CREATE TABLE table_name_38 ( laps VARCHAR, fin_pos VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the number of laps led by the driver with a finish position of 14?
SELECT laps AS Led FROM table_name_38 WHERE fin_pos = "14"
sql_create_context
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cine...
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title
nvbench
CREATE TABLE table_name_88 ( total INTEGER, play_offs VARCHAR, league VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What mean total had a league number of 18, Richard Logan as a player, and a play-offs number smaller than 1?
SELECT AVG(total) FROM table_name_88 WHERE league = 18 AND player = "richard logan" AND play_offs < 1
sql_create_context