instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE countries ( country_name VARCHAR, country_id VARCHAR ) CREATE TABLE locations ( location_id VARCHAR, country_id VARCHAR ) CREATE TABLE departments ( department_id VARCHAR, location_id VARCHAR ) CREATE TABLE employees ( first_name VARCHAR, last_name VARCHAR, employee_i...
SELECT T1.first_name, T1.last_name, T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id
sql_create_context
CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE song ( song_name varchar2(50), artist...
SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY formats DESC
nvbench
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.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug = "Magnesium Oxide"
mimicsql_data
CREATE TABLE table_name_81 ( round INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round has an Opponent of aleksandr pitchkounov?
SELECT MIN(round) FROM table_name_81 WHERE opponent = "aleksandr pitchkounov"
sql_create_context
CREATE TABLE table_name_78 ( points INTEGER, lost INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which average Points has a Lost higher than 20?
SELECT AVG(points) FROM table_name_78 WHERE lost > 20
sql_create_context
CREATE TABLE table_204_672 ( id number, "year" number, "title" text, "label" text, "uk singles chart" number, "u.s. billboard hot 100 chart" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name the top single on the us billboard hot 100 chart ....
SELECT "title" FROM table_204_672 ORDER BY "u.s. billboard hot 100 chart" DESC LIMIT 1
squall
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2109" AND diagnoses.short_title = "Mitral/aortic val insuff"
mimicsql_data
CREATE TABLE table_62551 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What county placed t2 and scored 68-69-68-72=277?
SELECT "Country" FROM table_62551 WHERE "Place" = 't2' AND "Score" = '68-69-68-72=277'
wikisql
CREATE TABLE table_train_11 ( "id" int, "pregnancy_or_lactation" bool, "severe_sepsis" bool, "active_infection" bool, "heart_disease" bool, "body_weight" float, "septic_shock" bool, "serum_aminotransferase_level_alt_ast" int, "NOUSE" float ) -- Using valid SQLite, answer the follow...
SELECT * FROM table_train_11 WHERE body_weight >= 30 AND body_weight <= 90
criteria2sql
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 COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11779)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperature c (ca...
mimic_iii
CREATE TABLE table_50661 ( "Fin. Pos" text, "Car No." text, "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid with a +...
SELECT "Grid" FROM table_50661 WHERE "Time/Retired" = '+6.8359'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, insuranc...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 50 AND 59
mimic_iii
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number,...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 18 AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-2 year'))
mimic_iii
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE ...
mimic_iii
CREATE TABLE table_204_622 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times has this competitor placed 5th or better in competi...
SELECT COUNT(*) FROM table_204_622 WHERE "position" <= 5
squall
CREATE TABLE table_171236_1 ( population VARCHAR, census_ranking VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the population for census ranking 782 of 5,008?
SELECT population FROM table_171236_1 WHERE census_ranking = "782 of 5,008"
sql_create_context
CREATE TABLE table_72465 ( "Name" text, "First operational" text, "Numeral system" text, "Computing mechanism" text, "Programming" text, "Turing complete" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the computing mechanbeingm with name...
SELECT "Computing mechanism" FROM table_72465 WHERE "Name" = 'Atanasoff–Berry Computer (US)'
wikisql
CREATE TABLE table_204_243 ( id number, "year" number, "album" text, "song" text, "duration" text, "artist" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the most recent song on which they collaborated ?
SELECT "song" FROM table_204_243 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_78376 ( "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. -- Where did Fitzroy play as the away team?
SELECT "Venue" FROM table_78376 WHERE "Away team" = 'fitzroy'
wikisql
CREATE TABLE table_80191 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the IATA for Ringway Airport in the United Kingdom?
SELECT "IATA" FROM table_80191 WHERE "Country" = 'united kingdom' AND "Airport" = 'ringway airport'
wikisql
CREATE TABLE table_name_45 ( home VARCHAR, visitor VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team was the home team when Colorado was the visitor and the record became 26 15 9?
SELECT home FROM table_name_45 WHERE visitor = "colorado" AND record = "26–15–9"
sql_create_context
CREATE TABLE table_11793221_4 ( complement VARCHAR, unit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of complement for 4th hanoverian brigade
SELECT COUNT(complement) FROM table_11793221_4 WHERE unit = "4th Hanoverian Brigade"
sql_create_context
CREATE TABLE table_37151 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who owns the station with the frequency FM 92.1?
SELECT "Owner" FROM table_37151 WHERE "Frequency" = 'fm 92.1'
wikisql
CREATE TABLE manufacturer ( manufacturer_id number, open_year number, name text, num_of_factories number, num_of_shops number ) CREATE TABLE furniture_manufacte ( manufacturer_id number, furniture_id number, price_in_dollar number ) CREATE TABLE furniture ( furniture_id number, ...
SELECT SUM(num_of_component) FROM furniture
spider
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 prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Phenylephrine 0.5% Nasal Spray"
mimicsql_data
CREATE TABLE table_10556257_1 ( league_apps VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the league apps for season 1923-24?
SELECT league_apps FROM table_10556257_1 WHERE season = "1923-24"
sql_create_context
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of people whose age is greater than ...
SELECT name FROM person WHERE age > (SELECT MIN(age) FROM person WHERE job = 'engineer') ORDER BY age
spider
CREATE TABLE table_name_62 ( rank INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rank has a Player of matt ruth?
SELECT SUM(rank) FROM table_name_62 WHERE player = "matt ruth"
sql_create_context
CREATE TABLE Skills_Required_To_Fix ( part_fault_id INTEGER, skill_id INTEGER ) CREATE TABLE Maintenance_Contracts ( maintenance_contract_id INTEGER, maintenance_contract_company_id INTEGER, contract_start_date DATETIME, contract_end_date DATETIME, other_contract_details VARCHAR(255) ) CRE...
SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id ORDER BY T1.part_id DESC
nvbench
CREATE TABLE table_name_95 ( fleet_number_s_ VARCHAR, class VARCHAR, quantity_preserved VARCHAR, quantity_made VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Fleet Number(s), when Quantity Preserved is '0', when Quantity Made is 1, and when C...
SELECT fleet_number_s_ FROM table_name_95 WHERE quantity_preserved = "0" AND quantity_made = "1" AND class = "z"
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 fzzmzjzjlb ( HXPLC number, HZ...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '6114875' AND jybgb.BGRQ BETWEEN '2001-06-25' AND '2009-03-18' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 20 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb...
css
CREATE TABLE events ( event_id number, address_id number, channel_id number, event_type_code text, finance_id number, location_id number ) CREATE TABLE locations ( location_id number, other_details text ) CREATE TABLE finances ( finance_id number, other_details text ) CREATE T...
SELECT product_name FROM products ORDER BY product_price DESC LIMIT 1
spider
CREATE TABLE table_36799 ( "Player" text, "Attempts" real, "Yards" real, "Average" real, "Long" real, "Touchdowns" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Yards with an average of less than 4 and the long is 12 with le...
SELECT AVG("Yards") FROM table_36799 WHERE "Average" < '4' AND "Long" = '12' AND "Attempts" < '29'
wikisql
CREATE TABLE table_name_80 ( city VARCHAR, host VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city is the University of Montana located in?
SELECT city FROM table_name_80 WHERE host = "university of montana"
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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.formulary_drug_cd = "HYDR20/100NS"
mimicsql_data
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.diagnosis = "PNEUMONIA" AND procedures.short_title = "Intraop cardiac pacemak"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid numb...
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 = '022-3289')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.cel...
eicu
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE jobs ( job_id int, job_title varchar...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MCDB' AND course.number = 457 AND semester.semester = 'Fall' AND semester.semester_id = course_offering.semester AND semester.year = 2007
advising
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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 t...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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.Y...
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE proced...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 41816) AND prescriptions.drug IN ('magnesium sulfate', 'insulin', 'heparin')
mimic_iii
CREATE TABLE table_23274514_7 ( team VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team for 19-34
SELECT team FROM table_23274514_7 WHERE record = "19-34"
sql_create_context
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
mimic_iii
CREATE TABLE table_36894 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game with a decision of Peeters and a re...
SELECT "Score" FROM table_36894 WHERE "Decision" = 'peeters' AND "Record" = '29–3–11'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC te...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '水天心' AND hz_info.YLJGDM = '5751240' AND zyjzjlb.CYKSMC LIKE '%计生%'
css
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 zyjybgb.KSBM, zyjybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_in...
css
CREATE TABLE table_name_66 ( round VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total round of the tight end position player?
SELECT COUNT(round) FROM table_name_66 WHERE position = "tight end"
sql_create_context
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) 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...
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY AllergyType
nvbench
CREATE TABLE table_36766 ( "Rank" real, "Airport" text, "Code (IATA/ICAO)" text, "Total Cargo (Metric Tonnes)" real, "% Change" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many ranks have a Code (IATA/ICAO) of ord/kord?
SELECT COUNT("Rank") FROM table_36766 WHERE "Code (IATA/ICAO)" = 'ord/kord'
wikisql
CREATE TABLE table_name_56 ( road_team VARCHAR, home_team VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the road team of game 6 with Philadelphia as the home team?
SELECT road_team FROM table_name_56 WHERE home_team = "philadelphia" AND game = "game 6"
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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '范璇子' UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '范璇子'
css
CREATE TABLE table_204_879 ( id number, "year" number, "host / location" text, "division i overall" text, "division i undergraduate" text, "division ii overall" text, "division ii community college" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "division ii community college" FROM table_204_879 GROUP BY "division ii community college" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '7983940' AND qtb.IN_HOSP_DATE BETWEEN '2018-04-25' AND '2019-07-26' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '7983940' AND gyb.IN_HOSP_DATE BETWEEN '2018-04-25' AND '2019-07-26' AND g...
css
CREATE TABLE table_77828 ( "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 Away team got a team score of 12.16 (88)?
SELECT "Away team" FROM table_77828 WHERE "Away team score" = '12.16 (88)'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "PIOG15"
mimicsql_data
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price...
SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier
nvbench
CREATE TABLE table_23473 ( "#" real, "Title" text, "Maneater" text, "Television Premiere" text, "DVD release" text, "Writer" text, "Director" text, "Producer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total number have robe...
SELECT COUNT("#") FROM table_23473 WHERE "Director" = 'Robert Young'
wikisql
CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(5...
SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY AVG(rating) DESC
nvbench
CREATE TABLE table_72315 ( "Year" real, "Population (Region total)" real, "Population (Mareeba)" real, "Population (Atherton)" real, "Population (Herberton)" real, "Population (Eacham)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the...
SELECT MIN("Population (Mareeba)") FROM table_72315
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
SELECT Id AS "post_link", Score, LENGTH(Body) AS Length, CAST(Score AS FLOAT) / LENGTH(Body) AS Ratio, OwnerUserId AS "user_link" FROM Posts ORDER BY CAST(Score AS FLOAT) / LENGTH(Body) DESC
sede
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) 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, g...
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 588
advising
CREATE TABLE table_10217 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What record occurred on April 3?
SELECT "Record" FROM table_10217 WHERE "Date" = 'april 3'
wikisql
CREATE TABLE table_name_90 ( player VARCHAR, birth_date VARCHAR, shirt_no VARCHAR, nationality VARCHAR, height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player that has a Nationality of Turkey, a Height smaller than 183, a shirt no smal...
SELECT player FROM table_name_90 WHERE nationality = "turkey" AND height < 183 AND shirt_no < 19 AND birth_date = "june 27, 1993 (age20)"
sql_create_context
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND procedures.short_title = "Closed bx skin/subq tiss"
mimicsql_data
CREATE TABLE table_32159 ( "Region" text, "Date" real, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the label for US region and catalog of 10008-2
SELECT "Label" FROM table_32159 WHERE "Region" = 'us' AND "Catalog" = '10008-2'
wikisql
CREATE TABLE table_23556 ( "Year" real, "Starts" real, "Wins" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- wh...
SELECT "Team(s)" FROM table_23556 WHERE "Winnings" = '$2,605,05'
wikisql
CREATE TABLE table_7665 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Region with a Catalog of alca-487?
SELECT "Region" FROM table_7665 WHERE "Catalog" = 'alca-487'
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "42833" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReas...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%maharashtra%' OR UPPER(Location) LIKE '%MAHARASHTRA%' OR Location LIKE '%Maharashtra%' ORDER BY Reputation DESC LIMIT 100
sede
CREATE TABLE school_details ( school_id number, nickname text, colors text, league text, class text, division text ) CREATE TABLE school_performance ( school_id number, school_year text, class_a text, class_aa text ) CREATE TABLE school ( school_id number, school text, ...
SELECT denomination FROM school WHERE founded < 1890 INTERSECT SELECT denomination FROM school WHERE founded > 1900
spider
CREATE TABLE table_name_64 ( events INTEGER, wins VARCHAR, cuts_made VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest events when wins is more than 0 and cuts made is more than 14?
SELECT MAX(events) FROM table_name_64 WHERE wins > 0 AND cuts_made > 14
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number,...
SELECT jybgb.KSBM, jybgb.KSMC 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 = '水...
css
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '王傲冬' AND t_kc22.STA_DATE BETWEEN '2004-09-08' AND '2020-02-21' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
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.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.icd9_code = "8604"
mimicsql_data
CREATE TABLE table_11431 ( "Average population (x 1000)" real, "Live births" real, "Deaths" text, "Natural change" real, "Crude birth rate (per 1000)" real, "Crude death rate (per 1000)" real, "Natural change (per 1000)" real ) -- Using valid SQLite, answer the following questions for the ...
SELECT AVG("Crude death rate (per 1000)") FROM table_11431 WHERE "Live births" < '72,400' AND "Crude birth rate (per 1000)" > '10' AND "Average population (x 1000)" = '2,518'
wikisql
CREATE TABLE table_21223 ( "Province" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT "Skip" FROM table_21223 WHERE "Shot Pct." = '88' AND "Province" = 'Alberta'
wikisql
CREATE TABLE table_9569 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the fight against Zaza Tkeshelashvili?
SELECT "Location" FROM table_9569 WHERE "Opponent" = 'zaza tkeshelashvili'
wikisql
CREATE TABLE table_name_15 ( record VARCHAR, visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What record has chicago black hawks as the visitor and march 23 as the date?
SELECT record FROM table_name_15 WHERE visitor = "chicago black hawks" AND date = "march 23"
sql_create_context
CREATE TABLE table_name_24 ( nationality VARCHAR, ship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the nationality of the ship appam?
SELECT nationality FROM table_name_24 WHERE ship = "appam"
sql_create_context
CREATE TABLE table_test_21 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "tachycardia" int, "body_weight" float, "renal_disease" bool, "anaemia" bool, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "cardiogenic_shock" bool, ...
SELECT * FROM table_test_21 WHERE cardiogenic_shock = 1 OR (hypotension = 1 AND systolic_blood_pressure_sbp < 90 AND tachycardia > 100)
criteria2sql
CREATE TABLE table_56714 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team that played against the visiting team ...
SELECT "Home" FROM table_56714 WHERE "Visitor" = 'minnesota'
wikisql
CREATE TABLE table_33958 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date with a resulted score of 130-100?
SELECT "Date" FROM table_33958 WHERE "Score" = '130-100'
wikisql
CREATE TABLE table_6913 ( "Name" text, "Novelty" text, "Status" text, "Authors" text, "Unit" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is varricchio's unit?
SELECT "Unit" FROM table_6913 WHERE "Authors" = 'varricchio'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "45" AND procedures.long_title = "Parenteral infusion of concentrated nutritional substances"
mimicsql_data
CREATE TABLE table_41289 ( "Team" text, "City" text, "State" text, "Home venue" text, "Capacity" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the State with a home venue of suwon sports complex?
SELECT "State" FROM table_41289 WHERE "Home venue" = 'suwon sports complex'
wikisql
CREATE TABLE table_1341843_10 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was featured in the election of charles edward bennett redistricted from 2nd?
SELECT candidates FROM table_1341843_10 WHERE incumbent = "Charles Edward Bennett Redistricted from 2nd"
sql_create_context
CREATE TABLE table_13050822_2 ( leg VARCHAR, stage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of leg for ss17
SELECT COUNT(leg) FROM table_13050822_2 WHERE stage = "SS17"
sql_create_context
CREATE TABLE table_17188 ( "Country" text, "Population" real, "Area (km\u00b2)" real, "GDP (nominal)" text, "GDP per capita (nominal)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many countries has a gdp (nominal) of $29.9 billion?
SELECT COUNT("GDP per capita (nominal)") FROM table_17188 WHERE "GDP (nominal)" = '$29.9 billion'
wikisql
CREATE TABLE table_54672 ( "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. -- How large was the crowd when Carlton was the awa...
SELECT COUNT("Crowd") FROM table_54672 WHERE "Away team" = 'carlton'
wikisql
CREATE TABLE table_name_35 ( pick INTEGER, position VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest pick when the position was OF with the Chicago White Sox?
SELECT MIN(pick) FROM table_name_35 WHERE position = "of" AND team = "chicago white sox"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "0" AND prescriptions.formulary_drug_cd = "D5W1000"
mimicsql_data
CREATE TABLE table_78553 ( "Year" real, "54 holes" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which year is the highest for runner-up Steve Stricker?
SELECT MAX("Year") FROM table_78553 WHERE "Runner(s)-up" = 'steve stricker'
wikisql
CREATE TABLE table_79626 ( "Race" text, "Dist (f)" real, "Course" text, "Class" text, "Prize (\u00a3K)" real, "Odds" text, "Runners" real, "Placing" real, "Margin" text, "Time" text, "Jockey" text, "Trainer" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Margin" FROM table_79626 WHERE "Dist (f)" > '10' AND "Race" = 'king george vi & queen elizabeth stakes'
wikisql
CREATE TABLE table_72232 ( "Country" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country had the swimsuit score 9.67?
SELECT "Country" FROM table_72232 WHERE "Swimsuit" = '9.67'
wikisql
CREATE TABLE table_203_187 ( id number, "conference" text, "bids" number, "record" text, "win %" number, "quarterfinals" number, "semifinals" number, "final" number, "champions" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which ...
SELECT "conference" FROM table_203_187 WHERE "win %" > (SELECT "win %" FROM table_203_187 WHERE "conference" = 'atlantic coast conference')
squall
CREATE TABLE Ref_Incident_Type ( incident_type_description VARCHAR, incident_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the incident type description for the incident type with code 'VIOLENCE'?
SELECT incident_type_description FROM Ref_Incident_Type WHERE incident_type_code = "VIOLENCE"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY Team_ID
nvbench
CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT COUNT(qtb.PERSON_ID) FROM qtb WHERE qtb.MED_SER_ORG_NO = '3091243' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(gyb.PERSON_ID) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3091243' AND gyb.REMOTE_SETTLE_FLG = '异地1' OR gyb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(zyb.PERSON_ID...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE fzzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '38491236' AND jybgb.BGRQ BETWEEN '2013-11-25...
css
CREATE TABLE table_62336 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of Tie no 21?
SELECT "Date" FROM table_62336 WHERE "Tie no" = '21'
wikisql
CREATE TABLE table_204_204 ( id number, "rank" number, "heat" number, "country" text, "cyclists" text, "result" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many teams finished in less than 45 ?
SELECT COUNT(*) FROM table_204_204 WHERE "result" < 45
squall