instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_38891 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What city held the game with a result of 1:0?
SELECT "City" FROM table_38891 WHERE "Results\u00b9" = '1:0'
wikisql
CREATE TABLE table_13848 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Part number(s)" text, ...
SELECT "Part number(s)" FROM table_13848 WHERE "Turbo" = 'low power'
wikisql
CREATE TABLE table_14288212_1 ( team VARCHAR, points_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many teams scored exactly 38 points
SELECT COUNT(team) FROM table_14288212_1 WHERE points_for = 38
sql_create_context
CREATE TABLE table_14981 ( "Stage" text, "Time" text, "Name" text, "Length" text, "Winner" text, "Rally leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Time in the Mina Clavero 2 Stage?
SELECT "Time" FROM table_14981 WHERE "Name" = 'mina clavero 2'
wikisql
CREATE TABLE table_3353 ( "meas. num." real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every description if NO v...
SELECT "description" FROM table_3353 WHERE "NO votes" = '233759'
wikisql
CREATE TABLE table_68084 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What United States player holds the place of t8?`
SELECT "Player" FROM table_68084 WHERE "Place" = 't8' AND "Country" = 'united states'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.icd9_code = "2800"
mimicsql_data
CREATE TABLE table_29555 ( "Season" text, "Points per Game" text, "Total Yards per Game" text, "Rushing Yards per Game" text, "Passing Yards per Game" text, "Sacks" text, "Interceptions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is...
SELECT "Rushing Yards per Game" FROM table_29555 WHERE "Sacks" = '25'
wikisql
CREATE TABLE table_204_103 ( id number, "medal" text, "name" text, "sport" text, "event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which two silver medalists had 2 weightlifting silver medals each ?
SELECT "name" FROM table_204_103 WHERE "sport" = 'weightlifting' GROUP BY "name" HAVING COUNT("medal") = 2
squall
CREATE TABLE table_49104 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Laps have a Manufacturer of suzuki, and a Grid smaller than 16?
SELECT MAX("Laps") FROM table_49104 WHERE "Manufacturer" = 'suzuki' AND "Grid" < '16'
wikisql
CREATE TABLE table_name_29 ( winner VARCHAR, event VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Winner of the French Polynesia Billabong Pro Event?
SELECT winner FROM table_name_29 WHERE event = "billabong pro" AND country = "french polynesia"
sql_create_context
CREATE TABLE table_15078 ( "Episode" text, "First aired" text, "Entrepreneur(s)" text, "Company or product name" text, "Money requested (\u00a3)" real, "Investing Dragon(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what investing dragons a...
SELECT "Investing Dragon(s)" FROM table_15078 WHERE "Episode" = 'episode 10'
wikisql
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Catherine Krull%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o...
advising
CREATE TABLE orders ( order_id VARCHAR, customer_id VARCHAR, date_order_placed VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the order id and customer id of the oldest order?
SELECT order_id, customer_id FROM orders ORDER BY date_order_placed LIMIT 1
sql_create_context
CREATE TABLE customer_policies ( policy_id number, customer_id number, policy_type_code text, start_date time, end_date time ) CREATE TABLE customers ( customer_id number, customer_details text ) CREATE TABLE payments ( payment_id number, settlement_id number, payment_method_co...
SELECT T1.claim_id, T1.date_claim_made, T1.date_claim_settled FROM claims AS T1 JOIN settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id HAVING COUNT(*) = 1
spider
CREATE TABLE table_4232 ( "Pick #" real, "MLS team" text, "Player" text, "Position" text, "Affiliation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many pick# does the university of akron reading united michigan bucks affiliation have
SELECT COUNT("Pick #") FROM table_4232 WHERE "Affiliation" = 'University of Akron Reading United Michigan Bucks'
wikisql
CREATE TABLE table_54952 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In games where st kilda was the away team, what ...
SELECT MIN("Crowd") FROM table_54952 WHERE "Away team" = 'st kilda'
wikisql
CREATE TABLE table_16536 ( "Episode Titles" text, "First air date" text, "Reward" text, "Immunity" text, "Exiled" text, "Eliminated" text, "Vote" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the results of epis...
SELECT "Finish" FROM table_16536 WHERE "First air date" = 'March 6, 2008'
wikisql
CREATE TABLE table_49309 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Tyres" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which engine of Rob Walker Racing Team has 47 points and F tyres?
SELECT "Engine" FROM table_49309 WHERE "Points" = '47' AND "Tyres" = 'f' AND "Entrant" = 'rob walker racing team'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInpu...
SELECT t.TagName, u.Location, COUNT(*) AS "#_posts_per_tag/location" FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE Location LIKE '%' + '##country:string##' + '%' COLLATE latin1_general_ci_ai GROUP BY t.TagName, u...
sede
CREATE TABLE table_40955 ( "Position" text, "Jersey number" real, "Name v t e" text, "Height (cm)" real, "Weight (kg)" real, "Birthplace" text, "1995-96 team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average Jersey number ...
SELECT AVG("Jersey number") FROM table_40955 WHERE "1995-96 team" = 'calgary flames' AND "Weight (kg)" > '84'
wikisql
CREATE TABLE table_203_341 ( id number, "season" text, "champion" text, "runner-up" text, "score" text, "third place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the total amounts of times that prokom trefl sopot is listed as the cha...
SELECT COUNT(*) FROM table_203_341 WHERE "champion" = 'prokom trefl sopot'
squall
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.IN_DIAG_DIS_CD = 'Y80.928'
css
CREATE TABLE table_15327489_1 ( riders VARCHAR, team_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the rdiers for jir team scot motogp
SELECT riders FROM table_15327489_1 WHERE team_name = "JiR Team Scot MotoGP"
sql_create_context
CREATE TABLE table_24235 ( "Name" text, "Municipal status" text, "Census division" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" text, "Area (km\u00b2)" text, "Population density" text ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT "Change (%)" FROM table_24235 WHERE "Area (km\u00b2)" = '247.21'
wikisql
CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time ) CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE reviewer ( rid number, name text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT DISTINCT T3.name FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid JOIN reviewer AS T3 ON T1.rid = T3.rid WHERE T2.title = 'Gone with the Wind'
spider
CREATE TABLE table_name_35 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on 6 February 2008?
SELECT score FROM table_name_35 WHERE date = "6 february 2008"
sql_create_context
CREATE TABLE table_15840 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did Elf Team Tyrrell have 39 points and a Tyrrell 007 Chassis?
SELECT SUM("Year") FROM table_15840 WHERE "Entrant" = 'elf team tyrrell' AND "Points" = '39' AND "Chassis" = 'tyrrell 007'
wikisql
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Cu...
SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type
nvbench
CREATE TABLE table_19309079_2 ( year VARCHAR, qatari_male VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years were there 97 qatari male births?
SELECT COUNT(year) FROM table_19309079_2 WHERE qatari_male = 97
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 demographic.dischtime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "85673"
mimicsql_data
CREATE TABLE table_43269 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Label name that has a Country of uk and the Catalog is bpg 62988?
SELECT "Label" FROM table_43269 WHERE "Country" = 'uk' AND "Catalog" = 'bpg 62988'
wikisql
CREATE TABLE table_28059992_6 ( college VARCHAR, cfl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college did the player who was drafted by Calgary go to?
SELECT college FROM table_28059992_6 WHERE cfl_team = "Calgary"
sql_create_context
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2187" AND prescriptions.route = "TP"
mimicsql_data
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT jybgb.JYSQJGMC, jybgb.JYJGMC FROM jybgb WHERE jybgb.BGDH = '06020436225'
css
CREATE TABLE table_1745843_9 ( part_1 VARCHAR, verb_meaning VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the part one for to give
SELECT part_1 FROM table_1745843_9 WHERE verb_meaning = "to give"
sql_create_context
CREATE TABLE table_name_94 ( score VARCHAR, surface VARCHAR, opponent_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the opponent was irena pavlovic and the surface was hard?
SELECT score FROM table_name_94 WHERE surface = "hard" AND opponent_in_the_final = "irena pavlovic"
sql_create_context
CREATE TABLE table_name_79 ( to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the game that has a score of 71-71-70-73=285 what is the to par?
SELECT to_par FROM table_name_79 WHERE score = 71 - 71 - 70 - 73 = 285
sql_create_context
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 mzjzjlb.MZZYZDZZBM, mzjzjlb.MZZYZDZZMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '13253905900'
css
CREATE TABLE table_31322 ( "SAR No." real, "Builder" text, "Year" real, "Works No." real, "Firebox" text, "Driver Diameter" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For what year is the SAR no. 874?
SELECT "Year" FROM table_31322 WHERE "SAR No." = '874'
wikisql
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(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '66859587' AND t_kc22.STA_DATE BETWEEN '2013-08-16' AND '2014-03-07' AND t_kc22.SELF_PAY_AMO > 2896.1
css
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 t3.drugname FROM (SELECT t2.drugname, 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 = 'anemia - acute blood loss anemia' AND STRFTIME('%y...
eicu
CREATE TABLE table_51325 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Mike Hailwood's highest laps when he had a grid more than 7?
SELECT MAX("Laps") FROM table_51325 WHERE "Driver" = 'mike hailwood' AND "Grid" > '7'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, Ta...
WITH InstantEditors AS (SELECT u.* FROM PostHistory AS h INNER JOIN Posts AS p ON p.Id = h.PostId INNER JOIN Users AS u ON u.Id = h.UserId WHERE h.PostHistoryTypeId IN (4, 5, 6) AND h.RevisionGUID NOT IN (SELECT RevisionGUID FROM PostHistory WHERE PostHistoryTypeId = 24) AND h.UserId != p.OwnerUserId AND h.UserId > 0) ...
sede
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.days_stay > "16" AND lab.itemid = "51250"
mimicsql_data
CREATE TABLE table_27721 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the University founded that joined in 1978?
SELECT MAX("Founded") FROM table_27721 WHERE "Joined" = '1978'
wikisql
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 (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-83061') AND NOT patient.unitdischargetime IS NULL ...
eicu
CREATE TABLE table_name_79 ( fatalities VARCHAR, epicenter VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number of Fatalities did the Epicenter M zandar n have?
SELECT fatalities FROM table_name_79 WHERE epicenter = "māzandarān"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistoryTypes ( I...
SELECT SUM(CASE WHEN AnswerCount = 0 THEN 1 ELSE 0 END) AS Unanswered, SUM(CASE WHEN AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS NoAcceptedAnswer, COUNT(*) AS Total FROM Posts WHERE Tags LIKE '%facebook%' AND ClosedDate IS NULL GROUP BY DATEADD(dd, 0, DATEDIFF(dd, 0, CreationDate))
sede
CREATE TABLE table_79820 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place did Jimmy Reece finish in 1957?
SELECT "Finish" FROM table_79820 WHERE "Year" = '1957'
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 zyjybgb.BGDH 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 = '00922703' AND NOT zyjybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM ...
css
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
SELECT patients.gender FROM patients WHERE patients.subject_id = 59916
mimic_iii
CREATE TABLE table_name_80 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What source has july 1 as the date?
SELECT score FROM table_name_80 WHERE date = "july 1"
sql_create_context
CREATE TABLE table_31861 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result for the year 1999?
SELECT "Result" FROM table_31861 WHERE "Year" = '1999'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_nam...
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24364) AND STRFTIME('%y', cost.chargetime) = '2101'
mimic_iii
CREATE TABLE table_63230 ( "School" text, "Location" text, "Mascot" text, "County" real, "Enrollment" text, "IHSAA Class" text, "Year Joined" real, "Previous Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which school has an ...
SELECT "School" FROM table_63230 WHERE "Previous Conference" = 'lost river' AND "Enrollment" = 'a'
wikisql
CREATE TABLE table_204_77 ( id number, "number" text, "builder" text, "type" text, "date" text, "works number" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what builder comes before ss & iw ?
SELECT "builder" FROM table_204_77 WHERE id = (SELECT id FROM table_204_77 WHERE "builder" = 'ss&iw') - 1
squall
CREATE TABLE table_10288 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text, "Win %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2009 had a 2011 of SF?
SELECT "2009" FROM table_10288 WHERE "2011" = 'sf'
wikisql
CREATE TABLE table_name_68 ( pick__number VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the pick # for william loftus?
SELECT pick__number FROM table_name_68 WHERE player = "william loftus"
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 OUT_HOSP_DATE FROM t_kc21 WHERE MED_CLINIC_ID = '12288921431'
css
CREATE TABLE table_43758 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Drawn has a Position of 2, and a Lost larger than 2?
SELECT MIN("Drawn") FROM table_43758 WHERE "Position" = '2' AND "Lost" > '2'
wikisql
CREATE TABLE table_204_320 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many nations share the seventh rank ?
SELECT COUNT("nation") FROM table_204_320 WHERE "rank" = 7
squall
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 MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-161415') AND NOT patient.admissionweight IS NULL GROUP BY STRFTIME('%y', patient.unitadmittime)
eicu
CREATE TABLE table_63263 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the class when the power is 22500 watts?
SELECT "Class" FROM table_63263 WHERE "Power" = '22500 watts'
wikisql
CREATE TABLE table_37022 ( "Player" text, "League" real, "Malaysia Cup" real, "FA Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which FA Cup has a Malaysia Cup larger than 0, and a Total of 8?
SELECT SUM("FA Cup") FROM table_37022 WHERE "Malaysia Cup" > '0' AND "Total" = '8'
wikisql
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admi...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE program_course.catego...
advising
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), ...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 ORDER BY COUNT(booking_start_date)
nvbench
CREATE TABLE table_name_56 ( round INTEGER, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average round for the oulton park circuit?
SELECT AVG(round) FROM table_name_56 WHERE circuit = "oulton park"
sql_create_context
CREATE TABLE table_16275828_4 ( sanction VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who sanctioned the event in lincoln, illinois?
SELECT sanction FROM table_16275828_4 WHERE location = "Lincoln, Illinois"
sql_create_context
CREATE TABLE table_test_19 ( "id" int, "gender" string, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "acute_infectious" bool, "hypertensive_retinopathy" bool, "leukocyte_count" int, "severe_uncontrolled_hypertension" bool, "chronic_infectious" boo...
SELECT * FROM table_test_19 WHERE leukocyte_count < 3000 OR platelet_count < 100000
criteria2sql
CREATE TABLE table_name_59 ( position VARCHAR, against VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions have an against of less than 27, and a played number of less than 8?
SELECT COUNT(position) FROM table_name_59 WHERE against < 27 AND played < 8
sql_create_context
CREATE TABLE table_13978 ( "Stadium" text, "Capacity" real, "City" text, "Region" text, "Home Team" text, "Opened" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What capacity opened lessed than 1937 and is located in the region of champagne-ard...
SELECT "Capacity" FROM table_13978 WHERE "Opened" < '1937' AND "Region" = 'champagne-ardenne'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, ...
SELECT * FROM Comments WHERE UserId = @UserId ORDER BY Score DESC
sede
CREATE TABLE table_name_62 ( province VARCHAR, iata VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Province has a IATA of aku?
SELECT province FROM table_name_62 WHERE iata = "aku"
sql_create_context
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, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb 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 WHERE person_info.XM = '水兴平' AND hz_info.YLJGDM = '5237390' AND NOT zyjzjlb.JZKSMC LIKE '%免疫%'
css
CREATE TABLE table_46659 ( "Player" text, "Country" text, "Year(s) won" text, "Total" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when To Par is '+11'?
SELECT "Country" FROM table_46659 WHERE "To par" = '+11'
wikisql
CREATE TABLE table_204_270 ( id number, "transmitter" text, "kw" number, "bbca" number, "bbcb" number, "d3&4" number, "sdn" number, "arqa" number, "arqb" number, "pol." text, "a.g." text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "transmitter" FROM table_204_270 WHERE "transmitter" IN ('alston', 'haydon bridge') ORDER BY "bbca" DESC LIMIT 1
squall
CREATE TABLE table_62271 ( "Draw" real, "Language" text, "Artist" text, "Song" text, "English translation" text, "National final" text, "Place" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the language when the p...
SELECT "Language" FROM table_62271 WHERE "Points" > '119' AND "Place" > '5'
wikisql
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 Posts
sede
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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, C...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_NM = '马文心' AND t_kc21.CLINIC_TYPE = '住院' AND MOD(t_kc21.MED_AMOUT, 1) = 0
css
CREATE TABLE table_78907 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score of the Tournament with Opponent in the final of Martin Spottl?
SELECT "Score" FROM table_78907 WHERE "Opponent in the final" = 'martin spottl'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'thrombocytopenia - itp') AS t1 JOIN (SEL...
eicu
CREATE TABLE table_name_93 ( score VARCHAR, december VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a December smaller than 14, and a Game of 12?
SELECT score FROM table_name_93 WHERE december < 14 AND game = 12
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'ventr...
eicu
CREATE TABLE table_2668401_17 ( first_elected VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the incumbent from the Virginia 10 district first elected?
SELECT first_elected FROM table_2668401_17 WHERE district = "Virginia 10"
sql_create_context
CREATE TABLE table_39098 ( "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 pick number had a round of less than 7, an overall of less than 127, and where t...
SELECT "Pick #" FROM table_39098 WHERE "Round" < '7' AND "Overall" < '127' AND "Name" = 'robert alford'
wikisql
CREATE TABLE table_5393 ( "Frequency" real, "Callsign" text, "Brand" text, "Format" text, "City of License" text, "Website" text, "Webcast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest frequency from uncionfeypoder.com?...
SELECT MAX("Frequency") FROM table_5393 WHERE "Website" = 'uncionfeypoder.com'
wikisql
CREATE TABLE table_2754 ( "Team" text, "SEC Wins" real, "SEC Losses" real, "Percentage" text, "Home Record" text, "Road Record" text, "Overall Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the home record of the team with per...
SELECT "Home Record" FROM table_2754 WHERE "Percentage" = '.168'
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '陈古兰' AND t_kc22.STA_DATE BETWEEN '2020-09-18' AND '2021-03-30' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_51308 ( "Player" text, "Team" text, "Opponent" text, "Year" real, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's melbourne's average year?
SELECT AVG("Year") FROM table_51308 WHERE "Team" = 'melbourne'
wikisql
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID
nvbench
CREATE TABLE table_22514845_2 ( race_caller VARCHAR, trophy_presentation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number for race caller for bob costas and charlsie cantey
SELECT COUNT(race_caller) FROM table_22514845_2 WHERE trophy_presentation = "Bob Costas and Charlsie Cantey"
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE diagnosis ( diagn...
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 = '027-154299' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE table_20515 ( "RR Romaja" text, "M\u2013R Romaja" text, "Hangul/Chosongul" text, "Hanja" text, "ISO" text, "Area" text, "Capital" text, "Region" text, "Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tot...
SELECT COUNT("Hangul/Chosongul") FROM table_20515 WHERE "Area" = '8,352'
wikisql
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = '100 ml glass cont : iopamidol 61 % iv soln' AND DAT...
eicu
CREATE TABLE PostTypes ( Id number, Name text ) 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, ProfileImage...
SELECT COUNT(*) AS PostsLastMonth, 19 AS Moderators, (COUNT(*) / 19) AS PostsLastMonthPerMod FROM Posts WHERE LastActivityDate >= DATEADD(month, -1, (SELECT MAX(LastActivityDate) FROM Posts))
sede
CREATE TABLE table_18332 ( "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 district is Charles H. Wilson the incumbent of?
SELECT "District" FROM table_18332 WHERE "Incumbent" = 'Charles H. Wilson'
wikisql
CREATE TABLE table_282 ( "car plates (since 1937)" text, "Voivodeship Separate city" text, "Capital" text, "Area in 1000km\u00b2 (1930)" text, "Population in 1000 (1931)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List population when their car ...
SELECT "Population in 1000 (1931)" FROM table_282 WHERE "car plates (since 1937)" = '30-34'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay > "13"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age >= "45"
mimicsql_data