instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_34316 ( "Model no." text, "Gen." text, "Released" text, "Capacity" text, "Cache" text, "Interface" text, "Feature set" text, "Sector Size" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Cache with a Capacit...
SELECT "Cache" FROM table_34316 WHERE "Capacity" = '600 gb'
wikisql
CREATE TABLE table_23961 ( "Round" real, "Choice" real, "Player" text, "Position" text, "Height" text, "Weight" real, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds did Virginia have?
SELECT "Round" FROM table_23961 WHERE "College" = 'Virginia'
wikisql
CREATE TABLE table_name_51 ( frequency_mhz INTEGER, call_sign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is K236AM's lowest frequency in MHz?
SELECT MIN(frequency_mhz) FROM table_name_51 WHERE call_sign = "k236am"
sql_create_context
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 jybgb.JYJSGH, jybgb.JYJSQM FROM jybgb WHERE jybgb.BGDH = '84803528320'
css
CREATE TABLE table_58645 ( "Season" real, "Date" text, "Winning Driver" text, "Car #" real, "Sponsor" text, "Make" text, "Distance" text, "Avg Speed" text, "Margin of Victory" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th...
SELECT "Margin of Victory" FROM table_58645 WHERE "Make" = 'dodge intrepid'
wikisql
CREATE TABLE table_1015521_2 ( commonwealth_equivalent VARCHAR, rank_in_spanish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What could a spanish coronel be addressed as in the commonwealth military?
SELECT commonwealth_equivalent FROM table_1015521_2 WHERE rank_in_spanish = "Coronel"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_ID = '97231052' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 9587.83)
css
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, ...
SELECT COUNT(Id) FROM Posts WHERE PostTypeId = 1
sede
CREATE TABLE table_20676 ( "State" text, "Preliminary Average" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Semifinal Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the preliminary average for Miss Maryland?
SELECT "Preliminary Average" FROM table_20676 WHERE "State" = 'Maryland'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, ...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31325)) AND DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start o...
mimic_iii
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##CountryName##%') AND Reputation > '##Reputation##' ORDER BY Reputation DESC
sede
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Observation for suspected infectious condition" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, subject_i...
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62983) AND microbiologyevents.spec_type_desc = 'swab' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime) <= DATETIME...
mimic_iii
CREATE TABLE table_name_97 ( record VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Record, when Location Attendance is 'Pepsi Center 19,749'?
SELECT record FROM table_name_97 WHERE location_attendance = "pepsi center 19,749"
sql_create_context
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'TURKISH' AND course.number = 102 AND instructor.name LIKE '%Alicia Stevers%' AND offering_instructor.instructor_id = instructor.instructor_id AND offeri...
advising
CREATE TABLE table_6528 ( "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. -- Record of 9 1 had what game site?
SELECT "Game Site" FROM table_6528 WHERE "Record" = '9–1'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( ...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88191 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'oxymetazoline'
mimic_iii
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
SELECT patient.age FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2182" AND lab.fluid = "Other Body Fluid"
mimicsql_data
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, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
(SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE h...
css
CREATE TABLE table_name_40 ( sport VARCHAR, established VARCHAR, league VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What League of VSL Sport was Established in 1935?
SELECT sport FROM table_name_40 WHERE established = 1935 AND league = "vsl"
sql_create_context
CREATE TABLE table_name_7 ( call_sign VARCHAR, owner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the call sign for the radio owned by astral media?
SELECT call_sign FROM table_name_7 WHERE owner = "astral media"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-73237') AND treatment.treatme...
eicu
CREATE TABLE table_name_92 ( rider VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which rider has a time of +2:11.524?
SELECT rider FROM table_name_92 WHERE time = "+2:11.524"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195316')) AND intakeoutput.cellpath LIKE '%intake...
eicu
CREATE TABLE table_46641 ( "Tournament" text, "Surface" text, "Week" text, "Winners" text, "Finalists" text, "Semifinalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Semifinalists, when Tournament is Rome
SELECT "Semifinalists" FROM table_46641 WHERE "Tournament" = 'rome'
wikisql
CREATE TABLE table_55243 ( "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. -- Name the date with a home team of melbourne
SELECT "Date" FROM table_55243 WHERE "Home team" = 'melbourne'
wikisql
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_62063 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which To par has a Place of t6, and a Player of nick faldo?
SELECT "To par" FROM table_62063 WHERE "Place" = 't6' AND "Player" = 'nick faldo'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "43" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "DIVORCED" AND prescriptions.route = "PR"
mimicsql_data
CREATE TABLE table_name_61 ( number_of_households INTEGER, per_capita_income VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Number of households has Per capita income of $21,571, and a Population smaller than 9,783?
SELECT AVG(number_of_households) FROM table_name_61 WHERE per_capita_income = "$21,571" AND population < 9 OFFSET 783
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate ...
SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS Date, SUM(CASE WHEN u.Reputation > @highRep THEN 1 ELSE 0 END) AS "high_rep_%" FROM Users AS u GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) ORDER BY DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0)
sede
CREATE TABLE table_16346 ( "League" text, "Sport" text, "Country" text, "Season" text, "Games" real, "Average attendance" real, "Total attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total attendance of the leagues in s...
SELECT COUNT("Total attendance") FROM table_16346 WHERE "Season" = '2010'
wikisql
CREATE TABLE table_name_74 ( week VARCHAR, opponent VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week has an Opponent of washington redskins, and an Attendance larger than 56,077?
SELECT COUNT(week) FROM table_name_74 WHERE opponent = "washington redskins" AND attendance > 56 OFFSET 077
sql_create_context
CREATE TABLE movie ( movie_id number, title text, year number, director text, budget_million number, gross_worldwide number ) CREATE TABLE culture_company ( company_name text, type text, incorporated_in text, group_equity_shareholding number, book_club_id text, movie_id ...
SELECT publisher FROM book_club GROUP BY publisher ORDER BY COUNT(*) DESC LIMIT 1
spider
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 COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-22327')
eicu
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.short_title = "Do not resusctate status"
mimicsql_data
CREATE TABLE table_70854 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Winning score on oct 22, 2000?
SELECT "Winning score" FROM table_70854 WHERE "Date" = 'oct 22, 2000'
wikisql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_M...
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '63779804585') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '63779804585') AND JCZBJGDL > (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '63779804585')
css
CREATE TABLE table_19495707_1 ( application VARCHAR, mainly_used_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of application for modeling, computer aided design, animation
SELECT COUNT(application) FROM table_19495707_1 WHERE mainly_used_for = "Modeling, Computer Aided Design, Animation"
sql_create_context
CREATE TABLE table_28298589_4 ( site VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what facility was Pittsburgh's home game played?
SELECT site FROM table_28298589_4 WHERE home_team = "Pittsburgh"
sql_create_context
CREATE TABLE county_public_safety ( County_ID int, Name text, Population int, Police_officers int, Residents_per_officer int, Case_burden int, Crime_rate real, Police_force text, Location text ) CREATE TABLE city ( City_ID int, County_ID int, Name text, White real, ...
SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force
nvbench
CREATE TABLE table_1137694_3 ( grand_prix VARCHAR, winning_constructor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Grand Prix was won by a car constructed by Jordan - Mugen-Honda?
SELECT grand_prix FROM table_1137694_3 WHERE winning_constructor = "Jordan - Mugen-Honda"
sql_create_context
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY Allergy DESC
nvbench
CREATE TABLE table_name_30 ( game INTEGER, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game is the lowest one that has a Record of 11-4?
SELECT MIN(game) FROM table_name_30 WHERE record = "11-4"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, ic...
SELECT SUM(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 = '010-16627')) AND intakeoutput.celllabel = 'urine...
eicu
CREATE TABLE table_2190919_1 ( team_s_ VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What racing team/s had the 92nd position?
SELECT team_s_ FROM table_2190919_1 WHERE position = "92nd"
sql_create_context
CREATE TABLE table_16720 ( "Rnd" real, "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race had...
SELECT "Race" FROM table_16720 WHERE "Pole Position" = 'Nelson Piquet' AND "Location" = 'Nürburgring'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1833407' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-07-26' AND '2011-07-21'
css
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 bdmzjzjlb ( HXPLC number, HZX...
SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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....
css
CREATE TABLE table_name_67 ( date VARCHAR, streak VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the streak at lost 7?
SELECT date FROM table_name_67 WHERE streak = "lost 7"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.itemid = "50806"
mimicsql_data
CREATE TABLE table_24989925_2 ( team_record VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the team's record when they played at Rheinenergiestadion?
SELECT team_record FROM table_24989925_2 WHERE game_site = "RheinEnergieStadion"
sql_create_context
CREATE TABLE table_name_79 ( college VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What College has a Player that is jermaine romans?
SELECT college FROM table_name_79 WHERE player = "jermaine romans"
sql_create_context
CREATE TABLE table_54503 ( "Tournament" text, "Date" text, "City" text, "Country" text, "Surface" text, "Singles champions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Surface will the Venezuela F5 Futures in Caracas be played?
SELECT "Surface" FROM table_54503 WHERE "City" = 'caracas' AND "Tournament" = 'venezuela f5 futures'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTasks (...
SELECT CAST(TIME_TO_STR(Question.CreationDate, '%Y-%m-%d') AS TEXT(7)) AS Month, COUNT(Question.Id) AS Questions, COUNT(NULLIF(AnswerCount, 0)) AS Answers, CONCAT(100 * COUNT(NULLIF(AnswerCount, 0)) / COUNT(1), '%') AS AnswerRate, CONCAT(100 * COUNT(AcceptedAnswerId) / COUNT(1), '%') AS AcceptedRate, SUM(Question.ViewC...
sede
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, ...
SELECT DISTINCT department, description, number FROM course WHERE (department = 'PSYCH' AND number = 877) OR (department = 'PSYCH' AND number = 533)
advising
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mz...
css
CREATE TABLE member ( Country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the most common country across members.
SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_65372 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Qual 2 of a Team of american spirit team johansson and a Best of 59.073?
SELECT "Qual 2" FROM table_65372 WHERE "Team" = 'american spirit team johansson' AND "Best" = '59.073'
wikisql
CREATE TABLE table_22229 ( "Year" real, "Miss Universe Philippines" text, "Binibining Pilipinas-World" text, "Binibining Pilipinas-International" text, "Binibining Pilipinas-Tourism" text, "First runner-up" text, "Second runner-up" text ) -- Using valid SQLite, answer the following questio...
SELECT "Second runner-up" FROM table_22229 WHERE "Binibining Pilipinas-World" = 'Janina San Miguel'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '尤修远' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '拉莫三嗪片') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '尤修远' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID ...
css
CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15), Workshop_Group_ID INTEGER, Product_Description VARCHAR(255), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Other_Product_Service_Details VARCHAR(255) ) CREATE TABLE Products ( Product_ID VARCHAR(100), ...
SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY COUNT(Service_Type_Description)
nvbench
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4746068' GROUP BY t_kc21.OUT_DIAG_DIS_NM
css
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Display a bar chart for how...
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job DESC
nvbench
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 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 = 1784)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label ...
mimic_iii
CREATE TABLE table_name_55 ( poll_source VARCHAR, steve_poizner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What poll had Steve Poizner at 37%?
SELECT poll_source FROM table_name_55 WHERE steve_poizner = "37%"
sql_create_context
CREATE TABLE table_79471 ( "Title" text, "Series" text, "Director" text, "Release date" text, "reissue?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed An Egg Scramble?
SELECT "Director" FROM table_79471 WHERE "Title" = 'an egg scramble'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51200"
mimicsql_data
CREATE TABLE table_24393 ( "City & Nation" text, "First Place" real, "Second Place" real, "Third Place" real, "Total Top 3 Placements" real, "First Place Winning Year(s) (if applicable)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the...
SELECT MIN("Third Place") FROM table_24393
wikisql
CREATE TABLE table_59089 ( "German" text, "Low German" text, "Plautdietsch" text, "Dutch" text, "English" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which English has Dutch of maken?
SELECT "English" FROM table_59089 WHERE "Dutch" = 'maken'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users ORDER BY Reputation DESC
sede
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-42426')) ORDER BY treatment.treatmenttime DESC LIMIT 1
eicu
CREATE TABLE Undergoes ( Patient INTEGER, Procedures INTEGER, Stay INTEGER, DateUndergoes DATETIME, Physician INTEGER, AssistingNurse INTEGER ) CREATE TABLE Block ( BlockFloor INTEGER, BlockCode INTEGER ) CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, Pr...
SELECT T3.Name, COUNT(T3.Name) FROM Physician AS T1 JOIN Affiliated_With AS T2 ON T1.EmployeeID = T2.Physician JOIN Department AS T3 ON T2.Department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1 GROUP BY T3.Name ORDER BY T3.Name
nvbench
CREATE TABLE table_55024 ( "Peak" text, "Height (m)" real, "Prom. (m)" real, "Class" text, "Parent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of Prom in M for Peak great knoutberry hill?
SELECT SUM("Prom. (m)") FROM table_55024 WHERE "Peak" = 'great knoutberry hill'
wikisql
CREATE TABLE table_71493 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Is Upper valley middle school public or private?
SELECT "Authority" FROM table_71493 WHERE "Name" = 'upper valley middle school'
wikisql
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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND diagnoses.icd9_code = "V4364"
mimicsql_data
CREATE TABLE table_29358 ( "Episode No. Episode No. refers to the episodes number in the overall series, whereas Series No. refers to the episodes number in this particular series." real, "Series No." real, "Episode" text, "Director" text, "Writer" text, "Original airdate" text ) -- Using vali...
SELECT "Episode" FROM table_29358 WHERE "Episode No. Episode No. refers to the episodes number in the overall series, whereas Series No. refers to the episodes number in this particular series." = '64'
wikisql
CREATE TABLE table_18831 ( "Club" text, "Played" text, "Won" 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 follo...
SELECT "Played" FROM table_18831 WHERE "Lost" = '8'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '57271172' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2998.53)
css
CREATE TABLE table_17598822_11 ( challenge_cup INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most challenge cup for damon gray
SELECT MAX(challenge_cup) FROM table_17598822_11 WHERE player = "Damon Gray"
sql_create_context
CREATE TABLE table_name_23 ( score VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has notts county as the home team?
SELECT score FROM table_name_23 WHERE home_team = "notts county"
sql_create_context
CREATE TABLE Web_client_accelerator ( id int, name text, Operating_system text, Client text, Connection text ) CREATE TABLE accelerator_compatible_browser ( accelerator_id int, browser_id int, compatible_since_year int ) CREATE TABLE browser ( id int, name text, market_shar...
SELECT Operating_system, COUNT(*) FROM Web_client_accelerator GROUP BY Operating_system ORDER BY COUNT(*)
nvbench
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4813330' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-09-16' AND '2009-07-01' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 5
css
CREATE TABLE table_71882 ( "Representative" text, "Title" text, "Presentation of Credentials" text, "Termination of Mission" text, "Appointed by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the termination of mission date of the represent...
SELECT "Termination of Mission" FROM table_71882 WHERE "Appointed by" = 'franklin pierce' AND "Title" = 'chargé d''affaires'
wikisql
CREATE TABLE table_12428 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Score has a Tournament of tanjung selor, indonesia?
SELECT "Score" FROM table_12428 WHERE "Tournament" = 'tanjung selor, indonesia'
wikisql
CREATE TABLE table_204_718 ( id number, "date" text, "opponent" text, "time" text, "score" text, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who did the raiders play after unh on 10/9/2009 ?
SELECT "opponent" FROM table_204_718 WHERE "date" > (SELECT "date" FROM table_204_718 WHERE "date" = '10/9/2009') ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_name_87 ( year VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year was held in beijing?
SELECT year FROM table_name_87 WHERE venue = "beijing"
sql_create_context
CREATE TABLE table_26588 ( "#" real, "Player" text, "Country" text, "Points" real, "Reset points" real, "Events" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least events for number 7
SELECT MIN("Events") FROM table_26588 WHERE "#" = '7'
wikisql
CREATE TABLE gwyjzb ( 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 COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '2158734' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-03-27' AND '2015-09-07' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 1025.62 UNION SELECT fgwyjzb....
css
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 COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-82318')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce...
eicu
CREATE TABLE table_name_7 ( power__kw_ VARCHAR, branding VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the power of Mom's Radio 101.5 Tacloban?
SELECT power__kw_ FROM table_name_7 WHERE branding = "mom's radio 101.5 tacloban"
sql_create_context
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id 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 t...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE table_2076608_3 ( type VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of school is Cordoba University?
SELECT type FROM table_2076608_3 WHERE school = "Cordoba University"
sql_create_context
CREATE TABLE table_15770 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the To par for dick metz
SELECT "To par" FROM table_15770 WHERE "Player" = 'dick metz'
wikisql
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TAB...
SELECT DISTINCT COUNT(paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Bacterial Wilt' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016
scholar
CREATE TABLE table_6002 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Combination classification" text, "Team classification" text ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT "Mountains classification" FROM table_6002 WHERE "General classification" = 'egoi martínez' AND "Stage" = '9'
wikisql
CREATE TABLE table_name_60 ( treaty_of_cession VARCHAR, colony VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the Treaty of Cession for Karikal Colony?
SELECT treaty_of_cession FROM table_name_60 WHERE colony = "karikal"
sql_create_context