instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id ...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '韩雅柔' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 2215.89)
css
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ...
eicu
CREATE TABLE table_name_97 ( circuit VARCHAR, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the circuit for italian grand prix
SELECT circuit FROM table_name_97 WHERE race = "italian grand prix"
sql_create_context
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.admission_type = "EMERGENCY" AND procedures.long_title = "Endovascular (total) embolization or occlusion of head and neck vessels"
mimicsql_data
CREATE TABLE table_37670 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team had 64 laps and 13 points?
SELECT "Team" FROM table_37670 WHERE "Laps" = '64' AND "Points" = '13'
wikisql
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '18154604' AND t_kc22.STA_DATE BETWEEN '2005-01-07' AND '2016-10-05' AND t_kc21.MED_SER_ORG_NO = '4531182' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_45 ( country VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The winner Arnfinn Bergmann has what under country?
SELECT country FROM table_name_45 WHERE winner = "arnfinn bergmann"
sql_create_context
CREATE TABLE table_26919_7 ( english VARCHAR, aramaic VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- if the aramaic is l m- , what is the english?
SELECT english FROM table_26919_7 WHERE aramaic = "šlām-āʼ"
sql_create_context
CREATE TABLE table_62339 ( "Year" real, "Drivers" text, "Team" text, "Duration/Distance" text, "Race Title" text, "Championship" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who drove in races in 1949?
SELECT "Drivers" FROM table_62339 WHERE "Year" = '1949'
wikisql
CREATE TABLE table_33799 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which event in the 2000 Sydney games was in the category gete wami category:articles with hcards?
SELECT "Event" FROM table_33799 WHERE "Games" = '2000 sydney' AND "Name" = 'gete wami category:articles with hcards'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLin...
SELECT YEAR(p.CreationDate) AS Yr, MONTH(p.CreationDate) AS Mnth, COUNT(DISTINCT p.Id) AS QuestionCount, COUNT(DISTINCT CASE WHEN p.Tags LIKE '%identify%' THEN p.Id ELSE NULL END) AS QuestionCountID, COUNT(v.Id) AS VoteCount, SUM(CASE WHEN p.Tags LIKE '%identify%' AND NOT v.Id IS NULL THEN 1 ELSE 0 END) AS VoteCountID ...
sede
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.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour...
advising
CREATE TABLE table_1341843_19 ( first_elected VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the year of the first election of the district whose incumbent is Edwin E. Willis?
SELECT first_elected FROM table_1341843_19 WHERE incumbent = "Edwin E. Willis"
sql_create_context
CREATE TABLE table_name_51 ( silver VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which nation(s) won silver in Doha?
SELECT silver FROM table_name_51 WHERE location = "doha"
sql_create_context
CREATE TABLE table_18303274_1 ( fastest_lap VARCHAR, grand_prix VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the fastest lap in the Dutch TT Grand Prix?
SELECT fastest_lap FROM table_18303274_1 WHERE grand_prix = "Dutch TT"
sql_create_context
CREATE TABLE table_name_40 ( date VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date where the round is R3?
SELECT date FROM table_name_40 WHERE round = "r3"
sql_create_context
CREATE TABLE table_name_42 ( wins INTEGER, played INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Wins, when Played is less than 5?
SELECT SUM(wins) FROM table_name_42 WHERE played < 5
sql_create_context
CREATE TABLE table_name_75 ( hr_no VARCHAR, built VARCHAR, lms_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the HR Number when the LMS number is 14757 and has a built of 9/1915?
SELECT hr_no FROM table_name_75 WHERE built = "9/1915" AND lms_no = 14757
sql_create_context
CREATE TABLE table_32101 ( "Title" text, "Japan" text, "North America" text, "Europe" text, "Australia" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the title of japan january 31, 2008
SELECT "Title" FROM table_32101 WHERE "Japan" = 'january 31, 2008'
wikisql
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. -- Who has friends that are younger than the average ...
SELECT DISTINCT T2.name FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person)
spider
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '彭天瑞' AND mzjzjlb.JZKSRQ BETWEEN '2004-08-25' AND '2016-07-12') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AN...
css
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2123" AND procedures.long_title = "Percutaneous transluminal coronary angioplasty [PTCA]"
mimicsql_data
CREATE TABLE table_name_94 ( status VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which status accompanies the score 21.5?
SELECT status FROM table_name_94 WHERE score = 21.5
sql_create_context
CREATE TABLE table_14496 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- for goals less than 48 and 8 games played what is the coun...
SELECT MAX("Losses") FROM table_14496 WHERE "Games Played" = '8' AND "Goals For" < '48'
wikisql
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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE table_44107 ( "Model" text, "Years" text, "Engine" text, "Displacement" text, "Power" text, "Fuel system" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which years have a displacement of 1816cc?
SELECT "Years" FROM table_44107 WHERE "Displacement" = '1816cc'
wikisql
CREATE TABLE table_name_87 ( date VARCHAR, label VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Hollywood Records release a digital download?
SELECT date FROM table_name_87 WHERE label = "hollywood records" AND format = "digital download"
sql_create_context
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperid int, datase...
SELECT DISTINCT dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid
scholar
CREATE TABLE table_26975 ( "DS Division" text, "Main Town" text, "GN Divisions" real, "Area (km 2 )" real, "Sri Lankan Tamil" real, "Sri Lankan Moors" real, "Sinhalese" real, "Indian Tamil" real, "Other" real, "Total" real, "Population Density (/km 2 )" real ) -- Using vali...
SELECT COUNT("Sinhalese") FROM table_26975 WHERE "Indian Tamil" = '177'
wikisql
CREATE TABLE table_train_174 ( "id" int, "fasting_plasma_glucose_fpg" float, "hemoglobin_a1c_hba1c" float, "substance_dependence" bool, "estimated_glomerular_filtration_rate_egfr" int, "allergy_to_insulin_lispro" bool, "urine_albumin_to_creatinine_ratio_uacr" int, "smoking" bool, "NO...
SELECT * FROM table_train_174 WHERE fasting_plasma_glucose_fpg > 240
criteria2sql
CREATE TABLE Ref_Characteristic_Types ( characteristic_type_code VARCHAR(15), characteristic_type_description VARCHAR(80) ) CREATE TABLE Ref_Colors ( color_code VARCHAR(15), color_description VARCHAR(80) ) CREATE TABLE Product_Characteristics ( product_id INTEGER, characteristic_id INTEGER, ...
SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "7" AND prescriptions.drug = "Oseltamivir"
mimicsql_data
CREATE TABLE table_45064 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country is Paul Stankowski from?
SELECT "Country" FROM table_45064 WHERE "Player" = 'paul stankowski'
wikisql
CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE table_73338 ( "Chapter" text, "Installation Date" text, "Institution" text, "Location" text, "Inactive" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the chapter for Illinois Wesleyan?
SELECT "Chapter" FROM table_73338 WHERE "Institution" = 'Illinois Wesleyan'
wikisql
CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE class ( class_code text, crs_code text, class_section text, class_time text, class_room text, prof_num number ) CREATE TABLE department ( ...
SELECT dept_address FROM department WHERE dept_name = 'History'
spider
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varch...
SELECT DISTINCT fare_basis_code FROM fare_basis WHERE fare_basis_code = 'YN'
atis
CREATE TABLE table_35874 ( "Class" text, "Season" text, "Race" real, "Podiums" real, "Pole" real, "FLap" real, "WChmp" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the WChmp of the race greater than 42 and pole greater than 11?
SELECT COUNT("WChmp") FROM table_35874 WHERE "Race" > '42' AND "Pole" > '11'
wikisql
CREATE TABLE table_69663 ( "Round" real, "Date" text, "Grand Prix" text, "Circuit" text, "125cc winner" text, "250cc winner" text, "MotoGP winner" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 125cc winner with c...
SELECT "125cc winner" FROM table_69663 WHERE "Circuit" = 'estoril'
wikisql
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 t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '陶晴画' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 769.78)
css
CREATE TABLE table_74683 ( "Player" text, "Nationality" text, "Position" text, "From" real, "School/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the nationality of every player that attended Baylor?
SELECT "Nationality" FROM table_74683 WHERE "School/Country" = 'baylor'
wikisql
CREATE TABLE table_61011 ( "2006" real, "2007" real, "2008" real, "2009" real, "2010" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest 2010 that has a 2009 less than 6.5, 0.4 as the 2008, with a 2007 less than 0.5?
SELECT MAX("2010") FROM table_61011 WHERE "2009" < '6.5' AND "2008" = '0.4' AND "2007" < '0.5'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId n...
SELECT * FROM PostHistory WHERE PostId = '##PostId##'
sede
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 gwyjzb.IN_HOSP_DAYS FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '43389483198' UNION SELECT fgwyjzb.IN_HOSP_DAYS FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '43389483198'
css
CREATE TABLE table_12003 ( "Name" text, "District (Region)" text, "Took Office" text, "Left Office" text, "Party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The deputy that left office in 2003 took office in which year?
SELECT "Took Office" FROM table_12003 WHERE "Left Office" = '2003'
wikisql
CREATE TABLE table_25730460_2 ( player VARCHAR, touchdowns VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the player for 1 touchdowns
SELECT player FROM table_25730460_2 WHERE touchdowns = 1
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
SELECT FIRST_NAME, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME
nvbench
CREATE TABLE Fault_Log ( fault_log_entry_id INTEGER, asset_id INTEGER, recorded_by_staff_id INTEGER, fault_log_entry_datetime DATETIME, fault_description VARCHAR(255), other_fault_details VARCHAR(255) ) CREATE TABLE Asset_Parts ( asset_id INTEGER, part_id INTEGER ) CREATE TABLE Staff (...
SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
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 = '015-76260')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce...
eicu
CREATE TABLE first_notification_of_loss ( fnol_id number, customer_id number, policy_id number, service_id number ) CREATE TABLE services ( service_id number, service_name text ) CREATE TABLE available_policies ( policy_id number, policy_type_code text, customer_phone text ) CREAT...
SELECT service_name FROM services ORDER BY service_name
spider
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, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
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.person_info_XM = '水沛珊' AND hz_info.YLJGDM = '2298626' AND NOT zyjzjlb.JZKSMC LIKE '%咨询%'
css
CREATE TABLE table_203_573 ( id number, "name" text, "rank - 2000" number, "number" number, "country of origin" text, "england - 2001" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what name is listed before davis ?
SELECT "name" FROM table_203_573 WHERE id = (SELECT id FROM table_203_573 WHERE "name" = 'davis') - 1
squall
CREATE TABLE table_1084 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college did Byron Williams attend?
SELECT "College" FROM table_1084 WHERE "Player" = 'Byron Williams'
wikisql
CREATE TABLE table_203_27 ( id number, "number" number, "serial no" number, "entered service" text, "withdrawn" text, "kilometres travelled" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- only 402,026 kilometres were traveled in what service d...
SELECT "entered service" FROM table_203_27 WHERE "kilometres travelled" = 402026
squall
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE airport_servic...
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAMPA' AND flight.departure_time < 900 AND flight.to_airport = AIRPORT_SERVICE_1.airport_...
atis
CREATE TABLE product_characteristics ( product_id number, characteristic_id number, product_characteristic_value text ) CREATE TABLE ref_characteristic_types ( characteristic_type_code text, characteristic_type_description text ) CREATE TABLE characteristics ( characteristic_id number, cha...
SELECT product_category_description FROM ref_product_categories WHERE product_category_code = "Spices"
spider
CREATE TABLE table_51261 ( "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. -- When the home team was geelong, who played as th...
SELECT "Away team" FROM table_51261 WHERE "Home team" = 'geelong'
wikisql
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 ROW_NUMBER() OVER (ORDER BY Reputation DESC, LastAccessDate DESC) AS Rank, Id AS "user_link", Reputation, LastAccessDate, Location, UpVotes, DownVotes FROM Users AS u WHERE (UPPER(Location) LIKE 'ITA%' OR UPPER(Location) LIKE '% ITA%') AND Reputation >= '##MinReputation:int?3000##' AND LastAccessDate >= CURRENT_...
sede
CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Nu...
SELECT Name, Damage_millions_USD FROM storm ORDER BY Max_speed DESC
nvbench
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 ROW_NUMBER() OVER (ORDER BY COUNT(Posts.Id) DESC) AS Rank, Users.Id AS "user_link", COUNT(Posts.Id) AS Answers FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, DisplayName HAVING COUNT(Posts.Id) > 10 ORDER BY Answe...
sede
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'plastic surgery consultation' AND STRFTIME('%y', treatment.treatmenttime)...
eicu
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( r...
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5310)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT_TIME(), '...
mimic_iii
CREATE TABLE table_203_752 ( id number, "rank" number, "circuit" text, "headquarters" text, "screens" number, "sites" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the number of sites national amusements have ?
SELECT "sites" FROM table_203_752 WHERE "circuit" = 'national amusements'
squall
CREATE TABLE table_name_70 ( result VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result when 58,516 were in attendance?
SELECT result FROM table_name_70 WHERE attendance = "58,516"
sql_create_context
CREATE TABLE table_203_803 ( id number, "draw" number, "country" text, "language" text, "artist" text, "song" text, "english translation" text, "place" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many artist...
SELECT COUNT("artist") FROM table_203_803 WHERE "points" >= 40
squall
CREATE TABLE table_28258 ( "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 directed the episo...
SELECT "Director" FROM table_28258 WHERE "Prod. code" = '227451'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score num...
SELECT CAST(TIME_TO_STR(CreationDate, '%Y') AS TEXT(4)) + '-week' + CAST(TIME_TO_STR(CreationDate, '%W') AS TEXT(2)), COUNT(*) AS freq FROM Posts WHERE Posts.PostTypeId = 1 AND Body LIKE '%<' + LOWER(@keyword) + '>%' GROUP BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%W') ORDER BY TIME_TO_STR(Creation...
sede
CREATE TABLE table_name_88 ( year VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year has a Score of 5 7, 4 6, 6 3, 1 6?
SELECT year FROM table_name_88 WHERE score = "5–7, 4–6, 6–3, 1–6"
sql_create_context
CREATE TABLE table_25030512_12 ( candidates VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When none (new seat) is the first elected who are the candidates?
SELECT candidates FROM table_25030512_12 WHERE first_elected = "None (New seat)"
sql_create_context
CREATE TABLE table_47629 ( "Opposing Team" text, "Against" real, "Date" text, "Venue" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What largest against has the opposing team of fiji?
SELECT MAX("Against") FROM table_47629 WHERE "Opposing Team" = 'fiji'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '004-86136' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '004-86136' AND patient.hospitaldischargetime IS NULL)) AND tr...
eicu
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '82617822' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE table_203_656 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "scorers" text, "report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- previous to october 5 , 2008 how many matches were won ?
SELECT COUNT(*) FROM table_203_656 WHERE id < (SELECT id FROM table_203_656 WHERE "date" = 'october 5, 2008 - 15:00') AND "result" = 'won'
squall
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, 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, JY...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM wdmzjzjlb JOIN jybgb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE wdmzjzjlb.YLJGDM = '1771451' AND jybgb.BGRQ BETWEEN '2003-09-14' AND '2010-01-28' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 20 UNION SELECT jybgb.KSBM FROM bdmzjzjlb ...
css
CREATE TABLE table_name_67 ( prominence__m_ INTEGER, elevation__m_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Prominence (m) has an Elevation (m) of 3,095?
SELECT MIN(prominence__m_) FROM table_name_67 WHERE elevation__m_ = 3 OFFSET 095
sql_create_context
CREATE TABLE table_name_25 ( opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did the Raiders play in week 12?
SELECT opponent FROM table_name_25 WHERE week = 12
sql_create_context
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrase...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Question Answering' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
scholar
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 demographic.age, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_8919 ( "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 was Spain's score?
SELECT "Score" FROM table_8919 WHERE "Country" = 'spain'
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 WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "CORONARY ARTERY DISEASE"
mimicsql_data
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_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, ...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94229 AND admissions.dischtime IS NULL) ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int...
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY EMP_FNAME, CRS_DESCRIPTION ORDER BY CRS_DESCRIPTION DESC
nvbench
CREATE TABLE table_67878 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is on tv at 10:00 on the same channel that had movies on at 8:00?
SELECT "10:00" FROM table_67878 WHERE "8:00" = 'movies'
wikisql
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 varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_2386 ( "\u2116" real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many t...
SELECT COUNT("Title") FROM table_2386 WHERE "Production code" = 'NABF07'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE c...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'rheumatic heart failure')) AND DATETIME(cost.chargetime, 'start...
mimic_iii
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260')) AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETI...
eicu
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_ID, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE table_64301 ( "World record" text, "Snatch" text, "Sergey Filimonov ( KAZ )" text, "173kg" text, "Almaty , Kazakhstan" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Almaty, Kazakhstan when the Sergey Filimonov (KAZ) is 210k...
SELECT "Almaty , Kazakhstan" FROM table_64301 WHERE "Sergey Filimonov ( KAZ )" = '210kg'
wikisql
CREATE TABLE table_79756 ( "Exam" text, "2006 First Time" text, "2006 All" text, "2007 First Time" text, "2007 All" text, "2008 First Time" text, "2008 All" text, "2009 First Time" text, "2009 All" text, "2010 First Time" text, "2011 First Time" text, "2012 First Time" te...
SELECT "2008 All" FROM table_79756 WHERE "2007 All" = '69%'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Home
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "77"
mimicsql_data
CREATE TABLE table_name_43 ( lost INTEGER, played INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of losses when there are under 1 games played?
SELECT MAX(lost) FROM table_name_43 WHERE played < 1
sql_create_context
CREATE TABLE table_name_52 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which of the opponents has a record of 17-25?
SELECT opponent FROM table_name_52 WHERE record = "17-25"
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid nu...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'remve ext hrt assist ...
mimic_iii
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( la...
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-74423' AND NOT patient.hospit...
eicu
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_nam...
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 = 26156) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid IN (SELE...
mimic_iii
CREATE TABLE table_12792 ( "Location" text, "Year" real, "Champion" text, "Runner-up" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 1979 when Jimmy Connors was the runner-up what was the score?
SELECT "Score" FROM table_12792 WHERE "Runner-up" = 'jimmy connors' AND "Year" < '1979'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_Name, School_ID FROM basketball_match ORDER BY Team_Name
nvbench