instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_71 ( date VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what team scored 17
SELECT date FROM table_name_71 WHERE game = 17
sql_create_context
CREATE TABLE table_name_72 ( class VARCHAR, year VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Class Pos., when Year is before 2013, and when Laps is greater than 175?
SELECT class AS pos FROM table_name_72 WHERE year < 2013 AND laps > 175
sql_create_context
CREATE TABLE table_name_79 ( opponent VARCHAR, series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent with a series of 1-0?
SELECT opponent FROM table_name_79 WHERE series = "1-0"
sql_create_context
CREATE TABLE table_19718 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On which week was the attendance 74303?
SELECT MAX("Week") FROM table_19718 WHERE "Attendance" = '74303'
wikisql
CREATE TABLE table_53056 ( "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 size of the crowd at the game where ...
SELECT AVG("Crowd") FROM table_53056 WHERE "Home team score" = '10.8 (68)'
wikisql
CREATE TABLE table_67432 ( "Ranking" real, "Nationality" text, "Name" text, "Years" text, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years had a ranking of 1?
SELECT "Years" FROM table_67432 WHERE "Ranking" = '1'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "7742"
mimicsql_data
CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_NM = '潘烨烁' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_NM = '潘烨烁' GROUP BY gyb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT zyb.OUT_DIAG_DOC_CD, zyb.OU...
css
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 MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '3249384' AND OUT_DIAG_DIS_NM = '持久的妄想性障碍')
css
CREATE TABLE table_56948 ( "Street" text, "West" text, "East" text, "# of lanes" text, "Traffic direction" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the # of lanes on 20th street?
SELECT "# of lanes" FROM table_56948 WHERE "Street" = '20th street'
wikisql
CREATE TABLE table_name_6 ( overall VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the overall number for the College of Wyoming?
SELECT COUNT(overall) FROM table_name_6 WHERE college = "wyoming"
sql_create_context
CREATE TABLE table_name_65 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On November 20, 1994, what was the result of the game?
SELECT result FROM table_name_65 WHERE date = "november 20, 1994"
sql_create_context
CREATE TABLE table_21960 ( "Voivodeship after 1569" text, "Capital" text, "Year established" real, "Number of powiats" text, "Area (km\u00b2) in 1590 (Lithuanian) Category:Articles with Lithuanian-language external links" real ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT MAX("Year established") FROM table_21960
wikisql
CREATE TABLE table_38052 ( "Week" text, "Date" text, "Kickoff" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "NFL Recap" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Kickoff had a Game Site of fawcett sta...
SELECT "Kickoff" FROM table_38052 WHERE "Game Site" = 'fawcett stadium'
wikisql
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 PostFeedback ( Id number, PostId numb...
SELECT q.Id AS "post_link", q.Tags, q.CreationDate FROM Posts AS q INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE (t.TagName = '##tagName:string?geometry##') AND (q.OwnerUserId = '##userid?6094##') ORDER BY q.CreationDate DESC
sede
CREATE TABLE table_name_91 ( rider VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Rider has a Grid of 21?
SELECT rider FROM table_name_91 WHERE grid = 21
sql_create_context
CREATE TABLE table_36120 ( "Album#" text, "English title" text, "Chinese title" text, "Released" text, "Label" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- English title of oxygenie of happiness has what release date?
SELECT "Released" FROM table_36120 WHERE "English title" = 'oxygenie of happiness'
wikisql
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
SELECT zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.JZLSH = '62739895555' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.JZLSH = '62739895555'
css
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 HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE DEPARTMENT_ID = (SELECT DEPARTMENT_ID FROM employees WHERE FIRST_NAME = "Clara") AND FIRST_NAME <> "Clara"
nvbench
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
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.icd9_code = "23875" AND prescriptions.route = "NEB"
mimicsql_data
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-17195' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE Staff ( staff_id INTEGER, staff_first_name VARCHAR(80), staff_last_name VARCHAR(80), other_staff_details VARCHAR(255) ) CREATE TABLE Problem_Category_Codes ( problem_category_code VARCHAR(20), problem_category_description VARCHAR(80) ) CREATE TABLE Product ( product_id INTEGER...
SELECT problem_id, problem_log_id FROM Staff AS T1 JOIN Problem_Log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = "Rylan" AND T1.staff_last_name = "Homenick"
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, ...
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9566)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe...
mimic_iii
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor ORDER BY decor DESC
nvbench
CREATE TABLE table_39600 ( "District" text, "Name" text, "Party" text, "Hometown" text, "First Elected" real, "Towns Represented" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which towns are represented in district 31?
SELECT "Towns Represented" FROM table_39600 WHERE "District" = '31'
wikisql
CREATE TABLE table_name_1 ( streak VARCHAR, location_attendance VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which Streak has a Location/Attendance of staples center, and a Score of 67 89?
SELECT streak FROM table_name_1 WHERE location_attendance = "staples center" AND score = "67–89"
sql_create_context
CREATE TABLE table_10015132_1 ( school_club_team VARCHAR, years_in_toronto VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school did the player that has been in Toronto from 2012-present come from?
SELECT school_club_team FROM table_10015132_1 WHERE years_in_toronto = "2012-present"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) 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...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%BCS%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_21253 ( "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 al...
SELECT "High assists" FROM table_21253 WHERE "Game" = '12'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-32465')) AND intakeoutput.celllabel = 'outpu...
eicu
CREATE TABLE table_17665 ( "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. -- What is the latest year that 6th, Heartland is regular season?
SELECT MAX("Year") FROM table_17665 WHERE "Regular Season" = '6th, Heartland'
wikisql
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_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '鲁建修' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 4854.45) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '鲁建修' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLI...
css
CREATE TABLE web_client_accelerator ( id VARCHAR, accelerator_id VARCHAR ) CREATE TABLE accelerator_compatible_browser ( id VARCHAR, accelerator_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many accelerators are not compatible with the brow...
SELECT COUNT(*) FROM web_client_accelerator WHERE NOT id IN (SELECT accelerator_id FROM accelerator_compatible_browser)
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL)) AND medication.drugname...
eicu
CREATE TABLE table_name_43 ( governments VARCHAR, term_start VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What governments did the minister with a term start on 24 September 1984 have?
SELECT governments FROM table_name_43 WHERE term_start = "24 september 1984"
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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, ...
SELECT AVG(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4991184' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-07-04' AND '2020-04-04'
css
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 COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-116961')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.c...
eicu
CREATE TABLE table_4986 ( "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. -- How long was the match with Jaime Fletcher?
SELECT "Time" FROM table_4986 WHERE "Opponent" = 'jaime fletcher'
wikisql
CREATE TABLE table_29163303_1 ( partner VARCHAR, year VARCHAR, surface VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was Bob Bryan's partner/s on a hard surface in 2003?
SELECT partner FROM table_29163303_1 WHERE year = 2003 AND surface = "Hard"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_i...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE table_72058 ( "Player" text, "Solo" real, "Total" real, "Sacks" text, "Fumble force" real, "Fumble rec" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many forced fumbles for jim laney with under 2 solo tackles?
SELECT COUNT("Fumble force") FROM table_72058 WHERE "Solo" < '2' AND "Player" = 'jim laney'
wikisql
CREATE TABLE table_28367242_1 ( corporate_name VARCHAR, area__km²_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the corporation with an area of 15.63 km?
SELECT corporate_name FROM table_28367242_1 WHERE area__km²_ = "15.63"
sql_create_context
CREATE TABLE table_32939 ( "name" text, "pos." text, "caps" real, "goals" real, "club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many goals did sture m rtensson score?
SELECT "goals" FROM table_32939 WHERE "name" = 'sture mårtensson'
wikisql
CREATE TABLE table_21011 ( "Date" text, "Time" text, "ACC Team" text, "Big Ten Team" text, "Location" text, "Television" text, "Attendance" real, "Winner" text, "Challenge Leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wa...
SELECT "Winner" FROM table_21011 WHERE "Attendance" = '16597'
wikisql
CREATE TABLE table_10842344_1 ( no_in_season INTEGER, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the latest episode in a season where the U.S. viewers totaled 14.37 million?
SELECT MAX(no_in_season) FROM table_10842344_1 WHERE us_viewers__millions_ = "14.37"
sql_create_context
CREATE TABLE table_71641 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the position in a year after 2005 with a class position of 5...
SELECT "Pos." FROM table_71641 WHERE "Year" > '2005' AND "Class Pos." = '5th'
wikisql
CREATE TABLE table_15740666_4 ( current_streak VARCHAR, kansas_state_vs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the current streak against TCU?
SELECT current_streak FROM table_15740666_4 WHERE kansas_state_vs = "TCU"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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, ...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 7698 AND admissions.admission_location = 'transfer from hosp/extram' AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_name_94 ( partner VARCHAR, surface VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Partner, when Surface is Hard, and when Score is 6 3, 7 6(0)?
SELECT partner FROM table_name_94 WHERE surface = "hard" AND score = "6–3, 7–6(0)"
sql_create_context
CREATE TABLE table_name_15 ( attendance VARCHAR, opponent_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Attendance number when the Opponent was purdue?
SELECT attendance FROM table_name_15 WHERE opponent_number = "purdue"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number,...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '27848867' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2004-10-16')
css
CREATE TABLE table_name_80 ( engine VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During the Formula One World Championships, which engine was used in 1965?
SELECT engine FROM table_name_80 WHERE year = 1965
sql_create_context
CREATE TABLE ref_incident_type ( incident_type_code text, incident_type_description text ) CREATE TABLE behavior_incident ( incident_id number, incident_type_code text, student_id number, date_incident_start time, date_incident_end time, incident_summary text, recommendations text, ...
SELECT T1.student_id, T2.first_name FROM student_addresses AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1
spider
CREATE TABLE table_65817 ( "Event" text, "Time" text, "Nationality" text, "Date" text, "Meet" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location of the Event with a Time of 2:22.32?
SELECT "Location" FROM table_65817 WHERE "Time" = '2:22.32'
wikisql
CREATE TABLE table_3491 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least number in se...
SELECT MIN("No. in season") FROM table_3491 WHERE "Written by" = 'Brad Markowitz, William N. Fordes & René Balcer'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airlin...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHOENIX...
atis
CREATE TABLE table_204_613 ( id number, "title" text, "year" number, "peak chart positions\nus" number, "peak chart positions\nus\nr&b" number, "peak chart positions\nus\nrap" number, "album" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ho...
SELECT COUNT("title") FROM table_204_613 WHERE "year" = 2011
squall
CREATE TABLE table_71926 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the lap with a finish of 24?
SELECT SUM("Laps") FROM table_71926 WHERE "Finish" = '24'
wikisql
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 Faculty_Participates_in ( FacID IN...
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building
nvbench
CREATE TABLE table_name_89 ( tie_no VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tie is from everton?
SELECT tie_no FROM table_name_89 WHERE home_team = "everton"
sql_create_context
CREATE TABLE routes ( rid integer, dst_apid integer, dst_ap varchar(4), src_apid bigint, src_ap varchar(4), alid bigint, airline varchar(4), codeshare text ) CREATE TABLE airports ( apid integer, name text, city text, country text, x real, y real, elevation b...
SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY COUNT(country) DESC
nvbench
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( I...
SELECT Id AS "post_link", LENGTH(Title) AS "no._of_characters" FROM Posts WHERE PostTypeId = 1 ORDER BY 'no._of_characters' DESC LIMIT 100
sede
CREATE TABLE table_203_393 ( id number, "year" number, "film" text, "director" text, "cast" text, "details" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of films produced in the 2000s ?
SELECT COUNT("film") FROM table_203_393 WHERE "year" >= 2000
squall
CREATE TABLE table_name_15 ( erp_w INTEGER, call_sign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average ERP W when the call sign is whre?
SELECT AVG(erp_w) FROM table_name_15 WHERE call_sign = "whre"
sql_create_context
CREATE TABLE table_30133_1 ( gdp_at_constant_prices__thb_trillions_ VARCHAR, current_account_balance__percent_of_gdp_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the GDP at constant prices for a current account balance of 12.8?
SELECT gdp_at_constant_prices__thb_trillions_ FROM table_30133_1 WHERE current_account_balance__percent_of_gdp_ = "12.8"
sql_create_context
CREATE TABLE table_19302 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the candidates in the election where John Beatty was the incumb...
SELECT "Candidates" FROM table_19302 WHERE "Incumbent" = 'John Beatty'
wikisql
CREATE TABLE table_54776 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who drove the renault that went over 23 laps and had a grid under 11?
SELECT "Driver" FROM table_54776 WHERE "Grid" < '11' AND "Constructor" = 'renault' AND "Laps" > '23'
wikisql
CREATE TABLE table_62332 ( "Year" real, "Delegate" text, "Hometown" text, "Pageant" text, "Result" text, "Other awards" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the hometown of rachel muyot soriano?
SELECT "Hometown" FROM table_62332 WHERE "Delegate" = 'rachel muyot soriano'
wikisql
CREATE TABLE table_name_78 ( outcome VARCHAR, championship VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Outcome, when Championship is Australian Open, and when Year is before 1994?
SELECT outcome FROM table_name_78 WHERE championship = "australian open" AND year < 1994
sql_create_context
CREATE TABLE table_65971 ( "Country" text, "1951" real, "1952" real, "1953" real, "1954" real, "1955" real, "1956" real, "1957" real, "1958" real, "1959" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1955 rate when t...
SELECT SUM("1955") FROM table_65971 WHERE "1956" > '2.9' AND "1953" > '4.5'
wikisql
CREATE TABLE table_42563 ( "1861" real, "1866" real, "1872" real, "1876" real, "1881" real, "1886" real, "1891" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of 1886(s), when 1886 is greater than 1070, and when 1891 is less ...
SELECT SUM("1886") FROM table_42563 WHERE "1866" > '1070' AND "1891" < '1946'
wikisql
CREATE TABLE stock ( Shop_ID int, Device_ID int, Quantity int ) CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Dat...
SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform ORDER BY Software_Platform DESC
nvbench
CREATE TABLE table_46970 ( "Municipality" text, "Population" real, "Inhabitants per km\u00b2" real, "Area (in km\u00b2)" real, "Markatal" real, "Island" text, "Region" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Populat...
SELECT SUM("Population") FROM table_46970 WHERE "Markatal" > '48' AND "Inhabitants per km\u00b2" > '24' AND "Municipality" = 'runavík'
wikisql
CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) -- Using valid SQLite, answer the ...
SELECT Author, COUNT(Author) FROM submission GROUP BY Author ORDER BY COUNT(Author)
nvbench
CREATE TABLE table_name_22 ( name VARCHAR, out_of VARCHAR, rank VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Name that has the Rank smaller than 71, and the Year larger than 2005, and the Out of 220?
SELECT name FROM table_name_22 WHERE rank < 71 AND year > 2005 AND out_of = "220"
sql_create_context
CREATE TABLE review ( i_id VARCHAR, rank INTEGER ) CREATE TABLE item ( title VARCHAR, i_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name and id of the good with the highest average rank.
SELECT T1.title, T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rank) DESC LIMIT 1
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT People_ID, Height FROM people GROUP BY Sex
nvbench
CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, PrepNurse INTEGER, Physician INTEGER, Start DATETIME, End DATETIME, ExaminationRoom TEXT ) CREATE TABLE Affiliated_With ( Physician INTEGER, Department INTEGER, PrimaryAffiliation BOOLEAN ) CREATE TABLE Physicia...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID
nvbench
CREATE TABLE table_53668 ( "Constructor" text, "Chassis" text, "Tyre" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the constructor on the team with 8 rounds and a chassis of 156 158 1512?
SELECT "Constructor" FROM table_53668 WHERE "Rounds" = '8' AND "Chassis" = '156 158 1512'
wikisql
CREATE TABLE table_203_239 ( id number, "year" number, "title" text, "chinese title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many movies was she in in 1998 ?
SELECT COUNT("title") FROM table_203_239 WHERE "year" = 1998
squall
CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, resolution number ) CREATE TABLE artist ( artist_na...
SELECT T1.artist_name, COUNT(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3
spider
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_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '34441190' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 8665.65)
css
CREATE TABLE table_24372 ( "Barangay" text, "Population (2000)" real, "Population (2007)" real, "Population (2010)" real, "Barangay Fiesta" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the populati in 2000 for Panlicsian?
SELECT MIN("Population (2000)") FROM table_24372 WHERE "Barangay" = 'Panlicsian'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE i...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND icustays.outtime IS NULL) ...
mimic_iii
CREATE TABLE table_34369 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the rangers' record on Game 14?
SELECT "Record" FROM table_34369 WHERE "Game" = '14'
wikisql
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 GROUP BY date ORDER BY date
nvbench
CREATE TABLE table_10025 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Attendance(s), when Away is Real Juventud?
SELECT COUNT("Attendance") FROM table_10025 WHERE "Away" = 'real juventud'
wikisql
CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DAT...
SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY AVG(Amount_Payment)
nvbench
CREATE TABLE table_52328 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the first set with a third set of 25 21?
SELECT "Set 1" FROM table_52328 WHERE "Set 3" = '25–21'
wikisql
CREATE TABLE table_16174 ( "Serial number" text, "Wheel arrangement ( Whyte notation )" text, "Build date" text, "Operational owner(s)" text, "Disposition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where can you find Colorado and Southern Railw...
SELECT "Disposition" FROM table_16174 WHERE "Operational owner(s)" = 'Colorado and Southern Railway #9'
wikisql
CREATE TABLE table_203_799 ( id number, "year" number, "date" text, "title" text, "format(s)" text, "award description(s)" text, "result(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the last single to win an riaa award ?
SELECT "title" FROM table_203_799 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
SELECT Id, Title, Body, Tags FROM Posts WHERE Id > 2494470 AND PostTypeId = 1 ORDER BY Id
sede
CREATE TABLE table_name_60 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record of the game on February 21, 2008?
SELECT record FROM table_name_60 WHERE date = "february 21, 2008"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.fluid = "Ascites"
mimicsql_data
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 demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.name = "Michael Tyndall"
mimicsql_data
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance...
SELECT Users.Id, Users.DisplayName, COUNT(*) AS answers FROM Posts, Users WHERE ParentId IN (SELECT DISTINCT Posts.Id FROM Posts JOIN PostTags ON PostTags.PostId = Posts.Id WHERE CommunityOwnedDate IS NULL AND ClosedDate IS NULL AND Posts.CreationDate >= '2012-04-30' AND AnswerCount > 0 AND PostTags.TagId IN (4452, 677...
sede
CREATE TABLE table_name_29 ( team__number2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2nd leg of goi s team 2?
SELECT 2 AS nd_leg FROM table_name_29 WHERE team__number2 = "goiás"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, ...
SELECT MIN(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-139111')) AND NOT vitalperiodic.respiration IS...
eicu
CREATE TABLE table_69515 ( "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 "Points" FROM table_69515 WHERE "Club" = 'bridgend athletic rfc'
wikisql