instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT PostId AS "post_link", Text, Score, CreationDate FROM Comments WHERE UserId = @UserId ORDER BY CreationDate
sede
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 patient ( uniquep...
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
CREATE TABLE table_8112 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the pick for alfred morris when the overall is less than 217, and the round is sm...
SELECT MAX("Pick") FROM table_8112 WHERE "Overall" < '217' AND "Name" = 'alfred morris' AND "Round" < '6'
wikisql
CREATE TABLE table_24689168_5 ( rating__18_49_ VARCHAR, viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 18 to 49 rating when 9.50 million watched?
SELECT rating__18_49_ FROM table_24689168_5 WHERE viewers__millions_ = "9.50"
sql_create_context
CREATE TABLE table_name_1 ( laps INTEGER, drivers VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the highest laps for glenn seton gregg hansford?
SELECT MAX(laps) FROM table_name_1 WHERE drivers = "glenn seton gregg hansford"
sql_create_context
CREATE TABLE airports ( name VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of the airports located in Cuba or Argentina.
SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '苗英光' AND gwyjzb.IN_HOSP_DATE BETWEEN '2006-11-01' AND '2016-12-31' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_...
css
CREATE TABLE table_204_898 ( id number, "seed" text, "school" text, "conf (overall)" text, "tiebreaker" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which school had the least wins in the conference ?
SELECT "school" FROM table_204_898 ORDER BY "conf (overall)" LIMIT 1
squall
CREATE TABLE table_46909 ( "Original NER class" text, "1914 NER class" text, "LNER Class" text, "Cylinders" text, "Driving wheels" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the LNER class with an m 1914 NER class?
SELECT "LNER Class" FROM table_46909 WHERE "1914 NER class" = 'm'
wikisql
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 ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "MESENTERIC ISCHEMIA"
mimicsql_data
CREATE TABLE table_26614365_1 ( spanish VARCHAR, central VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Spanish word for cas [ kas]?
SELECT spanish FROM table_26614365_1 WHERE central = "cas [ˈkas]"
sql_create_context
CREATE TABLE table_74263 ( "Player" text, "Cap(s)" real, "Goal(s)" real, "International Debut" text, "Club(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many caps figures are there for Norwich City, Coventry City?
SELECT COUNT("Cap(s)") FROM table_74263 WHERE "Club(s)" = 'Norwich City, Coventry City'
wikisql
CREATE TABLE table_name_16 ( decile INTEGER, authority VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Decile with a state authority and a Name of mapiu school?
SELECT AVG(decile) FROM table_name_16 WHERE authority = "state" AND name = "mapiu school"
sql_create_context
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 ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) -- Using valid SQLite, answer the following questions for the ...
SELECT Name, COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Editor_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean...
SELECT q.Id AS "post_link", MAX(a.Score) AS "best_answer_score" FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND q.AnswerCount > 0 AND q.AcceptedAnswerId IS NULL AND a.PostTypeId = 2 AND q.Tags LIKE 'c++' GROUP BY q.Id HAVING MAX(a.Score) = 0
sede
CREATE TABLE table_48885 ( "Team" text, "Make" text, "Drivers" text, "Tyre" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When driver yuji tachikawa had a make of lexus, what team did he represent?
SELECT "Team" FROM table_48885 WHERE "Make" = 'lexus' AND "Drivers" = 'yuji tachikawa'
wikisql
CREATE TABLE table_name_32 ( nat VARCHAR, type VARCHAR, transfer_fee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type of loan and the transfer fee loan?
SELECT nat FROM table_name_32 WHERE type = "loan" AND transfer_fee = "loan"
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE T...
SELECT COUNT(DISTINCT p.Id) AS "Posts Edited" FROM PostHistory AS h, Posts AS p WHERE h.UserId = @UserId AND p.Id = h.PostId AND p.OwnerUserId != @UserId AND h.PostHistoryTypeId IN (4, 5, 24)
sede
CREATE TABLE table_1725413_5 ( open_era VARCHAR, first_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many open era titles does the team with their first title in 1925 have?
SELECT open_era FROM table_1725413_5 WHERE first_title = 1925
sql_create_context
CREATE TABLE table_dev_46 ( "id" int, "ogtt" int, "systolic_blood_pressure_sbp" int, "neuromuscular_disease" bool, "renal_disease" bool, "hepatic_disease" bool, "active_oncologic_disease" bool, "hematologic_disease" bool, "diastolic_blood_pressure_dbp" int, "muscular_disease" boo...
SELECT * FROM table_dev_46 WHERE hypertension = 1
criteria2sql
CREATE TABLE table_36327 ( "Name" text, "Faith" text, "Type" text, "Opened" real, "Intake" real, "DCSF number" real, "Ofsted number" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Faith of , and a Name of greenway has what type?
SELECT "Type" FROM table_36327 WHERE "Faith" = '–' AND "Name" = 'greenway'
wikisql
CREATE TABLE table_name_31 ( bluetooth VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Does the S90i model have bluetooth?
SELECT bluetooth FROM table_name_31 WHERE model = "s90i"
sql_create_context
CREATE TABLE table_74503 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the total number of events for tournament of masters tou...
SELECT COUNT("Events") FROM table_74503 WHERE "Tournament" = 'masters tournament' AND "Top-25" < '6'
wikisql
CREATE TABLE table_name_84 ( round VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round did the player from delta st. get picked?
SELECT round FROM table_name_84 WHERE school_club_team = "delta st."
sql_create_context
CREATE TABLE table_21916 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times did the Denver Broncos face the Dallas Texans th...
SELECT COUNT("Record") FROM table_21916 WHERE "Opponent" = 'Dallas Texans'
wikisql
CREATE TABLE table_36125 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHo is the Visitor on april 14?
SELECT "Visitor" FROM table_36125 WHERE "Date" = 'april 14'
wikisql
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.dod FROM demographic WHERE demographic.name = "Paul Edwards"
mimicsql_data
CREATE TABLE table_6678 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue hosted in 2005 and had a Notes of men individual 9.84km?
SELECT "Venue" FROM table_6678 WHERE "Year" = '2005' AND "Notes" = 'men individual 9.84km'
wikisql
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, ...
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 458
advising
CREATE TABLE table_11841 ( "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 largest crowd size at a South Melbo...
SELECT MAX("Crowd") FROM table_11841 WHERE "Home team" = 'south melbourne'
wikisql
CREATE TABLE table_name_32 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Opponent on November 27, 2005?
SELECT opponent FROM table_name_32 WHERE date = "november 27, 2005"
sql_create_context
CREATE TABLE table_name_56 ( attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Attendance, when Date is '26 December 2004'?
SELECT attendance FROM table_name_56 WHERE date = "26 december 2004"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, ...
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '16090485' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '056956')
css
CREATE TABLE wrestler ( wrestler_id number, name text, reign text, days_held text, location text, event text ) CREATE TABLE elimination ( elimination_id text, wrestler_id text, team text, eliminated_by text, elimination_move text, time text ) -- Using valid SQLite, ans...
SELECT DISTINCT reign FROM wrestler WHERE location <> "Tokyo , Japan"
spider
CREATE TABLE table_name_22 ( max_speed__km_h_ INTEGER, quantity_built VARCHAR, year_built VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the max speed of the unit with an 8+4 quantity built before 1971?
SELECT SUM(max_speed__km_h_) FROM table_name_22 WHERE quantity_built = "8+4" AND year_built < 1971
sql_create_context
CREATE TABLE table_43030 ( "Maximum Ceiling Temperature" text, "Temperature Rating" text, "Temperature Classification" text, "Color Code (with Fusible Link)" text, "Glass Bulb Color" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the tempera...
SELECT "Temperature Classification" FROM table_43030 WHERE "Glass Bulb Color" = 'purple'
wikisql
CREATE TABLE table_80038 ( "Country" text, "Film title used in nomination" text, "Language" text, "Original name" text, "Director" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the director Dariush Mehrjui from?
SELECT "Country" FROM table_80038 WHERE "Director" = 'dariush mehrjui'
wikisql
CREATE TABLE School ( School_id text, School_name text, Location text, Mascot text, Enrollment int, IHSAA_Class text, IHSAA_Football_Class text, County text ) CREATE TABLE budget ( School_id int, Year int, Budgeted int, total_budget_percent_budgeted real, Invested in...
SELECT County, SUM(Enrollment) FROM School GROUP BY County
nvbench
CREATE TABLE table_56794 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many grids are associated with a Time/Retired of +1.837?
SELECT COUNT("Grid") FROM table_56794 WHERE "Time/Retired" = '+1.837'
wikisql
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 ZYZYZDZZBM, ZYZYZDZZMC FROM zyjzjlb WHERE JZLSH = '67809800975'
css
CREATE TABLE table_40084 ( "Sport" text, "Record" text, "Athlete(s)" text, "Nation" text, "Date" text, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time of 12 December 2009 with record start?
SELECT "Time" FROM table_40084 WHERE "Record" = 'start' AND "Date" = '12 december 2009'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC
nvbench
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostTags ( PostId number, TagId numb...
SELECT OwnerUserId AS "user_link", COUNT(*) AS PostCount, SUM(Score) AS TotalScore FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = @UserId GROUP BY OwnerUserId
sede
CREATE TABLE table_14704 ( "Name" text, "Country" text, "Loan Club" text, "Started" text, "Ended" text, "Start Source" text, "End Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the loan that Ended on 15 January Start?
SELECT "Started" FROM table_14704 WHERE "Ended" = '15 january'
wikisql
CREATE TABLE table_1904 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the position where the ...
SELECT COUNT("Position") FROM table_1904 WHERE "Points" = '9'
wikisql
CREATE TABLE table_dev_51 ( "id" int, "gender" string, "antihypertensive_agents" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "obesity" bool, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "hypertension" bool, "prehypertension" bool, ...
SELECT * FROM table_dev_51 WHERE obesity = 1 OR hypertension = 1 OR (body_mass_index_bmi > 45 OR systolic_blood_pressure_sbp > 170 OR diastolic_blood_pressure_dbp > 110)
criteria2sql
CREATE TABLE table_name_60 ( code__iata_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2003 rank does the airport IATA code SIN have?
SELECT 2003 AS rank FROM table_name_60 WHERE code__iata_ = "sin"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, ...
SELECT COUNT(*) FROM course, course_offering, semester WHERE course_offering.start_time > '10:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EDUC' AND course.number = 649 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_name_74 ( event VARCHAR, round VARCHAR, method VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event went under 3 rounds and was no contest (punch after knockdown)?
SELECT event FROM table_name_74 WHERE round < 3 AND method = "no contest (punch after knockdown)"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, ...
SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'metoprolol tartrate' AND admissions.subject_id = 3918 AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIM...
mimic_iii
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_na...
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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE table_name_34 ( round INTEGER, position VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round is the lowest one that has a Position of wide receiver, and an Overall smaller than 222?
SELECT MIN(round) FROM table_name_34 WHERE position = "wide receiver" AND overall < 222
sql_create_context
CREATE TABLE table_38799 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the contstructor of the car having a grid of 20?
SELECT "Constructor" FROM table_38799 WHERE "Grid" = '20'
wikisql
CREATE TABLE table_name_49 ( quantity INTEGER, sht_nos VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many have SHT number 5?
SELECT MAX(quantity) FROM table_name_49 WHERE sht_nos = "5"
sql_create_context
CREATE TABLE table_name_16 ( gold INTEGER, silver VARCHAR, total VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lowest gold with a total of 4 and less than 2 silver for liechtenstein?
SELECT MIN(gold) FROM table_name_16 WHERE total = 4 AND nation = "liechtenstein" AND silver < 2
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
CREATE TABLE table_name_28 ( earnings__ VARCHAR, rank VARCHAR, player VARCHAR, country VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In total, how much did the United States player George Archer earn with Wins lower than 24 and a r...
SELECT COUNT(earnings__) AS $__ FROM table_name_28 WHERE country = "united states" AND wins < 24 AND player = "george archer" AND rank > 5
sql_create_context
CREATE TABLE table_63279 ( "Part Number" text, "Pins" text, "Body Width/mm" real, "Body Length/mm" real, "Lead Pitch/mm" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Lead Pitch/mm has a Part Number of tsop24/28?
SELECT MAX("Lead Pitch/mm") FROM table_63279 WHERE "Part Number" = 'tsop24/28'
wikisql
CREATE TABLE table_77068 ( "Week" real, "Date" text, "Opponent" text, "Venue" text, "Score" text, "Result" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent, when Result is Loss, and when V...
SELECT "Opponent" FROM table_77068 WHERE "Result" = 'loss' AND "Venue" = 'mosaic stadium'
wikisql
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.number = 232 AND c...
advising
CREATE TABLE table_51668 ( "Year" real, "Theme" text, "Artist" text, "Finish" text, "Issue Price" text, "Total Mintage" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Theme of Christie Paquet after 2004 with an Issue Price of $34.95?...
SELECT "Theme" FROM table_51668 WHERE "Artist" = 'christie paquet' AND "Issue Price" = '$34.95' AND "Year" > '2004'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "Calcium Replacement (Oncology)"
mimicsql_data
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-8066') AND NOT patient.unitdischargetime IS NUL...
eicu
CREATE TABLE table_36462 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date has parlophone as the label, and lp as a format?
SELECT "Date" FROM table_36462 WHERE "Label" = 'parlophone' AND "Format" = 'lp'
wikisql
CREATE TABLE mzb ( CLINIC_ID 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, INSU_TYPE text, IN...
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '88840185' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 6397.29) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '88840185' AND gyb.MED_CLINIC_ID IN (SELECT t...
css
CREATE TABLE table_name_65 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team at Brunswick Street Oval?
SELECT home_team FROM table_name_65 WHERE venue = "brunswick street oval"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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 locations ( LOCATIO...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(SALARY) DESC
nvbench
CREATE TABLE table_56218 ( "Candidate" text, "Money Raised, 3Q" text, "Loans Received, 3Q" text, "Money Spent, 3Q" text, "Total Receipts" text, "Cash On Hand" text, "After Debt" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the afte...
SELECT "After Debt" FROM table_56218 WHERE "Total Receipts" = '$379,794'
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 = "EMERGENCY ROOM ADMIT" AND diagnoses.icd9_code = "78559"
mimicsql_data
CREATE TABLE table_77426 ( "Year" real, "Player" text, "Position" text, "Nationality" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- After 2009, who was the player that has a nationality of Canada?
SELECT "Player" FROM table_77426 WHERE "Nationality" = 'canada' AND "Year" > '2009'
wikisql
CREATE TABLE table_204_885 ( id number, "season" text, "competition" text, "round" text, "opponent" text, "home" text, "away" text, "agg." text, "bye" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the first compe...
SELECT "competition" FROM table_204_885 WHERE id = 1
squall
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, 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, JY...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 ...
css
CREATE TABLE table_name_18 ( masculine_u_stems VARCHAR, neuter_a_stems VARCHAR, masculine_a_stems VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the u form of the word with a neuter form of skip and a masculine a-ending of fisker?
SELECT masculine_u_stems FROM table_name_18 WHERE neuter_a_stems = "skip" AND masculine_a_stems = "fisker"
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
advising
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 hz_info_zyjzjlb ( JZLSH number, ...
SELECT * 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 hz_info_zyjz...
css
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE park ( park_id text, park_name text, park_alias text, city text, state text, country text ) CREATE TABLE college ( college_id text, name_full text, city text, state text, country text ) CREATE TABLE batting_postseason ( year number, round text, play...
SELECT COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009
spider
CREATE TABLE table_20961 ( "Solution" text, "Other Name" text, "[Na + ](mmol/L)" real, "[Cl - ](mmol/L)" real, "[Glucose](mmol/L)" real, "[Glucose](mg/dl)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the other name where glucose is 5000
SELECT "Other Name" FROM table_20961 WHERE "[Glucose](mg/dl)" = '5000'
wikisql
CREATE TABLE table_77006 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event has a $248,004 prize?
SELECT "Event" FROM table_77006 WHERE "Prize" = '$248,004'
wikisql
CREATE TABLE undergoes ( patient number, procedures number, stay number, dateundergoes time, physician number, assistingnurse number ) CREATE TABLE on_call ( nurse number, blockfloor number, blockcode number, oncallstart time, oncallend time ) CREATE TABLE department ( ...
SELECT DISTINCT name FROM nurse ORDER BY name
spider
CREATE TABLE table_name_8 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is 2010 when 2009 is w and 2007 is qf?
SELECT 2010 FROM table_name_8 WHERE 2009 = "w" AND 2007 = "qf"
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationD...
SELECT * FROM dbo.Users
sede
CREATE TABLE table_5273 ( "Order Year" text, "Manufacturer" text, "Model" text, "Fleet (Qty.)" text, "Propulsion" text, "Length (ft.)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Length (ft.) for a 2008 nfi d40lf?
SELECT "Length (ft.)" FROM table_5273 WHERE "Manufacturer" = 'nfi' AND "Model" = 'd40lf' AND "Order Year" = '2008'
wikisql
CREATE TABLE table_name_49 ( tries_for VARCHAR, try_bonus VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tries for did the team with a try bonus of 5 score?
SELECT tries_for FROM table_name_49 WHERE try_bonus = "5"
sql_create_context
CREATE TABLE table_28059992_1 ( cfl_team VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every CFL team with pick#1?
SELECT cfl_team FROM table_28059992_1 WHERE pick__number = 1
sql_create_context
CREATE TABLE table_71654 ( "First game" real, "Played" real, "Drawn" real, "Lost" real, "Percentage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many matches were drawn associated with a percentage of 7.14% and more than 12 losses?
SELECT COUNT("Drawn") FROM table_71654 WHERE "Percentage" = '7.14%' AND "Lost" > '12'
wikisql
CREATE TABLE table_67334 ( "Club" text, "Australian Marquee" text, "International Marquee" text, "Junior Marquee player" text, "Captain" text, "Vice-Captain" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team is Michael McGlinchey vice cap...
SELECT "International Marquee" FROM table_67334 WHERE "Vice-Captain" = 'michael mcglinchey'
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.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name
nvbench
CREATE TABLE table_name_27 ( total INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Bernhard Langer maximum total was what?
SELECT MAX(total) FROM table_name_27 WHERE player = "bernhard langer"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicatio...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'social work consult' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-2 year'))
eicu
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airport ( airpo...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.arrival_time > 1700 AND flight.departure_time > 1200) AND ((flight.from_airport = AIRPORT_SERVICE_0.airport_code AND CITY_0.city_code = AIRPORT_SERVICE_...
atis
CREATE TABLE table_name_3 ( score VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the score of New Zealand?
SELECT score FROM table_name_3 WHERE country = "new zealand"
sql_create_context
CREATE TABLE table_23608 ( "Year" real, "Author(s) or Editor(s)" text, "Book Title" text, "Publisher" text, "Category" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the book title firelands?
SELECT "Result" FROM table_23608 WHERE "Book Title" = 'Firelands'
wikisql
CREATE TABLE table_35520 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest points scor...
SELECT MAX("Scored") FROM table_35520 WHERE "Position" > '5' AND "Wins" < '4' AND "Draws" > '8'
wikisql
CREATE TABLE table_name_87 ( affiliation VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the affiliation for diego walsh
SELECT affiliation FROM table_name_87 WHERE player = "diego walsh"
sql_create_context
CREATE TABLE table_name_21 ( Box VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the box core for the Melbourne Tigers?
SELECT Box AS score FROM table_name_21 WHERE home_team = "melbourne tigers"
sql_create_context
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Atrial flutter"
mimicsql_data
CREATE TABLE checking ( custid number, balance number ) CREATE TABLE savings ( custid number, balance number ) CREATE TABLE accounts ( custid number, name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the savings balance of the accoun...
SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance DESC LIMIT 1
spider
CREATE TABLE table_name_81 ( money___ INTEGER, place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the lowest money ($) when the place is t2 for player johnny miller?
SELECT MIN(money___) AS $__ FROM table_name_81 WHERE place = "t2" AND player = "johnny miller"
sql_create_context
CREATE TABLE table_name_88 ( power_output VARCHAR, wheel_arrangement VARCHAR, build_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the power of b-b wheel arrangement, built in 1952?
SELECT power_output FROM table_name_88 WHERE wheel_arrangement = "b-b" AND build_date = "1952"
sql_create_context