instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_61166 ( "Distance" text, "Event" text, "Time" text, "Meet" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Meet has a Time of 1:04.84?
SELECT "Meet" FROM table_61166 WHERE "Time" = '1:04.84'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '赵星波' AND jybg...
css
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.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'angio...
eicu
CREATE TABLE table_name_97 ( office VARCHAR, greenback_ticket VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which office was Richard M. Griffin vying for on the Greenback ticket?
SELECT office FROM table_name_97 WHERE greenback_ticket = "richard m. griffin"
sql_create_context
CREATE TABLE airport ( id number, city text, country text, iata text, icao text, name text ) CREATE TABLE flight ( id number, vehicle_flight_number text, date text, pilot text, velocity number, altitude number, airport_id number, company_id number ) CREATE TABLE...
SELECT T1.name, T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id
spider
CREATE TABLE table_train_21 ( "id" int, "pregnancy_or_lactation" bool, "severe_sepsis" bool, "systolic_blood_pressure_sbp" int, "active_infection" bool, "limited_care" bool, "septic_shock" bool, "coagulopathy" bool, "age" float, "lactate" int, "NOUSE" float ) -- Using valid...
SELECT * FROM table_train_21 WHERE age > 18 AND (severe_sepsis = 1 OR septic_shock = 1)
criteria2sql
CREATE TABLE table_51569 ( "Season" text, "Champion" text, "Team" text, "Chassis" text, "Engine" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the winning car's chassis for the 1982 season?
SELECT "Chassis" FROM table_51569 WHERE "Season" = '1982'
wikisql
CREATE TABLE table_9131 ( "Tournament" text, "Surface" text, "Week" text, "Winner" text, "Finalist" text, "Semifinalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the tournament where monica seles was the finalist who played on a...
SELECT "Tournament" FROM table_9131 WHERE "Surface" = 'hard' AND "Finalist" = 'monica seles'
wikisql
CREATE TABLE table_name_75 ( goals_against VARCHAR, minutes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the goals against for the goalkeeper with 2520 minutes?
SELECT goals_against FROM table_name_75 WHERE minutes = 2520
sql_create_context
CREATE TABLE table_66161 ( "Pick" real, "Player" text, "Team" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is John Curtice's position?
SELECT "Position" FROM table_66161 WHERE "Player" = 'john curtice'
wikisql
CREATE TABLE table_35758 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 9:00 has entertainment tonight as 7:00?
SELECT "9:00" FROM table_35758 WHERE "7:00" = 'entertainment tonight'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, De...
SELECT DISTINCT A.Id, A.CreationDate, C.Reputation FROM Posts AS A INNER JOIN PostTypes AS B ON A.PostTypeId = B.Id INNER JOIN Users AS C ON A.OwnerUserId = C.Id INNER JOIN PostTags AS D ON A.Id = D.PostId INNER JOIN Tags AS E ON D.TagId = E.Id WHERE A.CreationDate > DATEADD(week, DATEDIFF(week, 0, GETDATE()) - 1, -1) ...
sede
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.label = "Lactate Dehydrogenase (LD)"
mimicsql_data
CREATE TABLE table_204_465 ( id number, "#" number, "temple name" text, "hangul" text, "hanja" text, "period of reign" text, "personal name" text, "relationship" text, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who reigned...
SELECT "temple name" FROM table_204_465 WHERE "temple name" IN ('geunchogo', 'chaekgye') ORDER BY "period of reign" - "period of reign" DESC LIMIT 1
squall
CREATE TABLE table_name_88 ( venue VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue has a Home team of south melbourne?
SELECT venue FROM table_name_88 WHERE home_team = "south melbourne"
sql_create_context
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_57961 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalogue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What format is catalogue WPCR13504 in?
SELECT "Format" FROM table_57961 WHERE "Catalogue" = 'wpcr13504'
wikisql
CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the ...
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name
nvbench
CREATE TABLE table_name_76 ( year INTEGER, departed_from VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- From how many years did tampa, FL depart?
SELECT SUM(year) FROM table_name_76 WHERE departed_from = "tampa, fl"
sql_create_context
CREATE TABLE people ( people_id number, name text, age number, height number, hometown text ) CREATE TABLE gymnast ( gymnast_id number, floor_exercise_points number, pommel_horse_points number, rings_points number, vault_points number, parallel_bars_points number, horizo...
SELECT T2.name FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id ORDER BY T2.height
spider
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2148.0" AND diagnoses.icd9_code = "3970"
mimicsql_data
CREATE TABLE table_name_2 ( score VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many scores have a Place of t5?
SELECT COUNT(score) FROM table_name_2 WHERE place = "t5"
sql_create_context
CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
SELECT wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '54994299' UNION SELECT bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz...
css
CREATE TABLE region ( region_code VARCHAR, region_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all region code and region name sorted by the codes.
SELECT region_code, region_name FROM region ORDER BY region_code
sql_create_context
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE cours...
SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%'
advising
CREATE TABLE table_75349 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of field goals when the ...
SELECT MIN("Field goals") FROM table_75349 WHERE "Points" < '5'
wikisql
CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE region ( Region_ID int, Region_name tex...
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE table_76514 ( "Verb" text, "2 (VF)" text, "2 (F)" text, "3 (F)" text, "2/3 (P)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the verb for Khola?
SELECT "3 (F)" FROM table_76514 WHERE "Verb" = 'khola'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT (SELECT 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 = '007-10135' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE submission ( submission_id number, scores number, author text, college text ) CREATE TABLE workshop ( workshop_id number, date text, venue text, name text ) CREATE TABLE acceptance ( submission_id number, workshop_id number, result text ) -- Using valid SQLit...
SELECT author, college FROM submission
spider
CREATE TABLE table_name_55 ( city VARCHAR, home_arena VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city includes Barclays Center?
SELECT city FROM table_name_55 WHERE home_arena = "barclays center"
sql_create_context
CREATE TABLE table_name_95 ( rank INTEGER, province VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average rank of the province alborz, which had more than 14526 in 1956?
SELECT AVG(rank) FROM table_name_95 WHERE province = "alborz" AND 1956 > 14526
sql_create_context
CREATE TABLE table_214479_8 ( y_ VARCHAR, _2008 VARCHAR, expression VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the y = 2008 when the expression is easter day (julian calendar)?
SELECT y_ = _2008 FROM table_214479_8 WHERE expression = "Easter Day (Julian calendar)"
sql_create_context
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_ORG_DEPT_CD, OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '9593496' GROUP BY MED_ORG_DEPT_CD, OUT_DIAG_DIS_CD
css
CREATE TABLE ship ( name VARCHAR, built_year VARCHAR, CLASS VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all ship names in the order of built year and class.
SELECT name FROM ship ORDER BY built_year, CLASS
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral DESC
nvbench
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '90955811' AND t_kc22.STA_DATE BETWEEN '2001-02-02' AND '2007-03-01' AND t_kc22.SELF_PAY_AMO > 1737.24
css
CREATE TABLE table_63419 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the draw that's played less than 36...
SELECT AVG("Draw") FROM table_63419 WHERE "Points" = '42' AND "Played" < '36'
wikisql
CREATE TABLE table_name_70 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did the Mariners play when their record was 26 32?
SELECT opponent FROM table_name_70 WHERE record = "26–32"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id nu...
SELECT c.CreationDate, c.Id AS "comment_link", c.Text FROM Comments AS c INNER JOIN Posts AS p ON p.Id = c.PostId WHERE Text LIKE 'Welcome to%' AND DATEDIFF(day, p.LastActivityDate, GETDATE()) >= 14 ORDER BY c.CreationDate DESC
sede
CREATE TABLE table_75795 ( "Television service" text, "Country" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Package/Option, when Content is Poker?
SELECT "Package/Option" FROM table_75795 WHERE "Content" = 'poker'
wikisql
CREATE TABLE table_55949 ( "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. -- Which team plays at Lake Oval?
SELECT "Home team" FROM table_55949 WHERE "Venue" = 'lake oval'
wikisql
CREATE TABLE table_5228 ( "Season" text, "Tier" real, "League" text, "Pos." real, "Postseason" text, "European competitions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of tiers for the postseason of semifinalist?
SELECT SUM("Tier") FROM table_5228 WHERE "Postseason" = 'semifinalist'
wikisql
CREATE TABLE table_60481 ( "Edition" text, "Round" text, "Date" text, "Surface" text, "Opponent" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What clay surface edition had an opponent of miho saeki?
SELECT "Edition" FROM table_60481 WHERE "Surface" = 'clay' AND "Opponent" = 'miho saeki'
wikisql
CREATE TABLE table_26316 ( "Rank" real, "Operators Name" text, "Technology" text, "Subscribers (in millions)" text, "Ownership" text, "Market Share" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the rank of operator whose technology is...
SELECT MIN("Rank") FROM table_26316 WHERE "Technology" = 'CDMA EVDO'
wikisql
CREATE TABLE table_9630 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance for the week 1 game?
SELECT "Attendance" FROM table_9630 WHERE "Week" = '1'
wikisql
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 microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE table_26507 ( "Team" text, "Location" text, "Stadium" text, "Capacity" real, "Manager" text, "Captain" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the captain in Chaguaramas?
SELECT "Captain" FROM table_26507 WHERE "Location" = 'Chaguaramas'
wikisql
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 COUNT(DISTINCT IN_DIAG_DIS_CD) FROM t_kc21 WHERE PERSON_ID = '63660143' AND IN_HOSP_DATE BETWEEN '2007-07-21' AND '2010-12-24'
css
CREATE TABLE table_32096 ( "2nd component" text, "b.p. 2nd comp. (\u02daC)" real, "3rd component" text, "b.p. 3rd comp. (\u02daC)" text, "b.p. azeo. (\u02daC)" text, "% wt 1st" text, "% wt 2nd" text, "% wt 3rd" text ) -- Using valid SQLite, answer the following questions for the tables...
SELECT "3rd component" FROM table_32096 WHERE "b.p. azeo. (\u02daC)" = '62.1'
wikisql
CREATE TABLE table_51578 ( "Club" text, "Leagues" text, "Venue" text, "Location" text, "Capacity" real, "Established" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the capacity at the nop aquatic centre, established after 1929?
SELECT COUNT("Capacity") FROM table_51578 WHERE "Venue" = 'nop aquatic centre' AND "Established" > '1929'
wikisql
CREATE TABLE table_49641 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real, "2000 result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many votes went to other candidates in t...
SELECT MIN("Others#") FROM table_49641 WHERE "Others%" = '1.9%' AND "Bush#" < '160,390'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE date_day ...
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 25 AND date_day.month_number = 6...
atis
CREATE TABLE table_56136 ( "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. -- Which Away team score has a Home team of richmon...
SELECT "Away team score" FROM table_56136 WHERE "Home team" = 'richmond'
wikisql
CREATE TABLE table_name_73 ( date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has an Attendance of 9,535?
SELECT date FROM table_name_73 WHERE attendance = "9,535"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-05' ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_7956 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Bronze with a Silver greater than 0 and a Gold of 7 and a total less than 29
SELECT MAX("Bronze") FROM table_7956 WHERE "Silver" > '0' AND "Gold" = '7' AND "Total" < '29'
wikisql
CREATE TABLE table_52524 ( "Munsee Delaware" text, "Unami Delaware" text, "De Laet (1633)" text, "Campanius (ca. 1645)" text, "Interpreter (1684?)" text, "Thomas (1698)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Unami Delaware v...
SELECT "Unami Delaware" FROM table_52524 WHERE "Thomas (1698)" = 'nacha'
wikisql
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilege...
SELECT COUNT(*) AS Count, SUM(q.ViewCount) AS Views FROM Posts AS a JOIN Posts AS q ON q.Id = a.ParentId WHERE a.OwnerUserId = '##userId##' AND a.PostTypeId = 2 AND q.PostTypeId = 1 AND a.CreationDate >= '##year##0101' AND a.CreationDate <= '##year##1231'
sede
CREATE TABLE table_8670 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which score was associated with an attendance of 275?
SELECT "Score" FROM table_8670 WHERE "Attendance" = '275'
wikisql
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.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE table_73073 ( "Date" text, "B-52 Model" text, "Serial #" text, "Unit" text, "Bomb Capacity" text, "Mission/Target" text, "Cause of Loss" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 7th bw attached to 43rd sw is the unit ...
SELECT "B-52 Model" FROM table_73073 WHERE "Unit" = '7th BW attached to 43rd SW'
wikisql
CREATE TABLE table_name_22 ( set_3 VARCHAR, time VARCHAR, set_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Set 3 has a Time of 10:00, and a Set 2 of 25 19?
SELECT set_3 FROM table_name_22 WHERE time = "10:00" AND set_2 = "25–19"
sql_create_context
CREATE TABLE table_56499 ( "Wind farm" text, "Capacity (MW)" real, "Country" text, "State/Province" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which state is Tehachapi Pass Wind Farm located in?
SELECT "State/Province" FROM table_56499 WHERE "Wind farm" = 'tehachapi pass wind farm'
wikisql
CREATE TABLE table_name_67 ( attendance VARCHAR, result VARCHAR, year VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total attendance at anaheim stadium after 1983 when the result is 14-28?
SELECT COUNT(attendance) FROM table_name_67 WHERE year > 1983 AND venue = "anaheim stadium" AND result = "14-28"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
mimicsql_data
CREATE TABLE table_name_25 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the essendon score when they were at home?
SELECT home_team AS score FROM table_name_25 WHERE home_team = "essendon"
sql_create_context
CREATE TABLE procedures ( 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 WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "34"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) 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...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZ...
css
CREATE TABLE table_3051 ( "Seed" real, "Rank" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest points won when ...
SELECT MAX("Points won") FROM table_3051 WHERE "Player" = 'Aravane Rezaï'
wikisql
CREATE TABLE table_72389 ( "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 is the earliest first elected for district georgia 1?
SELECT MIN("First elected") FROM table_72389 WHERE "District" = 'Georgia 1'
wikisql
CREATE TABLE table_60986 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game that had 77,702 people in attendance?
SELECT "Result" FROM table_60986 WHERE "Attendance" = '77,702'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "58" AND prescriptions.route = "NEB"
mimicsql_data
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, r...
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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_...
atis
CREATE TABLE table_name_42 ( final INTEGER, all_around VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average final with an all around greater than 19.35 and a total over 40?
SELECT AVG(final) FROM table_name_42 WHERE all_around > 19.35 AND total > 40
sql_create_context
CREATE TABLE table_26725 ( "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. -- What are the highest point in lat...
SELECT "Highest point" FROM table_26725 WHERE "Country or region" = 'Latvia'
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 demographic.insurance FROM demographic WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE table_name_85 ( competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition took place on 10 August 2011?
SELECT competition FROM table_name_85 WHERE date = "10 august 2011"
sql_create_context
CREATE TABLE table_46831 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Rockets score" real, "Opponents" real, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Rockets score of 94, and...
SELECT "Date" FROM table_46831 WHERE "Rockets score" = '94' AND "Game" = '66'
wikisql
CREATE TABLE table_14977252_2 ( draw INTEGER, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least draw for elena dermidjean
SELECT MIN(draw) FROM table_14977252_2 WHERE artist = "Elena Dermidjean"
sql_create_context
CREATE TABLE table_18646111_13 ( round_1 VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the round 1 for team event
SELECT round_1 FROM table_18646111_13 WHERE event = "Team"
sql_create_context
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 = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_name_85 ( points INTEGER, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the total Pints after 1957?
SELECT SUM(points) FROM table_name_85 WHERE year > 1957
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_58268 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the series score of the game with Vancouver as the visiting team on April 16?
SELECT "Series" FROM table_58268 WHERE "Visitor" = 'vancouver' AND "Date" = 'april 16'
wikisql
CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district text, nces_id text, yr_data number, t_fed_rev number, c14 number, c25 number ) CREATE TABLE finrev_fed_key_17 ( state_code number, state text, #_records text ) CREATE TABLE ndecoreexcel_math_gr...
SELECT state FROM ndecoreexcel_math_grade8 ORDER BY average_scale_score DESC LIMIT 1
studentmathscore
CREATE TABLE table_73274 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Area" real, "Population" real, "Density" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Pinyin for the simplified ?
SELECT "Pinyin" FROM table_73274 WHERE "Simplified" = '虞城县'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT EMPLOYEE_ID, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_31526 ( "Economy" text, "1980" real, "Gap from Thailand as of 1980 (times)" text, "1985" real, "1990" real, "1995" real, "2000" real, "2005" real, "2010" real, "2012" real, "Gap from Thailand as of 2012 (times)" text, "GDP as of 2012 after purchasing po...
SELECT COUNT("GDP as of 2012 after purchasing power parity (PPP) calculations (USD billions)") FROM table_31526 WHERE "2012" = '23113'
wikisql
CREATE TABLE table_70502 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Chassis that has the Year of 1977?
SELECT "Chassis" FROM table_70502 WHERE "Year" = '1977'
wikisql
CREATE TABLE table_1342379_41 ( result VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was the election joseph w. byrns, sr. (d) unopposed?
SELECT COUNT(result) FROM table_1342379_41 WHERE candidates = "Joseph W. Byrns, Sr. (D) Unopposed"
sql_create_context
CREATE TABLE table_51291 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine \u2020" text, "Tyre" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the constructor of driver Alexander Wurz?
SELECT "Constructor" FROM table_51291 WHERE "Driver" = 'alexander wurz'
wikisql
CREATE TABLE table_62167 ( "Party" text, "Name in English" text, "City" text, "Province" text, "Date of registration" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the Canarian Workers Socialist Union registered?
SELECT "Date of registration" FROM table_62167 WHERE "Name in English" = 'canarian workers socialist union'
wikisql
CREATE TABLE table_name_46 ( country VARCHAR, ief_2011 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has an IEF 2011 of 45.3?
SELECT country FROM table_name_46 WHERE ief_2011 = "45.3"
sql_create_context
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE table_3339 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total nu...
SELECT COUNT("Population (2011)") FROM table_3339 WHERE "Settlement" = 'Perlez'
wikisql
CREATE TABLE table_name_69 ( year__ceremony_ VARCHAR, original_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Zona Sur nominated?
SELECT year__ceremony_ FROM table_name_69 WHERE original_title = "zona sur"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Major depressive affective disorder, recurrent episode, severe, specified as with psychotic behavior"
mimicsql_data
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 COUNT(DISTINCT IN_DIAG_DIS_CD) FROM t_kc21 WHERE PERSON_ID = '66184630' AND IN_HOSP_DATE BETWEEN '2008-11-08' AND '2014-05-15'
css
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE time_inte...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_...
atis