instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_80103 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What chassis has smaller than 9 points by Equipe Rosier?
SELECT "Chassis" FROM table_80103 WHERE "Points" < '9' AND "Entrant" = 'equipe rosier'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE semester ( semester_id int, ...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.pre_course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.course_id INNER JOIN area ON COURSE_0.course_id = area.course_id ...
advising
CREATE TABLE table_203_341 ( id number, "season" text, "champion" text, "runner-up" text, "score" text, "third place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many different champions were there in the 2000 - 2005 seasons ?
SELECT COUNT(DISTINCT "champion") FROM table_203_341 WHERE "season" >= 2000 AND "season" <= 2005
squall
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE MED_EXP_DET_ID = '50353226513'
css
CREATE TABLE table_name_52 ( programming_language_used VARCHAR, first_public_release VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Programming language used has a First public release of 1997?
SELECT programming_language_used FROM table_name_52 WHERE first_public_release = "1997"
sql_create_context
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 WHERE demographic.diagnosis = "STEMI" AND demographic.dod_year <= "2183.0"
mimicsql_data
CREATE TABLE table_name_33 ( opponent VARCHAR, result VARCHAR, week VARCHAR, tv_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Opponent that has the Week smaller than 11, and the TV Time of fox 10:00 am mt, and the Result of ...
SELECT opponent FROM table_name_33 WHERE week < 11 AND tv_time = "fox 10:00 am mt" AND result = "w 20-17"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperio...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) = '2100'
eicu
CREATE TABLE table_name_72 ( record VARCHAR, arena VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record after the game against the Sharks at Arrowhead Pond of Anaheim?
SELECT record FROM table_name_72 WHERE arena = "arrowhead pond of anaheim" AND opponent = "sharks"
sql_create_context
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE time_interval ( period text, begin_time in...
SELECT DISTINCT flight_id FROM flight WHERE airline_code = 'AA'
atis
CREATE TABLE table_name_78 ( team VARCHAR, day_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team was 3:47.761 on day 2?
SELECT team FROM table_name_78 WHERE day_2 = "3:47.761"
sql_create_context
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND procedures.short_title = "Cnt intraart bld gas mon"
mimicsql_data
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Asthma, unspecified type, unspecified" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_name_79 ( pts INTEGER, year VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest pts after 1952 with connaught type a?
SELECT MAX(pts) FROM table_name_79 WHERE year > 1952 AND chassis = "connaught type a"
sql_create_context
CREATE TABLE table_78817 ( "Week" real, "Team" text, "Carries" real, "Yards" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Average has Yards larger than 167, and a Team of at tb, and a Week larger than 7?
SELECT MIN("Average") FROM table_78817 WHERE "Yards" > '167' AND "Team" = 'at tb' AND "Week" > '7'
wikisql
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location ...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS...
atis
CREATE TABLE table_name_66 ( reign INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the highest reign on march 10, 2007?
SELECT MAX(reign) FROM table_name_66 WHERE date = "march 10, 2007"
sql_create_context
CREATE TABLE table_77570 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT MAX("Played") FROM table_77570 WHERE "Goal Difference" < '-27'
wikisql
CREATE TABLE table_name_84 ( rank VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which rank has canada as the country?
SELECT rank FROM table_name_84 WHERE country = "canada"
sql_create_context
CREATE TABLE table_23090 ( "Country" text, "Area km\u00b2" real, "Population" real, "Population density per km\u00b2" real, "HDI (2011)" text, "Capital" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of capitals that hav...
SELECT COUNT("Capital") FROM table_23090 WHERE "Area km\u00b2" = '1104'
wikisql
CREATE TABLE table_name_45 ( position VARCHAR, overall VARCHAR, mlb_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position was more than 421 overall for the St. Louis Cardinals?
SELECT position FROM table_name_45 WHERE overall > 421 AND mlb_team = "st. louis cardinals"
sql_create_context
CREATE TABLE table_11167610_1 ( engine VARCHAR, turbo VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the engine with turbo being yes (mitsubishi td04-15g )
SELECT engine FROM table_11167610_1 WHERE turbo = "Yes (Mitsubishi TD04-15g )"
sql_create_context
CREATE TABLE table_4473 ( "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 is the home team score when the away team is...
SELECT "Home team score" FROM table_4473 WHERE "Away team" = 'collingwood'
wikisql
CREATE TABLE table_26952 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most goals for algeria
SELECT MIN("Goals\u00b9") FROM table_26952 WHERE "Nationality\u00b2" = 'Algeria'
wikisql
CREATE TABLE table_19866 ( "Stage" real, "Stage winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Malaysian rider classification" text, "Team classification" text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT "Points classification" FROM table_19866 WHERE "Malaysian rider classification" = 'Suhardi Hassan' AND "Team classification" = 'Japan' AND "Stage winner" = 'Anuar Manan'
wikisql
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_F...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" ORDER BY COUNT(booking_start_date)
nvbench
CREATE TABLE table_name_44 ( long INTEGER, name VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Rock Cartwright's highest long with more than 11 losses?
SELECT AVG(long) FROM table_name_44 WHERE name = "rock cartwright" AND loss > 11
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT...
atis
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title te...
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1114)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tube #1' ...
mimic_iii
CREATE TABLE table_name_38 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2002 result when 2006 is A and 2010 is Q1?
SELECT 2002 FROM table_name_38 WHERE 2006 = "a" AND 2010 = "q1"
sql_create_context
CREATE TABLE table_14940 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of points before 1954?
SELECT MAX("Points") FROM table_14940 WHERE "Year" < '1954'
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id WHERE jybgb.JZLSH = '06900614343' AND jyjgzbb.JCRXM LIKE...
css
CREATE TABLE table_name_56 ( date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the game when 45,943 attended?
SELECT date FROM table_name_56 WHERE attendance = "45,943"
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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27703) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month...
mimic_iii
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 lab ( labid numbe...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-1746' AND NOT patient.hospitaldischargetime IS NULL ORDER BY ...
eicu
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) 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...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*)
nvbench
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '9681293' GROUP BY qtb.IN_DIAG_DIS_NM UNION SELECT gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '9681293' GROUP BY gyb.IN_DIAG_DIS_NM UNION SELECT zyb.IN_DIAG_DIS_NM, AVG(zyb.PERSON_AGE) FROM zyb WHERE zyb....
css
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '4812361' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-09-22' AND '2008-02-23'
css
CREATE TABLE table_19179465_1 ( played VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Featherstone Rovers club played a total of how many games?
SELECT COUNT(played) FROM table_19179465_1 WHERE club = "Featherstone Rovers"
sql_create_context
CREATE TABLE table_name_76 ( attendance INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE HIGHEST ATTENDANCE FOR THE PHOENIX COYOTES?
SELECT MAX(attendance) FROM table_name_76 WHERE opponent = "phoenix coyotes"
sql_create_context
CREATE TABLE table_2374338_2 ( serbs VARCHAR, hungarians VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every value for Serbs if value for Hungarians is 9.26%?
SELECT serbs FROM table_2374338_2 WHERE hungarians = "9.26%"
sql_create_context
CREATE TABLE table_2780146_6 ( standard VARCHAR, pm__g_kwh_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different standards have a PM of 0.02 g/kWh?
SELECT COUNT(standard) FROM table_2780146_6 WHERE pm__g_kwh_ = "0.02"
sql_create_context
CREATE TABLE student ( stuid VARCHAR, major VARCHAR ) CREATE TABLE member_of_club ( clubid VARCHAR, stuid VARCHAR ) CREATE TABLE club ( clubname VARCHAR, clubid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which club has the most members ...
SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = "600" GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, ...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) AND diagnosis.diagnosisname = 'obstructive sleep apne...
eicu
CREATE TABLE table_61217 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Outcome of the match with Partner Marcella Mesker...
SELECT "Outcome" FROM table_61217 WHERE "Partner" = 'marcella mesker' AND "Score" = '6–4, 4–6, 4–6'
wikisql
CREATE TABLE table_name_94 ( player VARCHAR, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Player than won in 2003?
SELECT player FROM table_name_94 WHERE year_s__won = "2003"
sql_create_context
CREATE TABLE table_204_571 ( id number, "athlete" text, "event" text, "race 1\ntime" text, "race 2\ntime" text, "total\ntime" text, "total\nrank" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which men 's alpine skiing event had the most ...
SELECT "event" FROM table_204_571 GROUP BY "event" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE Faculty ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many faculty do we have?
SELECT COUNT(*) FROM Faculty
sql_create_context
CREATE TABLE table_64520 ( "Country" text, "Athlete" text, "Technical" real, "Free" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the free of Apolline Dreyfuss & Lila Meesseman-Bakir, when the total was larger than 90.333?
SELECT MIN("Free") FROM table_64520 WHERE "Athlete" = 'apolline dreyfuss & lila meesseman-bakir' AND "Total" > '90.333'
wikisql
CREATE TABLE table_27733258_6 ( high_points VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the high points for l 110 112 (ot)
SELECT high_points FROM table_27733258_6 WHERE score = "L 110–112 (OT)"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'insert endo...
mimic_iii
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Activity ( actid INTEGER, acti...
SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank
nvbench
CREATE TABLE Teachers ( address_id VARCHAR ) CREATE TABLE Students ( address_id VARCHAR ) CREATE TABLE Addresses ( line_1 VARCHAR, address_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the line 1 of addresses shared by some students an...
SELECT T1.line_1 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id INTERSECT SELECT T1.line_1 FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id
sql_create_context
CREATE TABLE table_7127 ( "Track" real, "Recorded" text, "Catalogue" text, "Release date" text, "Chart peak" text, "Song title" text, "Writer(s)" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Track has a Writer(s) of ...
SELECT AVG("Track") FROM table_7127 WHERE "Writer(s)" = 'mac davis'
wikisql
CREATE TABLE table_33897 ( "Position" real, "Name" text, "Country" text, "Win-Loss" text, "Spread" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has chunkath, mohan verghese as the name?
SELECT "Country" FROM table_33897 WHERE "Name" = 'chunkath, mohan verghese'
wikisql
CREATE TABLE table_name_56 ( city___state VARCHAR, series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the City / State, when Series is ATCC Round 3?
SELECT city___state FROM table_name_56 WHERE series = "atcc round 3"
sql_create_context
CREATE TABLE table_name_43 ( points VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the points for games of 16 16
SELECT points FROM table_name_43 WHERE games = "16 16"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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, ...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5865) AND microbiologyevents.spec_type_desc = 'serology/blood' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of year') ...
mimic_iii
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instruc...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.start_time > '12:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester...
advising
CREATE TABLE table_3368 ( "Date (YYYY-MM-DD)" text, "Time (UTC)" text, "Latitude" text, "Longitude" text, "Depth" text, "Magnitude" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the latitude is 08.979 s, what is the depth?
SELECT "Depth" FROM table_3368 WHERE "Latitude" = '08.979° S'
wikisql
CREATE TABLE table_name_17 ( year_s__won VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The To par of +14 was won in what year(s)?
SELECT year_s__won FROM table_name_17 WHERE to_par = "+14"
sql_create_context
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 STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '015-60616' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
CREATE TABLE table_57792 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest numbered grid for piercarlo ghinzani with over 3 laps?
SELECT MAX("Grid") FROM table_57792 WHERE "Driver" = 'piercarlo ghinzani' AND "Laps" > '3'
wikisql
CREATE TABLE table_3697 ( "Position" text, "Nationality" text, "Name" text, "League apps" real, "League goals" real, "FA Cup apps" real, "FA Cup goals" real, "Total apps" real, "Total goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT MIN("FA Cup goals") FROM table_3697 WHERE "FA Cup apps" = '2' AND "Position" = 'FW'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT Id AS "user_link", Reputation, LastAccessDate, Location, UpVotes, DownVotes, Views, DisplayName FROM Users WHERE DisplayName LIKE '%##text?Monica##%' ORDER BY Reputation DESC
sede
CREATE TABLE table_19070 ( "District" text, "Counties Represented" text, "Delegate" text, "Party" text, "First Elected" real, "Committee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the counties represented in District 12.1 12a?
SELECT "Counties Represented" FROM table_19070 WHERE "District" = '12.1 12A'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2103" AND procedures.short_title = "Atrial cardioversion"
mimicsql_data
CREATE TABLE table_203_211 ( id number, "pos." number, "time" text, "athlete" text, "country" text, "venue" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the position number of gail devers ?
SELECT "pos." FROM table_203_211 WHERE "athlete" = 'gail devers'
squall
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" AND procedures.icd9_code = "3783"
mimicsql_data
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "69"
mimicsql_data
CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( ...
SELECT Committee, COUNT(Committee) FROM election GROUP BY Committee
nvbench
CREATE TABLE manager ( LEVEL INTEGER, Country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum level of managers in countries that are not 'Australia'?
SELECT MAX(LEVEL) FROM manager WHERE Country <> "Australia "
sql_create_context
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 jybgb.BGRGH, jybgb.BGRXM FROM jybgb WHERE jybgb.JZLSH = '15125060354' GROUP BY jybgb.BGRGH HAVING COUNT(*) > 26
css
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 ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "80" AND prescriptions.drug = "Oseltamivir"
mimicsql_data
CREATE TABLE table_23968 ( "Round" real, "Choice" real, "Player" text, "Position" text, "Height" text, "Weight" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what round did the player who weights 192lb (87kg) play?
SELECT MAX("Round") FROM table_23968 WHERE "Weight" = '192lb (87kg)'
wikisql
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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '97780121' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 196.98) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '97780121' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLI...
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, ...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-26011' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho...
eicu
CREATE TABLE table_name_95 ( rank INTEGER, total VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of the team with 11 total medals and more than 4 silver medals has?
SELECT SUM(rank) FROM table_name_95 WHERE total = 11 AND silver > 4
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, MED_ORG_DEPT_NM FROM t_kc21 WHERE MED_CLINIC_ID = '25237614940'
css
CREATE TABLE table_50791 ( "Event" text, "Long Course/Short Course" text, "Year Set" real, "Time" text, "Meet" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event had a short course in 2010?
SELECT "Event" FROM table_50791 WHERE "Long Course/Short Course" = 'short course' AND "Year Set" = '2010'
wikisql
CREATE TABLE table_60653 ( "Mission" text, "Location" text, "Type" text, "Head of Mission" text, "Position" text, "List" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the location when the type is embassy and the mission is panama?
SELECT "Location" FROM table_60653 WHERE "Type" = 'embassy' AND "Mission" = 'panama'
wikisql
CREATE TABLE table_57802 ( "Annual ridership (2012)" real, "Rider. per mile" real, "Opened" real, "Stations" real, "Lines" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the station with the most riders that has an annaul ridership of 4,445,...
SELECT MAX("Stations") FROM table_57802 WHERE "Annual ridership (2012)" = '4,445,100' AND "Lines" < '1'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_24951872_2 ( opponent VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opponents played Waldstadion in a game?
SELECT opponent FROM table_24951872_2 WHERE game_site = "Waldstadion"
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.MED_CLINIC_ID 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.AMOUNT >= 3093.83)
css
CREATE TABLE table_name_11 ( record VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record in the competition in which the home team was the Mavericks?
SELECT record FROM table_name_11 WHERE home = "mavericks"
sql_create_context
CREATE TABLE table_name_13 ( tournament VARCHAR, date VARCHAR, score_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament is in 1993 with a Score in the final of 6 2, 2 6, 7 5?
SELECT tournament FROM table_name_13 WHERE date = 1993 AND score_in_the_final = "6–2, 2–6, 7–5"
sql_create_context
CREATE TABLE table_name_95 ( premiere VARCHAR, chinese_title VARCHAR, average VARCHAR, finale VARCHAR, peak VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What premiere has a finale of less than 41, peak less than 40, average above 31, and a Chin...
SELECT premiere FROM table_name_95 WHERE finale < 41 AND peak < 40 AND average > 31 AND chinese_title = "學警雄心"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid numb...
SELECT MAX(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18150')) AND NOT vitalperiodic.heartrate IS NULL...
eicu
CREATE TABLE table_69867 ( "Season" text, "Games" real, "Lost" real, "Points" real, "Pct %" real, "Goals for" real, "Goals against" real, "Standing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Goals have a Pct % larger than 0...
SELECT COUNT("Goals for") FROM table_69867 WHERE "Pct %" > '0.557' AND "Points" < '90' AND "Games" > '68'
wikisql
CREATE TABLE table_name_95 ( attendance VARCHAR, runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people were watching when Livingston was the runner-up?
SELECT attendance FROM table_name_95 WHERE runner_up = "livingston"
sql_create_context
CREATE TABLE table_69946 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people were in attendance on may 2?
SELECT MIN("Attendance") FROM table_69946 WHERE "Date" = 'may 2'
wikisql
CREATE TABLE table_746 ( "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 party did Frank J. Becker represent?
SELECT "Party" FROM table_746 WHERE "Incumbent" = 'Frank J. Becker'
wikisql
CREATE TABLE table_name_81 ( winning_constructor VARCHAR, winning_drivers VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What brand of vehicle won a race driven by Tazio Nuvolari?
SELECT winning_constructor FROM table_name_81 WHERE winning_drivers = "tazio nuvolari"
sql_create_context
CREATE TABLE enzyme ( OMIM INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum Online Mendelian Inheritance in Man (OMIM) value of the enzymes?
SELECT MAX(OMIM) FROM enzyme
sql_create_context
CREATE TABLE table_name_60 ( competition VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Competition has a Result of france 46-16 scotland?
SELECT competition FROM table_name_60 WHERE result = "france 46-16 scotland"
sql_create_context
CREATE TABLE table_204_607 ( id number, "season" number, "date" text, "location" text, "discipline" text, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- aspen and lienz in 2009 are the only races where this racer got what position ?
SELECT "place" FROM table_204_607 WHERE "date" = 2009 AND "location" = 'aspen'
squall
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, ...
SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'NRE' AND course.number = 557 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_47246 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who ha...
SELECT "High rebounds" FROM table_47246 WHERE "Date" = 'april 9'
wikisql
CREATE TABLE table_name_44 ( genre VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the genre for the year 2012 (16th)?
SELECT genre FROM table_name_44 WHERE year = "2012 (16th)"
sql_create_context