instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_65412 ( "Region" text, "Date" text, "Format" text, "Label" text, "Edition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Avex Entertainment release a CD?
SELECT "Date" FROM table_65412 WHERE "Format" = 'cd' AND "Label" = 'avex entertainment'
wikisql
CREATE TABLE table_name_63 ( venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the 05/09/1973 venue?
SELECT venue FROM table_name_63 WHERE date = "05/09/1973"
sql_create_context
CREATE TABLE table_73907 ( "Municipality" text, "No. of Barangays" real, "Area (km\u00b2)" text, "Population (2010)" real, "Pop. density (per km\u00b2)" text, "Income Class (2004)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the populati...
SELECT "Pop. density (per km\u00b2)" FROM table_73907 WHERE "Municipality" = 'Abra de Ilog'
wikisql
CREATE TABLE table_39403 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many picks have an Overall of 114?
SELECT COUNT("Pick #") FROM table_39403 WHERE "Overall" = '114'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.B...
css
CREATE TABLE table_name_50 ( character VARCHAR, actor_actress VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What character did actor Damien Richardson play?
SELECT character FROM table_name_50 WHERE actor_actress = "damien richardson"
sql_create_context
CREATE TABLE table_name_64 ( city_of_license VARCHAR, call_sign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which City of license has a Call sign of w220ba?
SELECT city_of_license FROM table_name_64 WHERE call_sign = "w220ba"
sql_create_context
CREATE TABLE table_name_38 ( total_score_week VARCHAR, status VARCHAR, scores_by_each_individual_judge VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Total score/week has a Status of eliminated, and Scores by each individual judge of 5 + 5 + 4 = 14...
SELECT total_score_week FROM table_name_38 WHERE status = "eliminated" AND scores_by_each_individual_judge = 5 + 5 + 4 = 14
sql_create_context
CREATE TABLE table_25635 ( "Season" text, "Junior (South) Winners" text, "Intermediate (South) Winners" text, "Minor (South) Winners" text, "Primary (South) Winners" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What isthe minor (South) winners tot...
SELECT COUNT("Minor (South) Winners") FROM table_25635 WHERE "Primary (South) Winners" = 'Mendip Gate'
wikisql
CREATE TABLE table_name_80 ( result VARCHAR, year VARCHAR, awards VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result at the Berlin International Film Festival in a year greater than 1987?
SELECT result FROM table_name_80 WHERE year > 1987 AND awards = "berlin international film festival"
sql_create_context
CREATE TABLE table_225205_4 ( successor VARCHAR, reason_for_change VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the successor when the reason for change is died November 11, 1845?
SELECT successor FROM table_225205_4 WHERE reason_for_change = "Died November 11, 1845"
sql_create_context
CREATE TABLE table_24938621_3 ( no VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What episode number was written by Gregg Hurwitz?
SELECT no FROM table_24938621_3 WHERE written_by = "Gregg Hurwitz"
sql_create_context
CREATE TABLE table_76357 ( "Year of release" real, "Title" text, "Label" text, "Format" text, "Cat. No." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total year of release of the title what goes around comes around?
SELECT COUNT("Year of release") FROM table_76357 WHERE "Title" = 'what goes around comes around'
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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE...
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2103' GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4
mimic_iii
CREATE TABLE table_59416 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which golfer finished with a score of 70-71=141?
SELECT "Player" FROM table_59416 WHERE "Score" = '70-71=141'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
SELECT p.Id AS "post_link", p.Title FROM Posts AS p LEFT JOIN PostTags AS pt ON p.Id = pt.PostId LEFT JOIN Tags AS t ON pt.TagId = t.Id LEFT JOIN PostTags AS pt2 ON p.Id = pt2.PostId LEFT JOIN Tags AS t2 ON pt2.TagId = t2.Id WHERE PostTypeId = 1 AND t.TagName = 'raw' AND t2.TagName = '##tag:string##' ORDER BY ViewCount...
sede
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Manufacturer, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
CREATE TABLE table_name_16 ( week VARCHAR, finalist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the week when the finalist is marcelo r os?
SELECT week FROM table_name_16 WHERE finalist = "marcelo ríos"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8005) AND microbiologyevents.spec_type_desc = 'serology/blood' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y', microbiologyevents.charttime) <= '2104' O...
mimic_iii
CREATE TABLE mzjybgb ( 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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'M60.726' AND jyjgzbb.JCZBMC = 'D2聚体(柠檬酸盐)' UNION SELECT jyjgzbb....
css
CREATE TABLE table_9245 ( "Official Name" text, "Status" text, "Area km 2" real, "Population" real, "Census Ranking" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status for Pointe-Verte, with a population smaller than 1,137?
SELECT "Status" FROM table_9245 WHERE "Population" < '1,137' AND "Official Name" = 'pointe-verte'
wikisql
CREATE TABLE Customer_Payments ( customer_id INTEGER, datetime_payment DATETIME, payment_method_code VARCHAR(10), amount_payment DOUBLE ) CREATE TABLE Vehicles ( vehicle_id INTEGER, vehicle_details VARCHAR(255) ) CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCH...
SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY payment_method_code DESC
nvbench
CREATE TABLE table_name_89 ( artist VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What artist's song was performed in the week with theme of Billboard #1?
SELECT artist FROM table_name_89 WHERE theme = "billboard #1"
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.dob_year < "2200" AND lab.itemid = "50882"
mimicsql_data
CREATE TABLE table_name_18 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the Home team fitzroy?
SELECT date FROM table_name_18 WHERE home_team = "fitzroy"
sql_create_context
CREATE TABLE table_73059 ( "Province" text, "Capital" text, "Area (km\u00b2)" text, "Population" real, "Density" real, "Map region" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when province is monse or nouel, what is the area (km )?
SELECT "Area (km\u00b2)" FROM table_73059 WHERE "Province" = 'Monseñor Nouel'
wikisql
CREATE TABLE table_27755784_11 ( high_rebounds VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the high rebounds for 77 game
SELECT high_rebounds FROM table_27755784_11 WHERE game = 77
sql_create_context
CREATE TABLE table_26428602_1 ( absorb__nm_ INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest dye absoprtion in nm?
SELECT MIN(absorb__nm_) FROM table_26428602_1
sql_create_context
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN wdmzjzjlb 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 WHERE person_info.XM = '葛和悦' UNION SELECT bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM person_info JOIN...
css
CREATE TABLE table_38784 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the game with 38,062 people in attendance?
SELECT "Date" FROM table_38784 WHERE "Attendance" = '38,062'
wikisql
CREATE TABLE table_name_2 ( hosts VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the hosts for the 2004 event?
SELECT hosts FROM table_name_2 WHERE year = "2004"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 89840 AND STRFTIME('%y', admissions.dischtime) <= '2104' ORDER BY admissions.dischtime DESC LIMIT 1
mimic_iii
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
nvbench
CREATE TABLE table_28742659_2 ( immunity VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of immunity when the finish is 3rd voted out day 9?
SELECT immunity FROM table_28742659_2 WHERE finish = "3rd voted Out Day 9"
sql_create_context
CREATE TABLE table_name_66 ( population INTEGER, place VARCHAR, code VARCHAR, area__km_2__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Population of Tshepiso with a Code of 70409 or smaller and an Area (km 2) smaller than 5.97?
SELECT MIN(population) FROM table_name_66 WHERE code < 70409 AND area__km_2__ < 5.97 AND place = "tshepiso"
sql_create_context
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state ...
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY AVG(acc_bal)
nvbench
CREATE TABLE table_2190919_1 ( top_10 VARCHAR, avg_finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many teams finished in the top team with an average finish of 23.3?
SELECT COUNT(top_10) FROM table_2190919_1 WHERE avg_finish = "23.3"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
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 = '022-61539')) AND intakeoutput.cellpath LIKE '%output%...
eicu
CREATE TABLE table_204_184 ( id number, "#" number, "title" text, "producer(s)" text, "featured guest(s)" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many tracks are listed in this table ?
SELECT COUNT("title") FROM table_204_184
squall
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'ASIAN' AND COURSE_1.number =...
advising
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 outputevents.charttime 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 = 24547)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ches...
mimic_iii
CREATE TABLE table_13706 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score in the final of the tournament with a ...
SELECT "Score in the final" FROM table_13706 WHERE "Surface" = 'hard'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'bone fracture(s) - sternum')
eicu
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 ILL_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '02828086375'
css
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '袁项明' AND gwyjzb.IN_HOSP_DATE BETWEEN '2020-10-22' AND '2021-08-10' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '袁项明' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2020-10-22' AND '2021-08-10' AND fgwyjzb.CLINIC_TYPE = '住院'
css
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.ethnicity = "WHITE" AND diagnoses.long_title = "Personal history of hodgkin's disease"
mimicsql_data
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 SUM(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.PERSON_NM = '邹萍韵' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-06-01' AND '2001-04-21'
css
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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 ...
SELECT * FROM t_kc21 WHERE t_kc21.PERSON_NM = '戚欣合' AND t_kc21.MED_SER_ORG_NO = '5382017' AND t_kc21.MED_ORG_DEPT_NM LIKE '%肾科%'
css
CREATE TABLE table_17708 ( "Club" text, "Overall Record" text, "Goals For" real, "Goals For Avg." text, "Goals Against" real, "Goals Against Avg." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The Kansas City Wizards had a 9-10-9 record and wha...
SELECT "Goals Against Avg." FROM table_17708 WHERE "Overall Record" = '9-10-9'
wikisql
CREATE TABLE fgwyjzb ( 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 gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '1885024' AND t_kc22.SOC_SRT_DIRE_NM = '木丹颗粒' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.MED_SER_ORG_NO = '1885024' AND t_kc22.SOC_SRT_DI...
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE table_name_25 ( elevated VARCHAR, cardinalatial_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's listed for the Elevated with a Cardinalatial title of Priest of S. Eusebio and Archbishop of Benevento?
SELECT elevated FROM table_name_25 WHERE cardinalatial_title = "priest of s. eusebio and archbishop of benevento"
sql_create_context
CREATE TABLE table_name_98 ( attendance INTEGER, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least attendance with visitor of edmonton
SELECT MIN(attendance) FROM table_name_98 WHERE visitor = "edmonton"
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE...
SELECT DISTINCT fare_basis_code FROM fare_basis
atis
CREATE TABLE table_name_82 ( group VARCHAR, distance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What group has 1200 m as the distance?
SELECT group FROM table_name_82 WHERE distance = "1200 m"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '027-68991' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.unitadmittime) <= '2104'
eicu
CREATE TABLE table_name_54 ( location_attendance VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the location and attendance at the game when the record was 9-6?
SELECT location_attendance FROM table_name_54 WHERE record = "9-6"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, dept_code text, stu_phone text, prof_num number ) CREATE TABLE department ( dept_code text, de...
SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology'
spider
CREATE TABLE table_42891 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament was on 2 October 2006?
SELECT "Tournament" FROM table_42891 WHERE "Date" = '2 october 2006'
wikisql
CREATE TABLE table_47046 ( "Squad No." real, "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "FLT Apps" text, "FLT Goals" real, "Playoff Apps" text, "Playo...
SELECT SUM("Total Goals") FROM table_47046 WHERE "Playoff Apps" = '2' AND "FA Cup Apps" = '2' AND "League Cup Goals" < '0'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 44848 AND STRFTIME('%y', admissions.admittime) = '2105'
mimic_iii
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 patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-76924' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1) ...
eicu
CREATE TABLE table_48561 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the event Kage Kombat 16?
SELECT "Location" FROM table_48561 WHERE "Event" = 'kage kombat 16'
wikisql
CREATE TABLE table_name_61 ( record VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What record has @ detroit as the opponent?
SELECT record FROM table_name_61 WHERE opponent = "@ detroit"
sql_create_context
CREATE TABLE table_44962 ( "Name" text, "Built" text, "Listed" text, "Location" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the historic place that was built in 1910?
SELECT "Location" FROM table_44962 WHERE "Built" = '1910'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND procedures.icd9_code = "3808"
mimicsql_data
CREATE TABLE table_name_66 ( award VARCHAR, result VARCHAR, film VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Award, when Result is 'Nominated', and when Film is 'Sankranthi'?
SELECT award FROM table_name_66 WHERE result = "nominated" AND film = "sankranthi"
sql_create_context
CREATE TABLE table_name_75 ( capacity INTEGER, year_opened VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest capacity for 1903?
SELECT MIN(capacity) FROM table_name_75 WHERE year_opened = "1903"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "4589"
mimicsql_data
CREATE TABLE table_name_25 ( length VARCHAR, junctions VARCHAR, route_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the length of the highway with junctions i-35 us 83 and named us 83 bus.?
SELECT length FROM table_name_25 WHERE junctions = "i-35 us 83" AND route_name = "us 83 bus."
sql_create_context
CREATE TABLE table_68933 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record with opponent of christian nielson
SELECT "Record" FROM table_68933 WHERE "Opponent" = 'christian nielson'
wikisql
CREATE TABLE table_56992 ( "Name" text, "Latitude" real, "Longitude" real, "Diameter (km)" real, "Named after" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the named after for diameter less than 19.2 and latitude more than -37.5 with longi...
SELECT "Named after" FROM table_56992 WHERE "Diameter (km)" < '19.2' AND "Latitude" > '-37.5' AND "Longitude" < '67.3'
wikisql
CREATE TABLE table_test_9 ( "id" int, "ejection_fraction_ef" int, "anemia" bool, "child_pugh_class" string, "systolic_blood_pressure_sbp" int, "leukopenia" int, "heart_disease" bool, "stroke" bool, "av_block" bool, "renal_disease" bool, "hepatic_disease" bool, "estimated_...
SELECT * FROM table_test_9 WHERE leukopenia = 1 OR anemia = 1 OR hepatic_disease = 1 OR renal_disease = 1 OR malignancy = 1
criteria2sql
CREATE TABLE qtb ( 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.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '54503411' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 5443.41) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '54503411' AND gyb.MED_CLINIC_ID IN (SELECT t_kc2...
css
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_l...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN program_course WHERE ((course.number < 400 + 100 AND course.number >= 400) OR (course.number < 500 + 100 AND course.number >= 500)) AND course.department = 'UKRAINE' AND program_course.workload = (SELECT MIN(PR...
advising
CREATE TABLE table_name_30 ( date VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the Red Wings home game against Anaheim?
SELECT date FROM table_name_30 WHERE visitor = "anaheim"
sql_create_context
CREATE TABLE table_204_933 ( id number, "year" number, "competition" text, "date" text, "location" text, "opponent" text, "score" text, "result" text, "bye" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games did this team ...
SELECT COUNT(*) FROM table_204_933 WHERE "opponent" = 'spain'
squall
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT Title, Tags FROM Posts AS Question WHERE Question.Tags LIKE '%<java>%'
sede
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 SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2157657' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-01-04' AND '2012-06-01'
css
CREATE TABLE table_6453 ( "Birth" text, "Marriage" text, "Became Duchess" text, "Ceased to be Duchess" text, "Death" text, "Spouse" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Spouse of the Duchess that has a Death on 6 april 1780...
SELECT "Spouse" FROM table_6453 WHERE "Death" = '6 april 1780'
wikisql
CREATE TABLE table_1081459_1 ( introduced INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest introduced value?
SELECT MIN(introduced) FROM table_1081459_1
sql_create_context
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name ...
SELECT DISTINCT airport.airport_code FROM airport, flight WHERE flight.airline_code = 'CP' AND flight.to_airport = airport.airport_code
atis
CREATE TABLE table_66656 ( "Wimmera FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Losses have Draws smaller than 0?
SELECT MAX("Losses") FROM table_66656 WHERE "Draws" < '0'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId ...
SELECT p.Id AS "post_link", c.CreationDate, Tags FROM Comments AS c JOIN Posts AS p ON c.PostId = p.Id WHERE c.Text LIKE '%voting to close%' AND (Tags LIKE '%<email>%' OR Tags LIKE '%<spam>%') AND c.UserId = '##UserId##'
sede
CREATE TABLE table_name_69 ( away_captain VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the away captain with result of wi by 9 wkts
SELECT away_captain FROM table_name_69 WHERE result = "wi by 9 wkts"
sql_create_context
CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_da...
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY Owner
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2139" AND lab.label = "Base Excess"
mimicsql_data
CREATE TABLE table_name_6 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date has a score of 2-1?
SELECT date FROM table_name_6 WHERE score = "2-1"
sql_create_context
CREATE TABLE table_1342370_41 ( result VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result in the election where the incumbent was Finis J. Garrett?
SELECT result FROM table_1342370_41 WHERE incumbent = "Finis J. Garrett"
sql_create_context
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time...
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 DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ...
atis
CREATE TABLE table_15081939_4 ( swimsuit VARCHAR, evening_gown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the swimsuit score for the item that has 7.61 as evening gown
SELECT swimsuit FROM table_15081939_4 WHERE evening_gown = "7.61"
sql_create_context
CREATE TABLE table_name_58 ( friendly VARCHAR, germany VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the friendly game for Germany of France?
SELECT friendly FROM table_name_58 WHERE germany = "france"
sql_create_context
CREATE TABLE table_54586 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NBA draft result of the player from Washington, DC?
SELECT "NBA Draft" FROM table_54586 WHERE "Hometown" = 'washington, dc'
wikisql
CREATE TABLE table_name_62 ( points VARCHAR, difference VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points have a difference of 23, with a drawn less than 5?
SELECT COUNT(points) FROM table_name_62 WHERE difference = "23" AND drawn < 5
sql_create_context
CREATE TABLE table_name_65 ( score VARCHAR, dance VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the team that danced a jive and was safe?
SELECT score FROM table_name_65 WHERE dance = "jive" AND result = "safe"
sql_create_context
CREATE TABLE table_79857 ( "Title" text, "Producer(s)" text, "Artist(s)" text, "Time" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who produced 'Fast Life'?
SELECT "Producer(s)" FROM table_79857 WHERE "Title" = 'fast life'
wikisql
CREATE TABLE table_2850912_12 ( player VARCHAR, college_junior_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the players for team bryn s if (sweden).
SELECT player FROM table_2850912_12 WHERE college_junior_club_team = "Brynäs IF (Sweden)"
sql_create_context
CREATE TABLE table_13869651_3 ( frequency VARCHAR, part_number_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the frequency of the model whose part number is ado520biaa5do?
SELECT frequency FROM table_13869651_3 WHERE part_number_s_ = "ADO520BIAA5DO"
sql_create_context
CREATE TABLE table_14875671_1 ( attendance INTEGER, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance in week 8?
SELECT MAX(attendance) FROM table_14875671_1 WHERE week = 8
sql_create_context