instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_33 ( prize__ INTEGER, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average prize for the Buttercross Limited Stakes?
SELECT AVG(prize__) AS £k_ FROM table_name_33 WHERE race = "buttercross limited stakes"
sql_create_context
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 OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '8485099' GROUP BY OUT_DIAG_DIS_CD
css
CREATE TABLE INVESTORS ( Investor_details VARCHAR, investor_id VARCHAR ) CREATE TABLE TRANSACTIONS ( investor_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the id and details for the investors who have the top 3 number of transactions.
SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3
sql_create_context
CREATE TABLE table_46761 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the round of pick 63?
SELECT "Round" FROM table_46761 WHERE "Pick" = '63'
wikisql
CREATE TABLE useracct ( u_id number, name text ) CREATE TABLE review ( a_id number, u_id number, i_id number, rating number, rank number ) CREATE TABLE trust ( source_u_id number, target_u_id number, trust number ) CREATE TABLE item ( i_id number, title text ) -- Usi...
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > (SELECT AVG(rating) FROM review)
spider
CREATE TABLE table_name_4 ( name VARCHAR, position VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player is a tight end with a round higher than 3?
SELECT name FROM table_name_4 WHERE position = "tight end" AND round > 3
sql_create_context
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
WITH AnsTagInfo(AnsId, AnsCreationDate, quesHasTag) AS (SELECT a.Id AS AnsId, DATE(a.CreationDate) AS AnsCreationDate, CASE WHEN (q.Tags LIKE ('%<##TagName##>%')) THEN 1 ELSE 0 END AS quesHasTag FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId WHERE a.PostTypeId = 2) SELECT AnsCreationDate, CASE WHEN (COUNT(*...
sede
CREATE TABLE table_44447 ( "Designation" text, "Name" text, "Launch date" text, "ISS docking date" text, "Deorbit date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the atv-002 launch?
SELECT "Launch date" FROM table_44447 WHERE "Designation" = 'atv-002'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND ...
css
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE comment_instructor ( instructor_id int, ...
SELECT COUNT(DISTINCT COURSE_1.department, COURSE_0.number) FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'GREEK' AND COURSE_1.number = 504 AND...
advising
CREATE TABLE table_204_111 ( id number, "name" text, "animal type" text, "introduced" number, "reintroduced" text, "retired" number, "beanie baby resembled" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the total number of pillow p...
SELECT COUNT("name") FROM table_204_111
squall
CREATE TABLE Employees ( employee_name VARCHAR, role_code VARCHAR, date_of_birth VARCHAR, employee_Name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the name, role code, and date of birth for the employee with name 'Armani'.
SELECT employee_Name, role_code, date_of_birth FROM Employees WHERE employee_Name = 'Armani'
sql_create_context
CREATE TABLE table_22993636_2 ( overall_record VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's LSU's overall record/
SELECT overall_record FROM table_22993636_2 WHERE team = "LSU"
sql_create_context
CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) -- Using valid SQLite, answer the following questions for the ...
SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY COUNT(Name)
nvbench
CREATE TABLE table_51007 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Japan place?
SELECT "Place" FROM table_51007 WHERE "Country" = 'japan'
wikisql
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Dexmedetomidine"
mimicsql_data
CREATE TABLE table_name_36 ( opponent VARCHAR, venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent of the match on 3 December 1898 in venue h?
SELECT opponent FROM table_name_36 WHERE venue = "h" AND date = "3 december 1898"
sql_create_context
CREATE TABLE table_204_906 ( id number, "#" number, "title" text, "songwriters" text, "producer(s)" text, "performer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of titles listed ?
SELECT COUNT("title") FROM table_204_906
squall
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hepatic dysfunction' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1) - (SELECT COUNT(D...
eicu
CREATE TABLE table_name_96 ( record VARCHAR, score VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Score of 6 4, and a Opponent of @ marlins had what record?
SELECT record FROM table_name_96 WHERE score = "6–4" AND opponent = "@ marlins"
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 (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'mpv'...
eicu
CREATE TABLE checking ( balance VARCHAR, custid VARCHAR ) CREATE TABLE savings ( balance VARCHAR, custid VARCHAR ) CREATE TABLE accounts ( custid VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the checking balance and sav...
SELECT T2.balance, T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T1.name = 'Brown'
sql_create_context
CREATE TABLE table_name_20 ( winners_club VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Winners club has a Week of 4.5?
SELECT winners_club FROM table_name_20 WHERE week = 4.5
sql_create_context
CREATE TABLE table_11762 ( "Name" text, "Location" text, "Elevation + Height" text, "Delivery" text, "Purpose" text, "Yield" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Purpose has a Location of enewetak, runit (yvonne) and the Name of ...
SELECT "Purpose" FROM table_11762 WHERE "Location" = 'enewetak, runit (yvonne)' AND "Name" = 'cactus'
wikisql
CREATE TABLE table_name_35 ( wins INTEGER, rank VARCHAR, top_fives VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of wins for casey mears when the player ranked 22nd and was in teh top fives 3 times?
SELECT SUM(wins) FROM table_name_35 WHERE rank = "22nd" AND top_fives = 3
sql_create_context
CREATE TABLE table_name_82 ( goals_against VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many goals against have 58 points?
SELECT goals_against FROM table_name_82 WHERE points = 58
sql_create_context
CREATE TABLE table_24865763_2 ( lmp2_winning_team VARCHAR, gt1_winning_team VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many winning teams are there on LMP2 if Gabriele Gardel Patrice Goueslard Fernando Rees was the GT1 Winning Te...
SELECT COUNT(lmp2_winning_team) FROM table_24865763_2 WHERE gt1_winning_team = "Gabriele Gardel Patrice Goueslard Fernando Rees" AND circuit = "Algarve"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patientheal...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-13510')) AND intakeoutput.cellpath LIKE '%output%' AND D...
eicu
CREATE TABLE table_24222929_3 ( original_airdate VARCHAR, live VARCHAR, sd_total_viewers VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the episode that had 3.69 million total viewers (Live and SD types combined) first air?
SELECT original_airdate FROM table_24222929_3 WHERE live + sd_total_viewers = "3.69 million"
sql_create_context
CREATE TABLE table_name_90 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the match with west bromwich albion as the home team?
SELECT date FROM table_name_90 WHERE home_team = "west bromwich albion"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_name_46 ( drawn INTEGER, lost VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Drawn has a Lost of 2, and Played smaller than 14?
SELECT SUM(drawn) FROM table_name_46 WHERE lost = 2 AND played < 14
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'procedure-one vessel')) GROUP BY cost.hadm_id) AS t1
mimic_iii
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 chartevents.valuenum 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 = 19144 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.ite...
mimic_iii
CREATE TABLE table_name_38 ( rank VARCHAR, nationality VARCHAR, heat VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Serbia has a heat less than 2 and what sum of rank?
SELECT COUNT(rank) FROM table_name_38 WHERE nationality = "serbia" AND heat < 2
sql_create_context
CREATE TABLE table_name_4 ( number_of_districts__kecamatan_ INTEGER, villages VARCHAR, geographical_unit VARCHAR, number_of_regencies__kabupaten_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the number of districts (kecamatan) in...
SELECT SUM(number_of_districts__kecamatan_) FROM table_name_4 WHERE geographical_unit = "java" AND number_of_regencies__kabupaten_ > 4 AND villages < 8 OFFSET 577
sql_create_context
CREATE TABLE table_24193 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Original air date" FROM table_24193 WHERE "Production code" = '4301085'
wikisql
CREATE TABLE table_4178 ( "Position" real, "Top MC" text, "Year inducted" real, "Appearances" real, "Peak ranking" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all the MCs with peak ranking of 6 who were inducted in 2007.
SELECT "Top MC" FROM table_4178 WHERE "Year inducted" = '2007' AND "Peak ranking" = '6'
wikisql
CREATE TABLE table_name_21 ( grid INTEGER, time_retired VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the low grid total for a retired due to steering in under 15 laps?
SELECT MIN(grid) FROM table_name_21 WHERE time_retired = "steering" AND laps < 15
sql_create_context
CREATE TABLE table_69590 ( "Model" text, "Graded Hammer (Non GH3)" text, "Graded Hammer Three (GH3)" text, "Natural Wood Keyboard" text, "Synthetic Ivory Keytops" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Graded Hammer (Non GH3) has a Mod...
SELECT "Graded Hammer (Non GH3)" FROM table_69590 WHERE "Model" = 'cvp501'
wikisql
CREATE TABLE table_76716 ( "Week" text, "Theme" text, "Artist" text, "Order sung" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What artist's song was performed in the week with theme of Billboard #1?
SELECT "Artist" FROM table_76716 WHERE "Theme" = 'billboard #1'
wikisql
CREATE TABLE table_name_97 ( other_mozilla VARCHAR, opera VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of users were using other Mozilla browsers during the period in which 2.29% were using Opera?
SELECT other_mozilla FROM table_name_97 WHERE opera = "2.29%"
sql_create_context
CREATE TABLE table_29361707_2 ( circuit VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Valmir Benavides won pole position at which circuit?
SELECT circuit FROM table_29361707_2 WHERE pole_position = "Valmir Benavides"
sql_create_context
CREATE TABLE table_19386 ( "Region" text, "Capital" text, "Area (km\u00b2)" real, "Area (sq mi)" real, "Population" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the capital of Umbria?
SELECT "Capital" FROM table_19386 WHERE "Region" = 'Umbria'
wikisql
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 * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '54799454565') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '54799454565') AND jyjgzbb.JCZBJGDL <= (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '54799454565')
css
CREATE TABLE table_23221 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real, "Left" text, "Current Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's t...
SELECT "Nickname" FROM table_23221 WHERE "Joined" = '2010'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean...
SELECT CONCAT(YEAR(CreationDate), '-', MONTH(CreationDate)) AS "Month", COUNT(PostId) AS "Posts", SUM(CASE VoteTypeId WHEN 2 THEN 1 ELSE 0 END) AS "Upvotes", SUM(CASE VoteTypeId WHEN 3 THEN 1 ELSE 0 END) AS "Downvotes" FROM Votes GROUP BY YEAR(CreationDate), MONTH(CreationDate) ORDER BY YEAR(CreationDate), MONTH(Creati...
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 t_kc22.SOC_SRT_DIRE_NM, t_kc22.EACH_DOSAGE, t_kc22.USE_FRE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '52155951049'
css
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Road, ACC_Percent FROM basketball_match ORDER BY All_Road
nvbench
CREATE TABLE table_203_14 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the date of the first international goal ?
SELECT "date" FROM table_203_14 ORDER BY id LIMIT 1
squall
CREATE TABLE table_26727 ( "Country or region" text, "Highest point" text, "Maximum elevation" text, "Lowest point" text, "Minimum elevation" text, "Elevation span" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what country is mont sokbaro a...
SELECT "Country or region" FROM table_26727 WHERE "Highest point" = 'Mont Sokbaro'
wikisql
CREATE TABLE table_name_98 ( catalog VARCHAR, region VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the catalog with the region of the United States?
SELECT catalog FROM table_name_98 WHERE region = "united states"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, ...
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 CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DEN...
atis
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.drug = "Heparin Flush PICC (100 units/ml)"
mimicsql_data
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW te...
SELECT mzjzjlb.MZZYZDZZBM, mzjzjlb.MZZYZDZZMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '35311934275'
css
CREATE TABLE table_name_21 ( liberal_ticket VARCHAR, free_libertarian_ticket VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The Liberal Ticket listed which candidate when Jack A. Martin was listed on the Free Libertarian Ticket?
SELECT liberal_ticket FROM table_name_21 WHERE free_libertarian_ticket = "jack a. martin"
sql_create_context
CREATE TABLE table_31567 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was there an attendance of 51,342?
SELECT "Date" FROM table_31567 WHERE "Attendance" = '51,342'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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 ...
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hematocrit') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22648) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CUR...
mimic_iii
CREATE TABLE table_44698 ( "Name" text, "Location" text, "Format" text, "Record Label" text, "Release Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release date when the location is Europe?
SELECT "Release Date" FROM table_44698 WHERE "Location" = 'europe'
wikisql
CREATE TABLE table_204_553 ( id number, "outcome" text, "no." number, "date" text, "tournament" text, "surface" text, "partner" text, "opponents in the final" text, "score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT "tournament" FROM table_204_553 WHERE "tournament" IN ('oldsmar', 'los angeles') GROUP BY "tournament" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_52020 ( "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. -- Where did Melbourne play as the away team?
SELECT "Venue" FROM table_52020 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE table_69098 ( "Outcome" text, "Date" text, "Surface" text, "Partnering" text, "Opponents in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome on May 18, 2008?
SELECT "Outcome" FROM table_69098 WHERE "Date" = 'may 18, 2008'
wikisql
CREATE TABLE table_16067 ( "Round" real, "Choice" real, "Overall" real, "Player name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round was Steve Stonebreaker drafted?
SELECT MAX("Round") FROM table_16067 WHERE "Player name" = 'Steve Stonebreaker'
wikisql
CREATE TABLE table_204_761 ( 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 countries received more bronze medals than sweden ?
SELECT COUNT("nation") FROM table_204_761 WHERE "bronze" > (SELECT "bronze" FROM table_204_761 WHERE "nation" = 'sweden')
squall
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, ...
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 = '8433751' AND NOT zyjzjlb.CYKSMC LIKE '%角膜%'
css
CREATE TABLE table_203_473 ( id number, "no." number, "date" text, "tournament" text, "winning score" text, "margin\nof victory" text, "runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of times that scott simps...
SELECT COUNT(*) FROM table_203_473 WHERE "runner(s)-up" = 'scott simpson'
squall
CREATE TABLE table_name_9 ( time___gmt__ VARCHAR, serial VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time (GMT) for the 12A Serial?
SELECT time___gmt__ FROM table_name_9 WHERE serial = "12a"
sql_create_context
CREATE TABLE table_name_84 ( date VARCHAR, partner VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date did Lori McNeil play as a partner with a score of 6 7(6), 5 7?
SELECT date FROM table_name_84 WHERE partner = "lori mcneil" AND score = "6–7(6), 5–7"
sql_create_context
CREATE TABLE table_54054 ( "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. -- How many points did the away team of st kilda sc...
SELECT "Away team score" FROM table_54054 WHERE "Away team" = 'st kilda'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationD...
SELECT p.Id, p2.Id, p2.ParentId, p.Id AS "post_link", p.Score, p.ViewCount, p.CreationDate FROM Posts AS p INNER JOIN Posts AS p2 ON p2.ParentId = p.Id WHERE p.OwnerUserId = @UserId AND p2.OwnerUserId = @UserId
sede
CREATE TABLE table_20654 ( "Name of county" text, "County seat" text, "Area (km\u00b2)" real, "Population" real, "Population density" real, "Towns/ villages" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least area for vas
SELECT MIN("Area (km\u00b2)") FROM table_20654 WHERE "Name of county" = 'Vas'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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 ...
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '喻奇文' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '氯雷他定片')
css
CREATE TABLE table_12750 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text, "Winner's share ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Runner(s)...
SELECT "Date" FROM table_12750 WHERE "Runner(s)-up" = 'bo-mee lee'
wikisql
CREATE TABLE table_16460 ( "No. in season" real, "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the origi...
SELECT "Original air date" FROM table_16460 WHERE "Title" = 'Winds of War'
wikisql
CREATE TABLE table_17356106_1 ( original_air_date VARCHAR, series__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For series number 256, what was the original air date?
SELECT original_air_date FROM table_17356106_1 WHERE series__number = 256
sql_create_context
CREATE TABLE table_29476 ( "Team" text, "Outgoing head coach" text, "Manner of departure" text, "Date of vacancy" text, "Position in table" real, "Incoming head coach" text, "Date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT COUNT("Team") FROM table_29476 WHERE "Incoming head coach" = 'Abdollah Veysi'
wikisql
CREATE TABLE table_38105 ( "Orbital regime" text, "Launches" real, "Successes" real, "Failures" real, "Accidentally Achieved" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of medium earth orbital regime, accidentally achieved and ...
SELECT SUM("Accidentally Achieved") FROM table_38105 WHERE "Orbital regime" = 'medium earth' AND "Successes" > '3'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT FIRST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE table_2186 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lowest division number of the 6th, Great Lakes season?
SELECT MIN("Division") FROM table_2186 WHERE "Regular Season" = '6th, Great Lakes'
wikisql
CREATE TABLE table_15211468_1 ( episode_title VARCHAR, episode_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the episode title for the episode numbered #1.4?
SELECT episode_title FROM table_15211468_1 WHERE episode_no = "#1.4"
sql_create_context
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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT T1.SALARY, T1.MANAGER_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID
nvbench
CREATE TABLE table_name_36 ( race_name VARCHAR, sanctioning VARCHAR, city_location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the name of the race that occurred in Brooklyn, Michigan with a sanctioning of cart?
SELECT race_name FROM table_name_36 WHERE sanctioning = "cart" AND city_location = "brooklyn, michigan"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, ...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3125 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'isotonic sodium chloride' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE table_name_92 ( player VARCHAR, place VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE PLAYER WITH T7 PLACE, FOR ENGLAND?
SELECT player FROM table_name_92 WHERE place = "t7" AND country = "england"
sql_create_context
CREATE TABLE table_46345 ( "City" text, "Mongolian" text, "Mongolian script" text, "Province" text, "Population (2008)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city has the mongolian script of ?
SELECT "City" FROM table_46345 WHERE "Mongolian script" = 'ᠡᠷᠳᠡᠨᠢᠲᠦ'
wikisql
CREATE TABLE table_80270 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give the earliest year that featured Pi Hongyan on...
SELECT MIN("Year") FROM table_80270 WHERE "Women's singles" = 'pi hongyan'
wikisql
CREATE TABLE table_name_13 ( to_par INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average to par for lee trevino?
SELECT AVG(to_par) FROM table_name_13 WHERE player = "lee trevino"
sql_create_context
CREATE TABLE table_name_71 ( points INTEGER, wins VARCHAR, class VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest points value for the 500cc class in years after 1962 with 0 wins?
SELECT MAX(points) FROM table_name_71 WHERE class = "500cc" AND year > 1962 AND wins < 0
sql_create_context
CREATE TABLE table_28046929_2 ( car VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the type of vehicle driven by mark higgins
SELECT car FROM table_28046929_2 WHERE driver = "Mark Higgins"
sql_create_context
CREATE TABLE table_17688 ( "Quattroporte IV" text, "Units Produced" real, "Production Period" text, "Engine Capacity" text, "Power" text, "Max Speed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the power of the 3.2i v8 32v?
SELECT "Power" FROM table_17688 WHERE "Quattroporte IV" = '3.2i V8 32v'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT demographic.days_stay, prescriptions.drug_type FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "52012"
mimicsql_data
CREATE TABLE table_name_85 ( score VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Dave Hill's score?
SELECT score FROM table_name_85 WHERE player = "dave hill"
sql_create_context
CREATE TABLE table_57238 ( "Round" real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pole position of the...
SELECT "Pole Position" FROM table_57238 WHERE "Grand Prix" = 'portuguese grand prix'
wikisql
CREATE TABLE table_33093 ( "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. -- What was the smallest crowd for a game where the...
SELECT MIN("Crowd") FROM table_33093 WHERE "Home team score" = '11.18 (84)'
wikisql
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1374154' AND gwyjzb.IN_HOSP_DATE BETWEEN '2001-04-01' AND '2006-04-03' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1374154' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2001-04-01' AND '2006-04-03'
css
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '谢雅云' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 1942.72)
css
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
SELECT MAX(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 medication.patientunitstayid FROM medication WHERE medication.drugname = 'piperacillin sod-tazobactam so 3-0.375 g iv so...
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 demographic.diagnosis FROM demographic WHERE demographic.name = "Paul Edwards"
mimicsql_data
CREATE TABLE table_66496 ( "Position" text, "Country" text, "Floor" real, "Pommel Horse" real, "Rings" real, "Vault" real, "Parallel Bars" real, "Horizontal Bar" real, "Team Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name ...
SELECT MAX("Parallel Bars") FROM table_66496 WHERE "Country" = 'united states' AND "Vault" < '63.85'
wikisql