instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
SELECT * 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 = '00134422' AND hz_info.YLJGDM = '0161257' AND zyjzjlb.CYKSMC LIKE '%医学%'
css
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Bod...
SELECT t.TagName, t.Count, t2.TagName, t2.Count FROM Tags AS t, Tags AS t2 WHERE t.TagName = REPLACE(t2.TagName, '-', '.') AND t.Id != t2.Id ORDER BY t.TagName
sede
CREATE TABLE table_name_65 ( crowd INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At Junction Oval, what is the sum of the crowd?
SELECT SUM(crowd) FROM table_name_65 WHERE venue = "junction oval"
sql_create_context
CREATE TABLE table_37836 ( "District" text, "District Headquarters" text, "Area (km 2 .)" real, "Population 1991 Census" real, "Population 2001 Census" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many km2 has a Population 2001 Census larger t...
SELECT COUNT("Area (km 2 .)") FROM table_37836 WHERE "Population 2001 Census" > '274,095' AND "District Headquarters" = 'jharsuguda'
wikisql
CREATE TABLE table_9243 ( "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 census ranking for the community with an area smaller than 9.94 km2 and a...
SELECT "Census Ranking" FROM table_9243 WHERE "Area km 2" < '9.94' AND "Population" < '817'
wikisql
CREATE TABLE table_26477 ( "World record" text, "Jarmila Kratochv\u00edlov\u00e1 ( TCH )" text, "1:53.28" text, "Munich , West Germany" text, "26 July 1983" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the world record is the African record, wh...
SELECT COUNT("1:53.28") FROM table_26477 WHERE "World record" = 'African record'
wikisql
CREATE TABLE table_name_2 ( class VARCHAR, call_sign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the class with call sign of k220cp
SELECT class FROM table_name_2 WHERE call_sign = "k220cp"
sql_create_context
CREATE TABLE STUDENT ( Age VARCHAR, StuID VARCHAR ) CREATE TABLE VOTING_RECORD ( Secretary_Vote VARCHAR, Election_Cycle VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the distinct ages of students who have secretary votes in the fall election c...
SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = "Fall"
sql_create_context
CREATE TABLE table_name_21 ( season VARCHAR, pts VARCHAR, pos VARCHAR, pld VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season had 1st position, 33 pld, and 58 points?
SELECT season FROM table_name_21 WHERE pos = "1st" AND pld = "33" AND pts = "58"
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "40" AND prescriptions.route = "NU"
mimicsql_data
CREATE TABLE table_56004 ( "Player" text, "Team" text, "Opponent" text, "Year" real, "Score" text, "Outcome" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What most recent year had North Melbourne as a team and Hamish Mcintosh as a player?
SELECT MAX("Year") FROM table_56004 WHERE "Team" = 'north melbourne' AND "Player" = 'hamish mcintosh'
wikisql
CREATE TABLE Faculty ( rank VARCHAR, FacID VARCHAR ) CREATE TABLE Student ( advisor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all the faculty ranks and the number of students advised by each rank.
SELECT T1.rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15760) AND DATETIME(procedures_icd.charttime, 'start of year') = DAT...
mimic_iii
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 labevents ( row_id number, subject_id number, hadm_...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE table_27666 ( "GB" text, "ISO \u2116" text, "Province" text, "Chinese Name" text, "Capital" text, "Population\u00b9" real, "Density\u00b2" text, "Area\u00b3" real, "Abbreviation/Symbol" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT COUNT("ISO \u2116") FROM table_27666 WHERE "Density\u00b2" = '165.81'
wikisql
CREATE TABLE table_name_74 ( lost_to VARCHAR, film VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the loss to for the film Chicago?
SELECT lost_to FROM table_name_74 WHERE film = "chicago"
sql_create_context
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '葛歌韵' AND jybg...
css
CREATE TABLE table_204_294 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which opponent comes before usc ?
SELECT "opponent#" FROM table_204_294 WHERE "date" < (SELECT "date" FROM table_204_294 WHERE "opponent#" = 'usc') ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_76323 ( "Episode" text, "First broadcast" text, "Graeme's guest" text, "Jeremy's guest" text, "Votes (%)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Votes (%), when Episode is '1x03'?
SELECT "Votes (%)" FROM table_76323 WHERE "Episode" = '1x03'
wikisql
CREATE TABLE table_name_14 ( draws INTEGER, club VARCHAR, goal_difference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the low number of draws for Levante Ud when their goal difference was smaller than 6?
SELECT MIN(draws) FROM table_name_14 WHERE club = "levante ud" AND goal_difference < 6
sql_create_context
CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE repair ( repair_ID int, name text, ...
SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_28251 ( "No." real, "#" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Prod. code" real, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote episode 6 in...
SELECT "Writer(s)" FROM table_28251 WHERE "#" = '6'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dob_year < "2109"
mimicsql_data
CREATE TABLE table_name_55 ( keys__x_modes_ VARCHAR, supplier VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which keys (x modes) have a Supplier of wolfking?
SELECT keys__x_modes_ FROM table_name_55 WHERE supplier = "wolfking"
sql_create_context
CREATE TABLE table_204_909 ( id number, "pollutant" text, "units" text, "emission standard" number, "coal-fired" text, "petroleum coke-fired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which pollutant has the least amount of petroleum coke f...
SELECT "pollutant" FROM table_204_909 ORDER BY "petroleum coke-fired" LIMIT 1
squall
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'neutrophils') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59049) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TI...
mimic_iii
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "HEMOPYTSIS" AND prescriptions.route = "PO/NG"
mimicsql_data
CREATE TABLE table_66862 ( "Player" text, "Years" text, "Goals" real, "Assists" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total points does Mike Hyndman have with more than 119 assists?
SELECT SUM("Points") FROM table_66862 WHERE "Player" = 'mike hyndman' AND "Assists" > '119'
wikisql
CREATE TABLE table_name_94 ( place VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the place when the event is 4000 m individual pursuit?
SELECT place FROM table_name_94 WHERE event = "4000 m individual pursuit"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), ...
SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME
nvbench
CREATE TABLE table_22623 ( "Country" text, "TV Network(s)" text, "Series Premiere" text, "Weekly Schedule" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every weekly schedule in the country of Norway?
SELECT "Weekly Schedule" FROM table_22623 WHERE "Country" = 'Norway'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.admityear < "2187"
mimicsql_data
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 zyjzjlb.MZBMLX, zyjzjlb.MZZDBM, zyjzjlb.MZZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '94773706571'
css
CREATE TABLE table_name_7 ( time_retired VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time or retired does Scott Dixon have?
SELECT time_retired FROM table_name_7 WHERE driver = "scott dixon"
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE days ( days_code varchar, day_name varchar...
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 (((flight.departure_time <= 1200 AND flight.departure_time >= 1400) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight...
atis
CREATE TABLE affected_region ( region_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many regions are affected?
SELECT COUNT(DISTINCT region_id) FROM affected_region
sql_create_context
CREATE TABLE table_24718 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different outcomes of th...
SELECT COUNT("Outcome") FROM table_24718 WHERE "Championship" = 'French Championships'
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.admission_type = "EMERGENCY" AND lab.label = "Acetaminophen"
mimicsql_data
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 patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-52724') AND STRFTIME('%y', patient.unitadmittime) >= '2105' ORDER BY patient.unitadmittime LIMIT 1
eicu
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 zyjybgb.KSBM, zyjybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '32152549' AND zyjybgb.BGRQ BETWEEN '2015-03-23...
css
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, ...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 86206 AND admissions.admission_location = 'phys referral/normal deli' ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'furosemide' AND STRFTIME('%y', prescriptions.startdate) >= '2104'
mimic_iii
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.days_stay = "17"
mimicsql_data
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(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'congestive heart failure' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2104') AS t1 JOIN (SELECT patient....
eicu
CREATE TABLE table_75357 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the ERP W for frequency of 92.7
SELECT "ERP W" FROM table_75357 WHERE "Frequency MHz" = '92.7'
wikisql
CREATE TABLE table_name_20 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who attended the school in 2007, that Kiara Spivey attended in 2008?
SELECT 2007 FROM table_name_20 WHERE 2008 = "kiara spivey"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varc...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY)
nvbench
CREATE TABLE table_name_83 ( date VARCHAR, athlete VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day did Chris Maddocks compete in the 35000 m?
SELECT date FROM table_name_83 WHERE athlete = "chris maddocks" AND event = "35000 m"
sql_create_context
CREATE TABLE table_32494 ( "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 crowd size of the game at Brunswick ...
SELECT SUM("Crowd") FROM table_32494 WHERE "Venue" = 'brunswick street oval'
wikisql
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2145" AND diagnoses.icd9_code = "58089"
mimicsql_data
CREATE TABLE table_37219 ( "Disaster" text, "Type" text, "Location" text, "Deaths" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of disaster is rms atlantic categorized in that was located in Nova Scotia?
SELECT "Type" FROM table_37219 WHERE "Location" = 'nova scotia' AND "Disaster" = 'rms atlantic'
wikisql
CREATE TABLE table_60769 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what stadium was the friendly match on 2 June 1992 played in?
SELECT "Venue" FROM table_60769 WHERE "Competition" = 'friendly match' AND "Date" = '2 june 1992'
wikisql
CREATE TABLE table_26493520_3 ( rank_on_channel VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the rank on channel for january 21, 2011
SELECT rank_on_channel FROM table_26493520_3 WHERE original_air_date = "January 21, 2011"
sql_create_context
CREATE TABLE table_77627 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyres" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is driver of the d6 chassis?
SELECT "Driver" FROM table_77627 WHERE "Chassis" = 'd6'
wikisql
CREATE TABLE table_204_841 ( id number, "no." number, "temple" text, "honzon (main image)" text, "city/town/village" text, "prefecture" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the last city/town/village listed in the table ?
SELECT "city/town/village" FROM table_204_841 ORDER BY "no." DESC LIMIT 1
squall
CREATE TABLE table_17288845_7 ( game INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the game that was played on January 19?
SELECT MAX(game) FROM table_17288845_7 WHERE date = "January 19"
sql_create_context
CREATE TABLE table_39083 ( "Team" text, "Recopa 1994" text, "Supercopa 1994" text, "CONMEBOL 1994" text, "Copa Libertadores 1995" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Supercopa 1994 has a Team of estudiantes?
SELECT "Supercopa 1994" FROM table_39083 WHERE "Team" = 'estudiantes'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE date_day ...
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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND days.day_name = 'WEDNESDAY' AND flight.flight_days = days.days_code...
atis
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE COURSE ( CRS_CODE...
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY SUM(CRS_CREDIT)
nvbench
CREATE TABLE table_14324 ( "Name" text, "Type" text, "Inaug." real, "No Blocks" real, "No Units" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of Inaug., when the Type is Public, when the Name is Mei Lam Estate, and when the No U...
SELECT COUNT("Inaug.") FROM table_14324 WHERE "Type" = 'public' AND "Name" = 'mei lam estate' AND "No Units" > '4,156'
wikisql
CREATE TABLE table_name_5 ( game INTEGER, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of games with a record of 20-12?
SELECT AVG(game) FROM table_name_5 WHERE record = "20-12"
sql_create_context
CREATE TABLE table_11926114_1 ( rank VARCHAR, finale VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of finale 37?
SELECT rank FROM table_11926114_1 WHERE finale = 37
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.icd9_code = "9955"
mimicsql_data
CREATE TABLE table_1939367_1 ( arabs_2001 INTEGER, _percentage_2001 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If %2001 is 0.1%, what is the minimum Arabs 2001 number?
SELECT MIN(arabs_2001) FROM table_1939367_1 WHERE _percentage_2001 = "0.1%"
sql_create_context
CREATE TABLE user_profiles ( name VARCHAR, email VARCHAR, uid VARCHAR ) CREATE TABLE follows ( f1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name and email for the users who have more than one follower.
SELECT T1.name, T1.email FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING COUNT(*) > 1
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
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 = 1902)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe...
mimic_iii
CREATE TABLE table_8142 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" text, "Song" text, "Artist" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the volume:issue of Sheryl Crow with 3 weeks on top?
SELECT "Volume:Issue" FROM table_8142 WHERE "Weeks on Top" = '3' AND "Artist" = 'sheryl crow'
wikisql
CREATE TABLE table_1140116_5 ( race_name VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the race in the Modena circuit?
SELECT race_name FROM table_1140116_5 WHERE circuit = "Modena"
sql_create_context
CREATE TABLE table_name_64 ( attendance INTEGER, opponent VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest attendance for the opponents Club Brugge in Venue A?
SELECT MAX(attendance) FROM table_name_64 WHERE opponent = "club brugge" AND venue = "a"
sql_create_context
CREATE TABLE table_17874 ( "No" real, "Player" text, "Height" text, "Position" text, "Year born" real, "Current Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's height with position being center and year born being bigger than 1980.0
SELECT "Height" FROM table_17874 WHERE "Position" = 'Center' AND "Year born" > '1980.0'
wikisql
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 Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Manufacturer) DESC
nvbench
CREATE TABLE table_name_64 ( venue VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue hosted the Los Angeles Rams as an opponent?
SELECT venue FROM table_name_64 WHERE opponent = "los angeles rams"
sql_create_context
CREATE TABLE table_204_386 ( id number, "res." text, "record" text, "opponent" text, "method" text, "event" text, "date" text, "round" number, "time" text, "location" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT MIN("time") FROM table_204_386 WHERE "res." = 'win'
squall
CREATE TABLE table_18865 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" text, "Time" text, "Jockey" text, "Winner/2nd" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was ...
SELECT "Jockey" FROM table_18865 WHERE "Venue" = 'Rosehill' AND "Weight (kg)" = '57.5'
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 WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT "
mimicsql_data
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 ( ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE ref_characteristic_types ( characteristic_type_code text, characteristic_type_description text ) CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, unit_of_measure text ) CREATE TABLE product_characteristics ( product_id number, ...
SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "fast"
spider
CREATE TABLE weather ( date text, max_temperature_f number, mean_temperature_f number, min_temperature_f number, max_dew_point_f number, mean_dew_point_f number, min_dew_point_f number, max_humidity number, mean_humidity number, min_humidity number, max_sea_level_pressure_inc...
SELECT AVG(bikes_available) FROM status WHERE NOT station_id IN (SELECT id FROM station WHERE city = "Palo Alto")
spider
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diagnoses ( row_id n...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 40 AND 49) AND DATETIME(labevents.chartti...
mimic_iii
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.gender = "M" AND lab.itemid = "51146"
mimicsql_data
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Na...
SELECT * FROM Posts WHERE OwnerUserId = 119890 AND PostTypeId = 1
sede
CREATE TABLE table_17899 ( "Unit" text, "Type" text, "Net power" text, "Total power" text, "Construction start" text, "Construction finish" text, "Commercial operation" text, "Shut down" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Whe...
SELECT "Construction start" FROM table_17899 WHERE "Net power" = '905 MW' AND "Unit" = 'Chinon B1'
wikisql
CREATE TABLE table_name_72 ( player VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player has a score of 74-74-73-70=291?
SELECT player FROM table_name_72 WHERE score = 74 - 74 - 73 - 70 = 291
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE lab ( labid numbe...
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2105' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_name_32 ( date VARCHAR, visitor VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game where Ottawa was the home team and Atlanta is the visiting team?
SELECT date FROM table_name_32 WHERE visitor = "atlanta" AND home = "ottawa"
sql_create_context
CREATE TABLE table_26591309_3 ( official_barb_ratings VARCHAR, episode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the BARB ratings of episode 6?
SELECT official_barb_ratings FROM table_26591309_3 WHERE episode = 6
sql_create_context
CREATE TABLE table_name_17 ( attendance INTEGER, date VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest attendance of February 7, 2009 and more than 49 points?
SELECT MAX(attendance) FROM table_name_17 WHERE date = "february 7, 2009" AND points > 49
sql_create_context
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter
nvbench
CREATE TABLE table_name_68 ( silver INTEGER, gold INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least amount of silver medals a team with less than 0 gold medals has?
SELECT MIN(silver) FROM table_name_68 WHERE gold < 0
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body t...
SELECT t.NAME AS TableName, CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00 / 1024.00), 2) AS FLOAT(36, 2)) AS UsedSpaceGB FROM sys.tables AS t INNER JOIN sys.indexes AS i ON t.OBJECT_ID = i.object_id INNER JOIN sys.partitions AS p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id INNER JOIN sys.allocation_units A...
sede
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
SELECT MIN(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 = '009-12985')) AND intakeoutput.celllabel = 'urine...
eicu
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ...
SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, date_day, days, flight WHERE ((city.city_code = airport_service.city_code AND city.city_name = 'LAS VEGAS' AND date_day.day_number = 2 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days...
atis
CREATE TABLE table_1272033_1 ( previous_champion_s_ VARCHAR, champion_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the champion prior to Xix Xavant?
SELECT previous_champion_s_ FROM table_1272033_1 WHERE champion_s_ = "Xix Xavant"
sql_create_context
CREATE TABLE table_67716 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which is the method under the event Jungle Fight 2?
SELECT "Method" FROM table_67716 WHERE "Event" = 'jungle fight 2'
wikisql
CREATE TABLE table_name_81 ( to_par VARCHAR, place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player was place of t1 in To Par and had a score of 70-73-69=212?
SELECT to_par FROM table_name_81 WHERE place = "t1" AND score = 70 - 73 - 69 = 212
sql_create_context
CREATE TABLE table_name_86 ( nominee VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the nominee for best director?
SELECT nominee FROM table_name_86 WHERE category = "best director"
sql_create_context
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 prescriptions ( subject_id text, hadm_id...
SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.subject_id = "18112"
mimicsql_data
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '015-23047' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE table_name_62 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2011 value that has a 2r in 2008 and a 4r in 2012?
SELECT 2011 FROM table_name_62 WHERE 2008 = "2r" AND 2012 = "4r"
sql_create_context
CREATE TABLE table_name_51 ( year VARCHAR, name VARCHAR, floors VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years have a Name of tour quartier des spectacles, and Floors smaller than 31?
SELECT COUNT(year) FROM table_name_51 WHERE name = "tour quartier des spectacles" AND floors < 31
sql_create_context