instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_69 ( type VARCHAR, moving_from VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type when they move from Gimn stic?
SELECT type FROM table_name_69 WHERE moving_from = "gimnàstic"
sql_create_context
CREATE TABLE table_name_55 ( date VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for rio de janeiro
SELECT date FROM table_name_55 WHERE city = "rio de janeiro"
sql_create_context
CREATE TABLE table_name_84 ( name VARCHAR, lane VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was in Lane 5?
SELECT name FROM table_name_84 WHERE lane = 5
sql_create_context
CREATE TABLE table_72969 ( "English ( BCP )" text, "Writing system 1 (English-based)" text, "Writing system 2 (German-based)" text, "Modern German (close translation)" text, "Modern German (standard wording)" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT "Modern German (standard wording)" FROM table_72969 WHERE "Writing system 2 (German-based)" = 'wie mir die vergewwe wu uns schuldich sinn.'
wikisql
CREATE TABLE producer ( pid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE cast ( id int, msid int, aid int, role text ) CREATE TABLE copyright ( id int, msid int, cid int ) CREATE TABLE genre ( gid int, genre ...
SELECT birth_city FROM writer WHERE name = 'Kevin Spacey'
imdb
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Subjects ( subject_id INTEGER, subje...
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment GROUP BY date_of_completion ORDER BY date_of_completion
nvbench
CREATE TABLE table_name_87 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Home team with an Away team that is oxford united?
SELECT home_team FROM table_name_87 WHERE away_team = "oxford united"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number,...
SELECT COUNT(DISTINCT hz_info.RYBH) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE zyjzjlb.YLJGDM = '5267326' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 27
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE < 9)
css
CREATE TABLE table_46679 ( "Rank" real, "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 medals when the team got 2 bronze and more than 5 silver me...
SELECT COUNT("Gold") FROM table_46679 WHERE "Bronze" = '2' AND "Silver" > '5'
wikisql
CREATE TABLE table_75471 ( "iWork version" text, "Keynote version" real, "Pages version" real, "Numbers version" text, "Release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the latest keynote version of version 2.3 of numbers with pag...
SELECT MAX("Keynote version") FROM table_75471 WHERE "Numbers version" = '2.3' AND "Pages version" > '4.3'
wikisql
CREATE TABLE table_49017 ( "Religion" text, "Chester" text, "Congleton" text, "Crewe and Nantwich" text, "Ellesmere Port and Neston" text, "Macclesfield" text, "Vale Royal" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHA...
SELECT "Vale Royal" FROM table_49017 WHERE "Religion" = 'jewish'
wikisql
CREATE TABLE table_name_72 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the 1997 when 1992 is QF, 1995 is 1R, and 1999 is 1R?
SELECT 1997 FROM table_name_72 WHERE 1999 = "1r" AND 1992 = "qf" AND 1995 = "1r"
sql_create_context
CREATE TABLE table_train_163 ( "id" int, "pulse_oximetry" int, "hemoglobin_a1c_hba1c" float, "body_weight" float, "allergy_to_adhesive" bool, "creatinine_clearance_cl" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- creatinine...
SELECT * FROM table_train_163 WHERE creatinine_clearance_cl > 1.2
criteria2sql
CREATE TABLE table_27009 ( "Vehicle" text, "Operating mode" text, "EPA rated All-electric range" text, "EPA rated combined fuel economy" text, "Clean electric grid California (San Francisco)" text, "U.S. national average electric mix" text, "Dirty electric grid Rocky Mountains (Denver)" text...
SELECT COUNT("Clean electric grid California (San Francisco)") FROM table_27009 WHERE "Vehicle" = 'BMW ActiveE'
wikisql
CREATE TABLE Stay ( StayID INTEGER, Patient INTEGER, Room INTEGER, StayStart DATETIME, StayEnd DATETIME ) CREATE TABLE Nurse ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), Registered BOOLEAN, SSN INTEGER ) CREATE TABLE Affiliated_With ( Physician INTEGER, ...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name
nvbench
CREATE TABLE table_name_53 ( effect VARCHAR, weapon VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Effect, when Weapon is '35mm/Small arms fire'?
SELECT effect FROM table_name_53 WHERE weapon = "35mm/small arms fire"
sql_create_context
CREATE TABLE table_58600 ( "Year" real, "Dates" text, "Discovery of the Year (Golden Puffin)" text, "Lifetime Achievement" text, "Creative Excellency" text, "Audience Award" text, "FIPRESCI Award" text, "Church of Iceland Award" text ) -- Using valid SQLite, answer the following questi...
SELECT "Dates" FROM table_58600 WHERE "Lifetime Achievement" = 'jim jarmusch'
wikisql
CREATE TABLE table_34013 ( "Year ended" text, "Passengers flown" real, "Employees (Average/Year)" real, "Net profit/loss (SEK)" real, "Basic eps (SEK)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Passengers flown has a Net profit/loss (SEK)...
SELECT SUM("Passengers flown") FROM table_34013 WHERE "Net profit/loss (SEK)" < '-6,360,000,000' AND "Employees (Average/Year)" < '34,544' AND "Basic eps (SEK)" = '-18.2'
wikisql
CREATE TABLE table_58930 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHat was the score for Phil Mickelson when he placed t3?
SELECT "Score" FROM table_58930 WHERE "Place" = 't3' AND "Player" = 'phil mickelson'
wikisql
CREATE TABLE table_16992 ( "Marginal Ordinary Income Tax Rate" text, "Single" text, "Married Filing Jointly or Qualified Widow(er)" text, "Married Filing Separately" text, "Head of Household" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th...
SELECT COUNT("Marginal Ordinary Income Tax Rate") FROM table_16992 WHERE "Single" = '$8,351– $33,950'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, t...
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 546 OR course.number = 558) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
CREATE TABLE table_18663 ( "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's the district with incumbent being john e. miller
SELECT "District" FROM table_18663 WHERE "Incumbent" = 'John E. Miller'
wikisql
CREATE TABLE table_204_809 ( id number, "draw" number, "country" text, "language" text, "artist" text, "song" text, "english translation" text, "national final" text, "place" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT "country" FROM table_204_809 ORDER BY "points" LIMIT 1
squall
CREATE TABLE table_203_778 ( id number, "representative" text, "title" text, "presentation\nof credentials" text, "termination\nof mission" text, "appointed by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- is solon borland a representative ?
SELECT (SELECT COUNT(*) FROM table_203_778 WHERE "representative" = 'solon borland') > 0
squall
CREATE TABLE table_64321 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rider has laps less than 20, a ducati 1098 rs 08 as the bike, with accident as the time, and a grid less than ...
SELECT "Rider" FROM table_64321 WHERE "Laps" < '20' AND "Bike" = 'ducati 1098 rs 08' AND "Time" = 'accident' AND "Grid" < '14'
wikisql
CREATE TABLE table_4193 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote 'romeo & Juliet &...
SELECT "Written by" FROM table_4193 WHERE "Title" = 'Romeo & Juliet & Dick'
wikisql
CREATE TABLE Sportsinfo ( gamesplayed INTEGER, sportname VARCHAR, onscholarship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games are played for all football games by students on scholarship?
SELECT SUM(gamesplayed) FROM Sportsinfo WHERE sportname = "Football" AND onscholarship = 'Y'
sql_create_context
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), fam...
SELECT password, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_name_8 ( player VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player is from Russia?
SELECT player FROM table_name_8 WHERE nationality = "russia"
sql_create_context
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_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '85618311' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2746.51)
css
CREATE TABLE table_51094 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has +21 as the to par?
SELECT "Player" FROM table_51094 WHERE "To par" = '+21'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE transactions_lots ( transaction_id number, lot_id number ) CREATE TABLE purchases ( purchase_transaction_id number, purchase_details text ) CREATE TABLE sales ( sales_transaction_id number, sales_details text ) CREATE TABLE lots ( lot_id number, investor_id number, lo...
SELECT MAX(share_count) FROM transactions WHERE amount_of_transaction < 10000
spider
CREATE TABLE table_name_39 ( area__percentage_of_eu VARCHAR, population_in_millions VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the area % of EU with 16.4 population in millions?
SELECT area__percentage_of_eu FROM table_name_39 WHERE population_in_millions = 16.4
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE i...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 52 AND STRFTIME('%y', transfers.intime) <= '2102')
mimic_iii
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT * FROM Users WHERE Id = '##UserID##'
sede
CREATE TABLE table_76317 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "Career SR" text, "Career Win-Loss" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "1996" FROM table_76317 WHERE "1992" = 'atp masters series'
wikisql
CREATE TABLE table_30018460_1 ( semifinalists VARCHAR, country_territory VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many semifinalists where from peru?
SELECT semifinalists FROM table_30018460_1 WHERE country_territory = "Peru"
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text...
SELECT DISTINCT fare_basis_code FROM fare_basis WHERE fare_basis_code = 'QX'
atis
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostsWithDeleted ( Id number, PostTyp...
SELECT COUNT(U.Id) FROM Users AS U WHERE U.Reputation <= 101
sede
CREATE TABLE table_70301 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the final score for the game played on J...
SELECT "Score" FROM table_70301 WHERE "Partner" = 'mashona washington' AND "Date" = 'january 10, 2011'
wikisql
CREATE TABLE table_25533 ( "Rank" real, "Country/Territory" text, "Manhunt International" real, "1st runner-up" real, "2nd runner-up" real, "3rd runner-up" real, "4th runner-up" real, "Semifinalists" real, "Total" real ) -- Using valid SQLite, answer the following questions for the...
SELECT COUNT("4th runner-up") FROM table_25533 WHERE "2nd runner-up" < '1.0' AND "1st runner-up" < '1.0' AND "Total" = '2'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 's/p surgery for cancer')) GROUP BY cost.pati...
eicu
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY AVG(meter_100)
nvbench
CREATE TABLE teachers ( LastName TEXT, FirstName TEXT, Classroom INTEGER ) CREATE TABLE list ( LastName TEXT, FirstName TEXT, Grade INTEGER, Classroom INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the grade number and classroom...
SELECT Classroom, Grade FROM list
nvbench
CREATE TABLE table_32182 ( "Round" real, "Overall" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was James Reed's draft round number?
SELECT COUNT("Round") FROM table_32182 WHERE "Player" = 'james reed'
wikisql
CREATE TABLE table_name_16 ( date VARCHAR, winning_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was the winning score 16 (67-70-69-66=272)?
SELECT date FROM table_name_16 WHERE winning_score = –16(67 - 70 - 69 - 66 = 272)
sql_create_context
CREATE TABLE table_name_26 ( venue VARCHAR, year VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue before 2006, with the position of 10th?
SELECT venue FROM table_name_26 WHERE year < 2006 AND position = "10th"
sql_create_context
CREATE TABLE table_171250_2 ( census_ranking VARCHAR, area_km_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the census ranking(s) that have an area of 369.25 km2?
SELECT census_ranking FROM table_171250_2 WHERE area_km_2 = "369.25"
sql_create_context
CREATE TABLE table_15187735_1 ( segment_d VARCHAR, segment_b VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was segment D when segment B was jeans?
SELECT segment_d FROM table_15187735_1 WHERE segment_b = "Jeans"
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 COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.ZZYSGH = '82477447' AND wdmzjzjlb.JZKSRQ BETWEEN '2002-11-04' AND '2014-02-23' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info...
css
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT demographic.discharge_location, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "26285"
mimicsql_data
CREATE TABLE table_20763 ( "Country" text, "Preliminary" text, "Interview" text, "Swimsuit" text, "Evening gown" text, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the average scores of contestants whose interview score is 8...
SELECT "Average" FROM table_20763 WHERE "Interview" = '8.011'
wikisql
CREATE TABLE table_30536 ( "Episode" real, "1st season" text, "2nd season" text, "3rd season" text, "4th season" text, "5th season" text, "6th season" text, "7th season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many 7th season ...
SELECT COUNT("7th season") FROM table_30536 WHERE "2nd season" = '6 594 469'
wikisql
CREATE TABLE table_name_32 ( tone VARCHAR, phonetic VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tone goes with Phonetic of [p a ]?
SELECT tone FROM table_name_32 WHERE phonetic = "[pʰaː˥˥]"
sql_create_context
CREATE TABLE table_59158 ( "Year" real, "Team/Chassis" text, "Engine" text, "Tyres" text, "Pts." real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points have an Engine of ferrari tipo 033 v6 tc, and a Year larger than 1987?
SELECT SUM("Pts.") FROM table_59158 WHERE "Engine" = 'ferrari tipo 033 v6 tc' AND "Year" > '1987'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'therapeutic antibacterials - rifampin')) AND...
eicu
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 MED_AMOUT FROM t_kc21 WHERE MED_CLINIC_ID = '80157522521'
css
CREATE TABLE table_75071 ( "Rank" real, "Country/Territory" text, "Nuestra Belleza Latina" real, "1st runner-up" real, "2nd runner-up" real, "3rd runner-up" real, "4th runner-up" real, "5th runner-up" real, "6th runner-up" real, "7th runner-up" real, "8th runner-up" real, ...
SELECT SUM("3rd runner-up") FROM table_75071 WHERE "9th runner-up" > '0' AND "11th runner-up" = '0' AND "1st runner-up" > '0'
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 qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '1393736' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_NM HAVING AVG(qtb.PERSON_AGE) > 10 UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '1393736' GR...
css
CREATE TABLE products ( product_id number, product_details text ) CREATE TABLE order_items ( order_id number, product_id number, order_quantity text ) CREATE TABLE addresses ( address_id number, address_content text, city text, zip_postcode text, state_province_county text, ...
SELECT DISTINCT product_details FROM products
spider
CREATE TABLE table_name_16 ( number_ VARCHAR, _name VARCHAR, description VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which number and name has the description Gresley RB and a date before 1937?
SELECT number_ & _name FROM table_name_16 WHERE description = "gresley rb" AND date < 1937
sql_create_context
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Course_Authors_and_Tutors ( author_id IN...
SELECT family_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_21025437_6 ( directed_by VARCHAR, episode_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed episode number 23?
SELECT directed_by FROM table_21025437_6 WHERE episode_no = 23
sql_create_context
CREATE TABLE table_13659 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year has a Rank of 25?
SELECT "Year" FROM table_13659 WHERE "Rank" = '25'
wikisql
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (((flight.arrival_time <= 1930 AND flight.arrival_time >= 1830) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight....
atis
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Seroma complicting proc" AND prescriptions.route = "NEB"
mimicsql_data
CREATE TABLE table_33742 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The event that has a record of 1-0 is none of the a...
SELECT "Event" FROM table_33742 WHERE "Record" = '1-0'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diarrhea - non-infectious' AND DATETIME(diagnosis.di...
eicu
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'alameda' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_36850 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" real, "Time" text, "Jockey" text, "Winner/2nd" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was ...
SELECT "Winner/2nd" FROM table_36850 WHERE "Race" = 'caulfield guineas'
wikisql
CREATE TABLE table_203_678 ( id number, "rank" number, "wrestler" text, "no. of reigns" number, "combined\ndefenses" number, "combined\ndays" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- keiji had how many number of reigns ?
SELECT "no. of reigns" FROM table_203_678 WHERE "wrestler" = 'keiji mutoh'
squall
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 T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T2.Height
nvbench
CREATE TABLE table_name_44 ( surface VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the playing surface for the Tournament of Great Britain F16?
SELECT surface FROM table_name_44 WHERE tournament = "great britain f16"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) = '2104'
eicu
CREATE TABLE table_48524 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which average overall has a Pick smaller than 5?
SELECT AVG("Overall") FROM table_48524 WHERE "Pick" < '5'
wikisql
CREATE TABLE table_1646960_3 ( winning_song VARCHAR, debut_album VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the winning song for the artist with a debut album 'mike'?
SELECT winning_song FROM table_1646960_3 WHERE debut_album = "Mike"
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, 'Oracle' AS TagName, COUNT(*) AS PostCount FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE 'oracle%' GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY ...
sede
CREATE TABLE table_54546 ( "Rank" real, "Name" text, "Nation" text, "Points" real, "Places" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the points when the rank is more than 1 and the places is 33?
SELECT "Points" FROM table_54546 WHERE "Rank" > '1' AND "Places" = '33'
wikisql
CREATE TABLE table_204_532 ( id number, "season" text, "tier" number, "division" text, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of seasons ?
SELECT COUNT("season") FROM table_204_532
squall
CREATE TABLE table_60490 ( "Round" text, "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest attendance was the opponent was chelsea?
SELECT MIN("Attendance") FROM table_60490 WHERE "Opponent" = 'chelsea'
wikisql
CREATE TABLE t_kc21 ( 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 COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5034604' AND t_kc21.IN_HOSP_DATE BETWEEN '2005-02-20' AND '2005-06-27'
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'amicar' AND intakeoutput.cellpath LIKE '%input%' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-4 year'))
eicu
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 MAIN_COND_DES FROM t_kc21 WHERE MED_CLINIC_ID = '55437969085'
css
CREATE TABLE table_name_76 ( tournament VARCHAR, date VARCHAR, outcome VARCHAR, surface VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament had an outcome of winner, a hard surface, and happened on August 26, 2006?
SELECT tournament FROM table_name_76 WHERE outcome = "winner" AND surface = "hard" AND date = "august 26, 2006"
sql_create_context
CREATE TABLE table_17884 ( "No" real, "Player" text, "Height" text, "Position" text, "Year born" real, "Current Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number that has a height of 2.06?
SELECT COUNT("No") FROM table_17884 WHERE "Height" = '2.06'
wikisql
CREATE TABLE table_12958 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record on April 28?
SELECT "Record" FROM table_12958 WHERE "Date" = 'april 28'
wikisql
CREATE TABLE table_name_70 ( mission VARCHAR, service VARCHAR, age_on_mission VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What mission did the astronaut who 38 years old on the mission and who served in NASA serve on?
SELECT mission FROM table_name_70 WHERE service = "nasa" AND age_on_mission = 38
sql_create_context
CREATE TABLE table_63580 ( "Location" text, "Name of mill" text, "Type" text, "Built" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Type of Mill at Molen de Stud?
SELECT "Type" FROM table_63580 WHERE "Name of mill" = 'molen de stud'
wikisql
CREATE TABLE table_name_22 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score that made the record 47-49?
SELECT score FROM table_name_22 WHERE record = "47-49"
sql_create_context
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 mzjzjlb ( HXPLC number, HZXM ...
SELECT jybgb.KSBM, jybgb.KSMC 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 = '78828339' AND jybgb.BGRQ BETWEEN '2004-07-28' AND '2006-...
css
CREATE TABLE table_1566852_5 ( interview_subject VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 20 questions for derek jeter
SELECT 20 AS _questions FROM table_1566852_5 WHERE interview_subject = "Derek Jeter"
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428) AND icustays.outtime IS NULL) ...
mimic_iii
CREATE TABLE table_67190 ( "Year" real, "Film" text, "Director" text, "Nationality of director" text, "Award" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Award of troisi me prix, and a Year smaller than 2010, and a Director of jan komasa is what ...
SELECT "Film" FROM table_67190 WHERE "Award" = 'troisième prix' AND "Year" < '2010' AND "Director" = 'jan komasa'
wikisql
CREATE TABLE table_1231316_7 ( location VARCHAR, fastest_time__s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of locations with the fastest times of 11.13?
SELECT COUNT(location) FROM table_1231316_7 WHERE fastest_time__s_ = "11.13"
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 jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info 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 person_info_hz_info.KH = hz_info.KH AND pers...
css
CREATE TABLE table_26019 ( "#" real, "Title" text, "Original airdate" text, "Timeslot" text, "Viewers (millions)" text, "Nightly rank" real, "Weekly rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What timeslot received 0.673 viewers?
SELECT "Timeslot" FROM table_26019 WHERE "Viewers (millions)" = '0.673'
wikisql
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 CLINIC_ID FROM t_kc21 WHERE MED_CLINIC_ID = '89718939232'
css
CREATE TABLE table_name_84 ( points INTEGER, rider VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Rider of st phane mertens had what lowest points?
SELECT MIN(points) FROM table_name_84 WHERE rider = "stéphane mertens"
sql_create_context