instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 = "COMPLETE HEART BLOCK" AND demographic.dod_year <= "2138.0"
mimicsql_data
CREATE TABLE table_48791 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What NFL team did the Tight End position belong to?
SELECT "NFL Team" FROM table_48791 WHERE "Position" = 'tight end'
wikisql
CREATE TABLE table_17941032_3 ( tries_against VARCHAR, tries_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tries against when tries for is 30
SELECT tries_against FROM table_17941032_3 WHERE tries_for = "30"
sql_create_context
CREATE TABLE table_204_137 ( id number, "race" number, "race name" text, "pole position" text, "fastest lap" text, "winning driver" text, "winning team" text, "yokohama winner" text, "jay-ten winner" text, "report" text ) -- Using valid SQLite, answer the following questions fo...
SELECT "race name" FROM table_204_137 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_39840 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "2008 Candidates" text, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the year Elected of Republican Incumbent Dav...
SELECT "Elected" FROM table_39840 WHERE "Party" = 'republican' AND "Incumbent" = 'dave reichert'
wikisql
CREATE TABLE table_59654 ( "Year recorded" text, "Title" text, "Genre" text, "Label" text, "Year inducted" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the genre of the song recorded in 1929?
SELECT "Genre" FROM table_59654 WHERE "Year recorded" = '1929'
wikisql
CREATE TABLE table_49151 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the pick # for william loftus?
SELECT "Pick #" FROM table_49151 WHERE "Player" = 'william loftus'
wikisql
CREATE TABLE table_79269 ( "Driver" text, "Navigator" text, "Vehicle" text, "Class" text, "Capacity" real, "Total Time" text, "Margin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which vehicle has a class 6c3g?
SELECT "Vehicle" FROM table_79269 WHERE "Class" = '6c3g'
wikisql
CREATE TABLE table_60149 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks had an Attendance of 43,272?
SELECT COUNT("Week") FROM table_60149 WHERE "Attendance" = '43,272'
wikisql
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW te...
SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGDH = '49805079614'
css
CREATE TABLE table_name_45 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent with the 20-12 record?
SELECT opponent FROM table_name_45 WHERE record = "20-12"
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 demographic.dischtime, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Bessie Giordano"
mimicsql_data
CREATE TABLE table_26682 ( "Region/Country" text, "Local name" text, "Main presenter" text, "Network" text, "Year premiered" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every year premiered when Behzat Uighur is main presenter?
SELECT "Year premiered" FROM table_26682 WHERE "Main presenter" = 'Behzat Uighur'
wikisql
CREATE TABLE table_name_89 ( name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2005-2006 team for player Phil Kessel?
SELECT 2005 AS _2006_team FROM table_name_89 WHERE name = "phil kessel"
sql_create_context
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT jybgb.BGDH FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '20499920' AND jybgb.BGRQ BETWEEN '2010-05-11' AND '2020-...
css
CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number text, time_slot_id text ) CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE prereq ( course_id text, p...
SELECT name FROM instructor ORDER BY salary DESC LIMIT 1
spider
CREATE TABLE table_name_41 ( games INTEGER, rank VARCHAR, points VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest game that has 32 points and a team rank larger than 4 named montepaschi siena
SELECT MAX(games) FROM table_name_41 WHERE points = 32 AND team = "montepaschi siena" AND rank > 4
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm...
SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hypovolemia') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24364 AND NOT admissions.disch...
mimic_iii
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_interval ( period text, begin_time int, end_time...
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, fare_basis, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code A...
atis
CREATE TABLE airport ( name VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of the airports which are not in the country 'Iceland'?
SELECT name FROM airport WHERE country <> 'Iceland'
sql_create_context
CREATE TABLE table_65706 ( "Score" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2008 has 14.2% as the 2009?
SELECT "2008" FROM table_65706 WHERE "2009" = '14.2%'
wikisql
CREATE TABLE table_name_26 ( date VARCHAR, week VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the game before week 15 with the result of bye?
SELECT date FROM table_name_26 WHERE week < 15 AND result = "bye"
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 treatment ( trea...
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-754')) AND lab.labname = 'pt' AND STRFTIME('%y', lab.labresulttime) <= '2104'
eicu
CREATE TABLE table_203_300 ( id number, "year" number, "tournament" text, "venue" text, "result" text, "extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of tournaments in the year 2006 ?
SELECT COUNT("tournament") FROM table_203_300 WHERE "year" = 2006
squall
CREATE TABLE table_18672 ( "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's the result with district being kansas 1
SELECT "Result" FROM table_18672 WHERE "District" = 'Kansas 1'
wikisql
CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, ...
SELECT Years_Played, COUNT(Years_Played) FROM player GROUP BY Years_Played ORDER BY Years_Played DESC
nvbench
CREATE TABLE table_204_625 ( id number, "model" text, "availability" text, "introduced" text, "length of use" text, "last of whiteness" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which discontinued product was introduced the same year as cre...
SELECT "model" FROM table_204_625 WHERE "model" <> 'crest whitestrips 3d vivid' AND "introduced" = (SELECT "introduced" FROM table_204_625 WHERE "model" = 'crest whitestrips 3d vivid')
squall
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 * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4525816' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-11-17' AND '2020-11-06' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4525816' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-11-17' AND '2020-11-06' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = ...
css
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.dob_year < "2066"
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Combined right and left heart angiocardiography"
mimicsql_data
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_name_81 ( name VARCHAR, moving_to VARCHAR, type VARCHAR, nat VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the person with a type of end of contract, nat of sco, and the Moving to is cardiff city?
SELECT name FROM table_name_81 WHERE type = "end of contract" AND nat = "sco" AND moving_to = "cardiff city"
sql_create_context
CREATE TABLE table_name_18 ( points INTEGER, chassis VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average points of the Ferrari 1512 Chassis after 1965?
SELECT AVG(points) FROM table_name_18 WHERE chassis = "ferrari 1512" AND year > 1965
sql_create_context
CREATE TABLE table_15547 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the years with authority of state and decile more than 6 with roll ...
SELECT "Years" FROM table_15547 WHERE "Authority" = 'state' AND "Decile" > '6' AND "Roll" < '33'
wikisql
CREATE TABLE table_2102945_1 ( viewers__in_millions_ VARCHAR, run_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 24:31 is the run time how many measurements of viewers (in millions) are there?
SELECT COUNT(viewers__in_millions_) FROM table_2102945_1 WHERE run_time = "24:31"
sql_create_context
CREATE TABLE table_23619212_1 ( _percentage_of_all_immigrants_2004 VARCHAR, _percentage_of_all_immigrants_2006 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the percentage of immigrants in 2004 in the country with 2.1% of the immigrants in 2006?
SELECT _percentage_of_all_immigrants_2004 FROM table_23619212_1 WHERE _percentage_of_all_immigrants_2006 = "2.1%"
sql_create_context
CREATE TABLE table_53651 ( "Rank" real, "Player" text, "Goals" real, "Apps" real, "Avg/Game" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average avg/game of the player with 97 goals and a rank above 7?
SELECT AVG("Avg/Game") FROM table_53651 WHERE "Goals" = '97' AND "Rank" < '7'
wikisql
CREATE TABLE table_name_42 ( last_win VARCHAR, club VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Last wins have a Club of mansfield town, and Wins smaller than 1?
SELECT COUNT(last_win) FROM table_name_42 WHERE club = "mansfield town" AND wins < 1
sql_create_context
CREATE TABLE table_name_20 ( play VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the play for 1976
SELECT play FROM table_name_20 WHERE year = 1976
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'vent rate')
eicu
CREATE TABLE table_40210 ( "Event" text, "2007\u201308" text, "2008\u201309" text, "2009\u201310" text, "2010\u201311" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2008 09 when the 2009 10 shows q?
SELECT "2008\u201309" FROM table_40210 WHERE "2009\u201310" = 'q'
wikisql
CREATE TABLE table_80211 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine did the porsche 718 chassis use?
SELECT "Engine" FROM table_80211 WHERE "Chassis" = 'porsche 718'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microlab.culturesite...
eicu
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text ) CREATE TABL...
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto'
spider
CREATE TABLE table_140968_1 ( copies_per_particle VARCHAR, function VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many copies per particle are created by the enterotoxin?
SELECT copies_per_particle FROM table_140968_1 WHERE function = "Enterotoxin"
sql_create_context
CREATE TABLE table_name_57 ( place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place was Corey Pavin in?
SELECT place FROM table_name_57 WHERE player = "corey pavin"
sql_create_context
CREATE TABLE EVENTS ( service_id VARCHAR, event_details VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the service id and details for the events.
SELECT service_id, event_details FROM EVENTS
sql_create_context
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Tests_Taken ( registration_id I...
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" ORDER BY COUNT(date_test_taken)
nvbench
CREATE TABLE table_name_6 ( losses INTEGER, conceded VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many loses does the team have that conceded 25 and won more than 6 games?
SELECT SUM(losses) FROM table_name_6 WHERE conceded = 25 AND wins > 6
sql_create_context
CREATE TABLE table_name_70 ( jockey VARCHAR, year VARCHAR, owner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What jockey rode for Michael House before 2012
SELECT jockey FROM table_name_70 WHERE year < 2012 AND owner = "michael house"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int,...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%American Board of Orthodontics Phase II Review Course%' OR course.description LIKE '%American Bo...
advising
CREATE TABLE table_22917 ( "Version" text, "Code name" text, "Release date" text, "Desktops" text, "Servers" text, "Kernel Version" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the release date of the operating system with kernel vers...
SELECT "Release date" FROM table_22917 WHERE "Kernel Version" = '2.6.31'
wikisql
CREATE TABLE table_34364 ( "Surname" text, "First" text, "D.O.B." text, "Uni#" real, "Bats" text, "Throws" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which does the lhp player with the first name lachlan bat?
SELECT "Bats" FROM table_34364 WHERE "Position" = 'lhp' AND "First" = 'lachlan'
wikisql
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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admission_location = "EMERGENCY ROOM ADMIT"
mimicsql_data
CREATE TABLE table_47859 ( "Date" text, "Time" text, "Opponent" text, "Site" text, "City" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team was the opponent on 03/18/08?
SELECT "Opponent" FROM table_47859 WHERE "Date" = '03/18/08'
wikisql
CREATE TABLE table_name_30 ( year VARCHAR, venue VARCHAR, opposition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which number of Years has a Venue of old trafford, and an Opposition of yorkshire?
SELECT COUNT(year) FROM table_name_30 WHERE venue = "old trafford" AND opposition = "yorkshire"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-63986')) AND NOT vitalperiodic.sao2 IS NULL AND STRFT...
eicu
CREATE TABLE zyb ( 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 COUNT(*) FROM zyb WHERE zyb.PERSON_NM = '82087848' AND MOD(zyb.MED_CLINIC_ID, 1) = 0
css
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY meter_200
nvbench
CREATE TABLE table_204_612 ( id number, "draft order\nround" number, "draft order\nchoice" number, "player" text, "position" text, "height" text, "weight" text, "college" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- is brandon pettigre...
SELECT (SELECT "weight" FROM table_204_612 WHERE "player" = 'brandon pettigrew') > 250
squall
CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) CREATE TABLE papers ( paperid number, title text ) -...
SELECT title FROM papers WHERE title LIKE "%ML%"
spider
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Posts ( Id nu...
SELECT answers.Id AS "post_link", answers.Score AS pontuacao, answers.OwnerUserId AS "user_link" FROM Posts AS answers INNER JOIN Posts AS all_posts ON all_posts.AcceptedAnswerId = answers.Id WHERE answers.OwnerUserId = @UserId AND answers.PostTypeId = 2 AND answers.ClosedDate IS NULL AND answers.DeletionDate IS NULL A...
sede
CREATE TABLE table_79970 ( "Season" text, "Tier" real, "League" text, "Turkish Cup" text, "European Competitions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tier of 2, and a Season of 2004 05 is what European competitions?
SELECT "European Competitions" FROM table_79970 WHERE "Tier" = '2' AND "Season" = '2004–05'
wikisql
CREATE TABLE table_name_14 ( tries_against VARCHAR, tries_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the tries against when they had 32 tries for?
SELECT tries_against FROM table_name_14 WHERE tries_for = "32"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, u...
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-22988')) AND DATETIME(microlab.culturetakentime) <= DATETIME(...
eicu
CREATE TABLE table_75892 ( "Draw" real, "Song" text, "Performer" text, "Points" real, "Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of draws for songs performed by Miranda with fewer than 48 points?
SELECT COUNT("Draw") FROM table_75892 WHERE "Performer" = 'miranda' AND "Points" < '48'
wikisql
CREATE TABLE table_204_741 ( id number, "rank" number, "name" text, "nationality" text, "1,62" text, "1,67" text, "1,72" text, "1,75" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what name is at the top of the list ?
SELECT "name" FROM table_204_741 WHERE id = 1
squall
CREATE TABLE table_17841 ( "Colt model no." text, "Name" text, "Stock" text, "Fire control" text, "Rear sight" text, "Forward assist" text, "Case deflector" text, "Barrel length" text, "Barrel profile" text, "Barrel twist" text, "Hand guards" text, "Bayonet Lug" text, ...
SELECT "Forward assist" FROM table_17841 WHERE "Barrel profile" = 'A2'
wikisql
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 (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4213631' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-04-05' AND '2006-10-29' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 690.96) AS T
css
CREATE TABLE table_1628792_1 ( champion VARCHAR, tournament_location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the champion for london hunt and country club ( london , on )
SELECT champion FROM table_1628792_1 WHERE tournament_location = "London Hunt and country Club ( London , ON )"
sql_create_context
CREATE TABLE table_70629 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Tries against" FROM table_70629 WHERE "Points against" = '520'
wikisql
CREATE TABLE table_72597 ( "Tournament" text, "Country" text, "Location" text, "Current Venue" text, "Began" real, "Court surface" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the tournament first held in Italy?
SELECT MIN("Began") FROM table_72597 WHERE "Country" = 'Italy'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
SELECT TagName, COUNT(*) AS frequency FROM Posts JOIN PostTags AS pt ON pt.PostId = Posts.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE UPPER(TagName) LIKE '%LDAP%' OR UPPER(TagName) LIKE '%UNBOUNDID%' GROUP BY TagName ORDER BY frequency DESC
sede
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 mzjybgb ( BBCJBW text, BBDM t...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '柏婉娜' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2006-07-09' UNI...
css
CREATE TABLE table_11120 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year is the result 6th in munich, west germany?
SELECT SUM("Year") FROM table_11120 WHERE "Result" = '6th' AND "Venue" = 'munich, west germany'
wikisql
CREATE TABLE table_73836 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the points for donald boor
SELECT "Points" FROM table_73836 WHERE "Player" = 'Donald Boor'
wikisql
CREATE TABLE table_11027 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue will hold the 2013 Concacaf Gold Cup competition?
SELECT "Venue" FROM table_11027 WHERE "Competition" = '2013 concacaf gold cup'
wikisql
CREATE TABLE table_29743928_3 ( name VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of players from the dr congo?
SELECT name FROM table_29743928_3 WHERE country = "DR Congo"
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND lab.label = "Plasma Cells"
mimicsql_data
CREATE TABLE table_1855841_1 ( running_with__in_team_ VARCHAR, candidate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the running with for elizabeth falco
SELECT running_with__in_team_ FROM table_1855841_1 WHERE candidate = "Elizabeth Falco"
sql_create_context
CREATE TABLE table_71443 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2nd party in the 1874 election?
SELECT "2nd Party" FROM table_71443 WHERE "Election" = '1874'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, ...
SELECT Id AS "user_link", * FROM Users WHERE UpVotes = 0 AND DownVotes = 0 ORDER BY Reputation DESC, Id LIMIT 110
sede
CREATE TABLE table_name_70 ( pick VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pick of wiley college?
SELECT pick FROM table_name_70 WHERE college = "wiley"
sql_create_context
CREATE TABLE table_7522 ( "Event" text, "2006\u201307" text, "2007\u201308" text, "2008\u201309" text, "2010\u201311" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2007 08 event has 2008 09 of dnp and an Event of players'?
SELECT "2007\u201308" FROM table_7522 WHERE "2008\u201309" = 'dnp' AND "Event" = 'players'
wikisql
CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text...
SELECT services, COUNT(services) FROM station GROUP BY local_authority, services ORDER BY COUNT(services)
nvbench
CREATE TABLE table_45718 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week has a Result of w 20-13?
SELECT AVG("Week") FROM table_45718 WHERE "Result" = 'w 20-13'
wikisql
CREATE TABLE table_43311 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Event with a Time that is 3:06?
SELECT "Event" FROM table_43311 WHERE "Time" = '3:06'
wikisql
CREATE TABLE table_12001616_4 ( status VARCHAR, entrant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status of joe gibbs racing?
SELECT status FROM table_12001616_4 WHERE entrant = "Joe Gibbs Racing"
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, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '9028795' GROUP BY MED_ORG_DEPT_CD, IN_DIAG_DIS_NM
css
CREATE TABLE table_24304 ( "Census division" text, "Area (km\u00b2)" text, "Pop. (2011)" real, "Pop. (2006)" real, "Pop. (2001)" real, "Pop. (1996)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people lived in the census division spre...
SELECT "Pop. (1996)" FROM table_24304 WHERE "Area (km\u00b2)" = '9909.31'
wikisql
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 medication ( medi...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-10135')) AND medication.drugname = 'glucagon (human recombinant) 1 mg/...
eicu
CREATE TABLE table_name_10 ( team VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team with grid 9?
SELECT team FROM table_name_10 WHERE grid = 9
sql_create_context
CREATE TABLE table_32910 ( "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. -- When an away team scored 11.17 (83), at which ve...
SELECT "Venue" FROM table_32910 WHERE "Away team score" = '11.17 (83)'
wikisql
CREATE TABLE table_204_835 ( id number, "rank" number, "lane" number, "name" text, "nationality" text, "time" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long did it take ryosuke irie to finish ?
SELECT "time" FROM table_204_835 WHERE "name" = 'ryosuke irie'
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 IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '72169223' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 1973.76)
css
CREATE TABLE table_29545 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the election with incumbent john lewis?
SELECT "Result" FROM table_29545 WHERE "Incumbent" = 'John Lewis'
wikisql
CREATE TABLE table_24028 ( "Ep." real, "Season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. Code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the title that aired for november 08, 1985
SELECT "Title" FROM table_24028 WHERE "Original air date" = 'November 08, 1985'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TAB...
SELECT u.Id, SUM(CASE WHEN (q.AcceptedAnswerId = a.Id) THEN 1 END) AS number_accepted, COUNT(DISTINCT (q.Id)) AS total_number FROM Users AS u INNER JOIN Posts AS q ON (q.OwnerUserId = u.Id AND q.PostTypeId = 1 AND u.CreationDate > '2020-01-01') INNER JOIN Posts AS a ON (a.ParentId = q.Id) GROUP BY u.Id ORDER BY total_n...
sede
CREATE TABLE table_19515 ( "No." real, "Station Code" text, "Station" text, "Arrival" text, "Departure" text, "Kilometers" real, "Day" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the arrival time for no. 14?
SELECT "Arrival" FROM table_19515 WHERE "No." = '14'
wikisql
CREATE TABLE table_name_6 ( manager VARCHAR, year VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the manager when the year is before 1994 and finish is 5th?
SELECT manager FROM table_name_6 WHERE year < 1994 AND finish = "5th"
sql_create_context