instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.diagnosis = "VENTRICULAR TACHYCARDIA"
mimicsql_data
CREATE TABLE table_name_62 ( population VARCHAR, code VARCHAR, county VARCHAR, municipality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the population of Danderyd municipality in Stockholm County with a code lower than 162?
SELECT COUNT(population) FROM table_name_62 WHERE county = "stockholm county" AND municipality = "danderyd municipality" AND code < 162
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD...
css
CREATE TABLE table_18626383_2 ( height__cm_ VARCHAR, contestant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When valora roucek is the contestant how many heights in centimeters are there?
SELECT COUNT(height__cm_) FROM table_18626383_2 WHERE contestant = "Valora Roucek"
sql_create_context
CREATE TABLE table_12919 ( "Club" text, "Games" real, "Wins" real, "Losses" real, "Draws" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Games, when Wins is less than 1, and when Draws is greater than 1?
SELECT MIN("Games") FROM table_12919 WHERE "Wins" < '1' AND "Draws" > '1'
wikisql
CREATE TABLE table_name_75 ( bronze INTEGER, country VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Bronze has a Country of malaysia, and a Total smaller than 2644?
SELECT SUM(bronze) FROM table_name_75 WHERE country = "malaysia" AND total < 2644
sql_create_context
CREATE TABLE table_2203760_4 ( budget VARCHAR, film VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the budget for 'Thirteen Ghosts'?
SELECT budget FROM table_2203760_4 WHERE film = "Thirteen Ghosts"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, ...
SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '022-31513' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-2 year')
eicu
CREATE TABLE table_203_376 ( id number, "no." number, "name" text, "term of office" text, "president(s) served under" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many directors served more than 3 years ?
SELECT COUNT("name") FROM table_203_376 WHERE "term of office" - "term of office" > 3
squall
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name tex...
SELECT * FROM Posts AS x WHERE (SELECT COUNT(*) FROM PostHistory WHERE PostId = x.Id) = 0
sede
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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC
nvbench
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 ( KH text, KLX number...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD...
css
CREATE TABLE table_name_68 ( outcome VARCHAR, tournament VARCHAR, opponent_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome of the Tournament of lugano , switzerland wta virginia slims, against bonnie gadusek?
SELECT outcome FROM table_name_68 WHERE tournament = "lugano , switzerland wta virginia slims" AND opponent_in_the_final = "bonnie gadusek"
sql_create_context
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistoryTypes ( Id number, Name te...
SELECT YEAR(CreationDate), COUNT(Id) AS WelcomeCount FROM Comments WHERE Text LIKE '%Welcome to%' GROUP BY YEAR(CreationDate)
sede
CREATE TABLE table_42589 ( "Average population (x 1,000)" text, "Live births" text, "Deaths" text, "Natural change" text, "Migration" text, "Crude birth rate (per 1,000)" real, "Crude death rate (per 1,000)" real, "Natural change (per 1,000)" real, "Migration (per 1,000)" real ) --...
SELECT "Live births" FROM table_42589 WHERE "Migration" = '-14 873'
wikisql
CREATE TABLE table_58947 ( "Binary" real, "Octal" real, "Decimal" real, "Hexadecimal" real, "Glyph" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest octal with a 30 hexadecimal and less than 0 glyphs?
SELECT MIN("Octal") FROM table_58947 WHERE "Hexadecimal" = '30' AND "Glyph" < '0'
wikisql
CREATE TABLE table_name_11 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record at the game held on December 24, 2005?
SELECT record FROM table_name_11 WHERE date = "december 24, 2005"
sql_create_context
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, cha...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'open lung biopsy') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5252) AND STRFTIME('%y', proce...
mimic_iii
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeo...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) = '2101'
eicu
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, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE table_name_92 ( team_classification VARCHAR, stage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team classification for stage of 20
SELECT team_classification FROM table_name_92 WHERE stage = "20"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, ...
SELECT DISTINCT transport_type FROM ground_service WHERE (airport_code IN (SELECT AIRPORTalias0.airport_code FROM airport AS AIRPORTalias0 WHERE AIRPORTalias0.airport_code = 'LGA') AND city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'NEW YORK'))
atis
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
SELECT t4.diagnosisname FROM (SELECT t3.diagnosisname, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.diagnosisname, 100 - SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 10...
eicu
CREATE TABLE table_37817 ( "Season" real, "Team" text, "Country" text, "League" text, "Level" real, "Apps" text, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the least season with level less than 1
SELECT MIN("Season") FROM table_37817 WHERE "Level" < '1'
wikisql
CREATE TABLE table_26041144_16 ( catches INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the catches maximum number?
SELECT MAX(catches) FROM table_26041144_16
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "HISPANIC OR LATINO"
mimicsql_data
CREATE TABLE table_2333 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Enrollment (2005)" text, "Founded" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year is the founding year, for the school that had an enrollment in...
SELECT "Founded" FROM table_2333 WHERE "Enrollment (2005)" = '963'
wikisql
CREATE TABLE table_7700 ( "Material" text, "Formula" text, "Refractive index(es) 589.3nm" text, "Hardness ( Mohs' scale )" text, "Density (g/cm 3 )" text, "State of the art" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which material has a har...
SELECT "Material" FROM table_7700 WHERE "Hardness ( Mohs' scale )" = '8.25'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZ...
SELECT * FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i...
css
CREATE TABLE table_46787 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest grid when the time is +45.162?
SELECT MAX("Grid") FROM table_46787 WHERE "Time" = '+45.162'
wikisql
CREATE TABLE table_name_64 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of 1876(s), when 1872 is less than 1921, and when 1891 is less than 354?
SELECT COUNT(1876) FROM table_name_64 WHERE 1872 < 1921 AND 1891 < 354
sql_create_context
CREATE TABLE table_name_61 ( opponent VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Opponent in the match with a Score of 6 3, 6 4?
SELECT opponent FROM table_name_61 WHERE score = "6–3, 6–4"
sql_create_context
CREATE TABLE table_51748 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance in the bye week after week 5?
SELECT "Attendance" FROM table_51748 WHERE "Week" > '5' AND "Opponent" = 'bye'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL
mimic_iii
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "41" AND diagnoses.icd9_code = "34291"
mimicsql_data
CREATE TABLE table_73321 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the p...
SELECT MAX("Production code") FROM table_73321 WHERE "U.S. viewers (million)" = '9.18'
wikisql
CREATE TABLE table_63977 ( "Outcome" text, "Year" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponents in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Partner in the match with a Score ...
SELECT "Partnering" FROM table_63977 WHERE "Score" = '6-4, 2-6, 7-6'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = zyjybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = zyjybgb.JZLSH_ZYJZJLB WHERE zyjybgb.BGDH = '59958...
css
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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,...
SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND...
css
CREATE TABLE table_203_99 ( id number, "season" number, "date" text, "driver" text, "team" text, "chassis" text, "engine" text, "race distance\nlaps" number, "race distance\nmiles (km)" text, "race time" text, "average speed\n(mph)" number, "report" text ) -- Using vali...
SELECT MIN("race distance\nlaps") FROM table_203_99
squall
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 t_kc24.MED_CLINIC_ID, t_kc24.t_kc21_PERSON_ID, t_kc24.t_kc21_PERSON_NM, t_kc24.t_kc21_IDENTITY_CARD, t_kc24.t_kc21_PERSON_SEX, t_kc24.t_kc21_PERSON_AGE FROM t_kc24 WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '70966424211')
css
CREATE TABLE table_55731 ( "Rank" real, "Name" text, "Nation" text, "SP+FS" real, "Points" real, "Places" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of SP+FS for places of 60 and points more than 151.66
SELECT COUNT("SP+FS") FROM table_55731 WHERE "Places" = '60' AND "Points" > '151.66'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT COUNT(*) 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 = '1714876' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-08' AND '2016-11-26' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 6282.3) AS T
css
CREATE TABLE table_11190568_7 ( date_of_appointment VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When are team Galway's dates of appointment?
SELECT date_of_appointment FROM table_11190568_7 WHERE team = "Galway"
sql_create_context
CREATE TABLE table_9515 ( "Party" text, "Leader" text, "Seats" text, "% of seats" text, "First Pref votes" text, "% FPv" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the %FPv for the Workers' Party?
SELECT "% FPv" FROM table_9515 WHERE "Party" = 'workers'' party'
wikisql
CREATE TABLE table_name_63 ( start VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the start when the finish is 1?
SELECT start FROM table_name_63 WHERE finish = "1"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, C...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '张温书' AND t_kc22.STA_DATE BETWEEN '2004-11-01' AND '2006-09-07' AND t_kc22.SOC_SRT_DIRE_NM = '苯巴比妥片'
css
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE area ( course_id int, area 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 WHERE course_offering.friday = 'N' AND course.department = 'DENT' AND semester.semester = 'WN' AND s...
advising
CREATE TABLE table_15993 ( "Case/Suffix" text, "we two" text, "you and I" text, "you two" text, "them two (the two)" text, "who-two" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is we two where you two is ngipen?
SELECT "we two" FROM table_15993 WHERE "you two" = 'ngipen'
wikisql
CREATE TABLE table_262481_2 ( nickname VARCHAR, founded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nickname of the institution that was founded in 1857?
SELECT nickname FROM table_262481_2 WHERE founded = 1857
sql_create_context
CREATE TABLE table_400 ( "Name" text, "Position" text, "Height" text, "Weight(lbs)" real, "Born" text, "College" text, "Drafted" text, "Pro Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the weight(lbs) when born is april 6...
SELECT "Weight(lbs)" FROM table_400 WHERE "Born" = 'April 6, 1954 Detroit, MI'
wikisql
CREATE TABLE table_name_40 ( player VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What p;layer attended Concordia College?
SELECT player FROM table_name_40 WHERE college = "concordia"
sql_create_context
CREATE TABLE staff ( staff_id number, gender text, first_name text, last_name text, email_address text, phone_number text ) CREATE TABLE products ( product_id number, parent_product_id number, product_category_code text, date_product_first_available time, date_product_discon...
SELECT AVG(product_price), product_category_code FROM products GROUP BY product_category_code
spider
CREATE TABLE table_78447 ( "Name" text, "Gender" text, "Local board" text, "Suburb" text, "Authority" text, "Decile" text, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What gender has a local board of albert eden with a roll of more...
SELECT "Gender" FROM table_78447 WHERE "Local board" = 'albert–eden' AND "Roll" > '232' AND "Decile" = '5'
wikisql
CREATE TABLE table_name_75 ( division_north VARCHAR, division_southwest VARCHAR, division_west VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won Division North when Division Southwest was won by Novaci and Division West by Vrap i te?
SELECT division_north FROM table_name_75 WHERE division_southwest = "novaci" AND division_west = "vrapčište"
sql_create_context
CREATE TABLE table_13558 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Populat...
SELECT MAX("Population") FROM table_13558 WHERE "Median household income" = '$32,902' AND "Number of households" < '11,125'
wikisql
CREATE TABLE table_name_39 ( team VARCHAR, wrestler VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is Doug Basham's team?
SELECT team FROM table_name_39 WHERE wrestler = "doug basham"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE restriction ( restriction_c...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight, flight_stop AS FLIGHT_STOP_0, flight_stop AS FLIGHT_STOP_1...
atis
CREATE TABLE table_34181 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Record of 15 12 2?
SELECT "Score" FROM table_34181 WHERE "Record" = '15–12–2'
wikisql
CREATE TABLE table_4504 ( "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. -- Who was the away team when the home team scored 1...
SELECT "Away team" FROM table_4504 WHERE "Home team score" = '10.18 (78)'
wikisql
CREATE TABLE table_203_683 ( id number, "season" text, "league" text, "gold" text, "silver" text, "bronze" text, "winning manager" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the only season that skeid won gold ?
SELECT "season" FROM table_203_683 WHERE "gold" = 'skeid'
squall
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '8585428' AND jybgb.BGRQ BETWEEN '2006-12-22' AND '2015-03-05' GROUP BY jybgb.KSBM HAVING COUNT(*) > 7 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb J...
css
CREATE TABLE table_35370 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points have a Game smaller than 60, and a Score of 2 0, and a February larger th...
SELECT AVG("Points") FROM table_35370 WHERE "Game" < '60' AND "Score" = '2–0' AND "February" > '1'
wikisql
CREATE TABLE table_70032 ( "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. -- In the round that lasted 0:20, what was the Res?
SELECT "Res." FROM table_70032 WHERE "Time" = '0:20'
wikisql
CREATE TABLE table_37031 ( "Model" text, "Engine" text, "Displacement" text, "Valvetrain" text, "Fuel system" text, "Max. power at rpm" text, "Max. torque at rpm" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Displacement of the...
SELECT "Displacement" FROM table_37031 WHERE "Model" = '180 multijet power/3.0 hdi'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '褚昊天' AND hz_info.YLJGDM = '2197506' AND NOT zyjzjlb.JZKSMC LIKE '%眼外伤%'
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_name_80 ( population INTEGER, per_capita_income VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Population, when Per Capita Income is '$16,330'?
SELECT MIN(population) FROM table_name_80 WHERE per_capita_income = "$16,330"
sql_create_context
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE...
SELECT Payment_Method_Code, COUNT(Payment_Method_Code) FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(Payment_Method_Code)
nvbench
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE com...
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
advising
CREATE TABLE table_name_82 ( season VARCHAR, level VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Season has a Level of tier 2 and a Position of 1st?
SELECT COUNT(season) FROM table_name_82 WHERE level = "tier 2" AND position = "1st"
sql_create_context
CREATE TABLE table_name_23 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did Footscray score at the home game?
SELECT home_team AS score FROM table_name_23 WHERE home_team = "footscray"
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE table_56481 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th...
SELECT "Race" FROM table_56481 WHERE "Tyre" = 'p' AND "Winning driver" = 'juan manuel fangio'
wikisql
CREATE TABLE table_52074 ( "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 smallest crowd size for punt road ov...
SELECT MIN("Crowd") FROM table_52074 WHERE "Venue" = 'punt road oval'
wikisql
CREATE TABLE web_client_accelerator ( Operating_system VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of web accelerators used for each Operating system.
SELECT Operating_system, COUNT(*) FROM web_client_accelerator GROUP BY Operating_system
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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.insurance = "Medicare"
mimicsql_data
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Comments ( Id number, PostId number, Score numb...
SELECT COUNT(*) FROM PostLinks WHERE LinkTypeId = 3 AND RelatedPostId = 218384
sede
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, las...
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 40435 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
mimic_iii
CREATE TABLE table_35430 ( "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 average overall of John Ayres, who had a pick # greater than 4?
SELECT AVG("Overall") FROM table_35430 WHERE "Name" = 'john ayres' AND "Pick #" > '4'
wikisql
CREATE TABLE job_history ( employee_id VARCHAR ) CREATE TABLE employees ( employee_id VARCHAR, salary VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you return all detailed info of jobs which was done by any of the employees who is presently earning...
SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SNF" AND procedures.icd9_code = "966"
mimicsql_data
CREATE TABLE table_69540 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record on September 26?
SELECT "Record" FROM table_69540 WHERE "Date" = 'september 26'
wikisql
CREATE TABLE table_name_32 ( played VARCHAR, tries_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the played for tries for 50?
SELECT played FROM table_name_32 WHERE tries_for = "50"
sql_create_context
CREATE TABLE table_name_47 ( player VARCHAR, finish VARCHAR, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won in 1997 with a finish of t48?
SELECT player FROM table_name_47 WHERE finish = "t48" AND year_s__won = "1997"
sql_create_context
CREATE TABLE table_53582 ( "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 home team when the game was at Wind...
SELECT "Home team" FROM table_53582 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE train_station ( train_id number, station_id number ) CREATE TABLE train ( train_id number, name text, time text, service text ) CREATE TABLE station ( station_id number, name text, annual_entry_exit number, annual_interchanges number, total_passengers number, ...
SELECT DISTINCT location FROM station
spider
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 allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-55642' AND patient.hospitaldischargetime IS NULL))
eicu
CREATE TABLE table_name_80 ( school_club_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Stephen Thompson's School/Club Team?
SELECT school_club_team FROM table_name_80 WHERE player = "stephen thompson"
sql_create_context
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 intakeoutput ( in...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-61209')) AND intakeoutput.cellpath LIKE '%output%' AND D...
eicu
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id numbe...
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 = 'left heart ...
mimic_iii
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions...
mimic_iii
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.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '急性支气管炎' AND jyjgzbb.JCZBMC = '触珠蛋白' UNION SELECT jyjgzbb.CKZFWXX, ...
css
CREATE TABLE table_name_22 ( year INTEGER, pts INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latesr year that has more points than 0?
SELECT MAX(year) FROM table_name_22 WHERE pts > 0
sql_create_context
CREATE TABLE table_26195 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least division
SELECT MIN("Division") FROM table_26195
wikisql
CREATE TABLE table_76853 ( "Player" text, "Nationality" text, "Jersey Number(s)" real, "Position" text, "Years" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college was the player with the jersey number of 34 from?
SELECT "From" FROM table_76853 WHERE "Jersey Number(s)" = '34'
wikisql
CREATE TABLE table_204_658 ( id number, "week" number, "date" text, "kickoff" text, "opponent" text, "results\nfinal score" text, "results\nteam record" text, "game site" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT COUNT(*) FROM table_204_658 WHERE "kickoff" > '6:00 p.m'
squall
CREATE TABLE table_name_78 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Record on September 21?
SELECT record FROM table_name_78 WHERE date = "september 21"
sql_create_context
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, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT * 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 hz_info.YLJGDM = '0960685' AND NOT mzjzjlb.JZZDSM LIKE '%紧张%'
css
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT AVG(t_kc22.SELF_PAY_PRO) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3013661' AND t_kc22.STA_DATE BETWEEN '2015-03-11' AND '2017-06-29'
css