instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE Documents ( document_id INTEGER, document_status_code CHAR(15), document_type_code CHAR(15), shipping_agent_code CHAR(15), receipt_date DATETIME, receipt_number VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Documents_Mailed ( document_id INTEGER, mailed_to_add...
SELECT role_description, COUNT(*) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code ORDER BY role_description
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2101" AND procedures.short_title = "Oth uni salpingo-oophor"
mimicsql_data
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.admission_type = "ELECTIVE" AND demographic.insurance = "Medicare"
mimicsql_data
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT * FROM t_kc21 WHERE PERSON_NM = '沈清昶' AND MED_SER_ORG_NO = '5859683' AND NOT MED_ORG_DEPT_NM LIKE '%矫形%'
css
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
SELECT u.Location, COUNT(u.DisplayName) FROM Posts AS p JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.Tags LIKE ('%android%') AND NOT p.ParentId IS NULL GROUP BY u.Location ORDER BY 1
sede
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '7418379' AND BGRQ BETWEEN '2008-06-02' AND '2011-05-19' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL) LIMIT 1
css
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TA...
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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND fare.round_trip_required = 'NO' AND flight_fare.fare_i...
atis
CREATE TABLE table_name_18 ( crowd VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people were in attendance at St Kilda's away match?
SELECT crowd FROM table_name_18 WHERE away_team = "st kilda"
sql_create_context
CREATE TABLE table_name_12 ( location VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the event on June 10?
SELECT location FROM table_name_12 WHERE date = "june 10"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '彭金鑫' AND t_kc21.MED_SER_ORG_NO = '2214743' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%精神%'
css
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 prescriptions...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "BRADYCARDIA"
mimicsql_data
CREATE TABLE table_name_38 ( score VARCHAR, home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score of the Chicago Black Hawks Home game on March 28?
SELECT score FROM table_name_38 WHERE home = "chicago black hawks" AND date = "march 28"
sql_create_context
CREATE TABLE table_127511_1 ( solidv4 VARCHAR, pacbio VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much was solidv4 when pacbio is $300 usd?
SELECT solidv4 FROM table_127511_1 WHERE pacbio = "$300 USD"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 50 AND 59
mimic_iii
CREATE TABLE table_name_65 ( game VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of games played against the Buffalo Sabres?
SELECT COUNT(game) FROM table_name_65 WHERE opponent = "buffalo sabres"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT RYTJDM, RYTJMC FROM zyjzjlb WHERE JZLSH = '15461734780'
css
CREATE TABLE table_name_17 ( round INTEGER, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest round a fullback went in?
SELECT MIN(round) FROM table_name_17 WHERE position = "fullback"
sql_create_context
CREATE TABLE student_course_enrolment ( registration_id number, student_id number, course_id number, date_of_enrolment time, date_of_completion time ) CREATE TABLE students ( student_id number, date_of_registration time, date_of_latest_logon time, login_name text, password text,...
SELECT COUNT(course_id) FROM student_course_enrolment
spider
CREATE TABLE table_2610582_3 ( power_kw__erp_ VARCHAR, ch__number VARCHAR, callsign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the power, in kW, of channel TV-23, callsign DYCG-TV?
SELECT power_kw__erp_ FROM table_2610582_3 WHERE ch__number = "TV-23" AND callsign = "DYCG-TV"
sql_create_context
CREATE TABLE table_name_94 ( label VARCHAR, format VARCHAR, region VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What label is formatted as compact disc and has United Kingdom as its region?
SELECT label FROM table_name_94 WHERE format = "compact disc" AND region = "united kingdom"
sql_create_context
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 wdmzjzjlb.JZZDBM, wdmzjzjlb.JZZDSM FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '43110591340' UNION SELECT bdmzjzjlb.JZZDBM, bdmzjzjlb.JZZDSM FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '43110591340'
css
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TA...
SELECT u.Id AS "user_link", COUNT(q.Id) AS "Number of questions" FROM Users AS u LEFT JOIN Posts AS q ON q.PostTypeId = 1 AND q.OwnerUserId = u.Id WHERE u.Reputation = 1 GROUP BY u.Id ORDER BY COUNT(q.Id)
sede
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Sarcoidosis"
mimicsql_data
CREATE TABLE table_24466191_1 ( poles INTEGER, series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name th most poles for macau grand prix
SELECT MAX(poles) FROM table_24466191_1 WHERE series = "Macau Grand Prix"
sql_create_context
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_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id nu...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_47644 ( "Year" real, "Championship" text, "Winning score" text, "Margin" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year was the peter jackson classic?
SELECT "Year" FROM table_47644 WHERE "Championship" = 'peter jackson classic'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREA...
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL))
eicu
CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Docum...
SELECT Calendar_Date, COUNT(Calendar_Date) FROM Ref_Calendar ORDER BY COUNT(Calendar_Date)
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.admission_type = "EMERGENCY" AND demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, K...
SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_45485 ( "Year" real, "Australian Open" text, "French Open" text, "Wimbledon" text, "US Open" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Australian open in 2010?
SELECT "Australian Open" FROM table_45485 WHERE "Year" = '2010'
wikisql
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 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 = '4385705' AND NOT zyjzjlb.JZKSMC LIKE '%青光眼%'
css
CREATE TABLE table_10954 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue is used before 2012 with a result of 12th?
SELECT "Venue" FROM table_10954 WHERE "Result" = '12th' AND "Year" < '2012'
wikisql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
SELECT meter_600, ID FROM swimmer
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" AND demographic.dod_year <= "2111.0"
mimicsql_data
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 * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4040000' AND gwyjzb.IN_HOSP_DATE BETWEEN '2000-10-19' AND '2016-12-23' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '4040000' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2000-10-19' AND '2016-12-23' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '404000...
css
CREATE TABLE table_12286195_1 ( charity VARCHAR, background VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which is the charity that the background of the celebrity is heavyweight champion?
SELECT charity FROM table_12286195_1 WHERE background = "Heavyweight Champion"
sql_create_context
CREATE TABLE table_61183 ( "Nat." text, "Name" text, "Moving from" text, "Type" text, "Transfer window" text, "Ends" real, "Transfer fee" text, "Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average end year of the p...
SELECT AVG("Ends") FROM table_61183 WHERE "Nat." = 'swe' AND "Transfer window" = 'summer'
wikisql
CREATE TABLE table_16912000_13 ( p_ret VARCHAR, kr_avg VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many p.ret are there when kr avg is 11.3 ?
SELECT COUNT(p_ret) FROM table_16912000_13 WHERE kr_avg = "11.3"
sql_create_context
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE time_slot ( time_slot_id varchar(4), ...
SELECT semester, COUNT(semester) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' GROUP BY semester ORDER BY T1.title
nvbench
CREATE TABLE table_name_37 ( bronze INTEGER, gold VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the least bronze when gold is more than 0 for russia?
SELECT MIN(bronze) FROM table_name_37 WHERE gold > 0 AND nation = "russia"
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "End stage renal disease"
mimicsql_data
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) 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 varch...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ASIANLAN' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fa...
advising
CREATE TABLE table_67758 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Pts." real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine was used by Ram Penthouse Rizla Racing in 1978?
SELECT "Engine" FROM table_67758 WHERE "Year" > '1978' AND "Entrant" = 'ram penthouse rizla racing'
wikisql
CREATE TABLE table_203_154 ( id number, "type" text, "manufacturer" text, "numbers" text, "year built" number, "quantity built" number, "power (horsepower)" number, "max speed (km/h)" number, "note" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT COUNT(*) FROM table_203_154 WHERE "manufacturer" = 'tokyu'
squall
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, ...
SELECT DISTINCT (SELECT COUNT(po.Body) FROM Posts AS po WHERE po.PostTypeId = 2) AS ALLANSWERS, (SELECT COUNT(pos.Body) FROM Posts AS pos WHERE pos.PostTypeId = 2 AND (pos.Body LIKE '%lifehacker%' OR pos.Body LIKE '%Lifehacker%' OR pos.Body LIKE '%Lifehacker.com%')) AS LHACKERANSWERS FROM Posts AS p
sede
CREATE TABLE table_55150 ( "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 average crowd size at Princes Park?
SELECT SUM("Crowd") FROM table_55150 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE table_12831 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silver medals were won by the participant(s) that had more than 12 gold medals and 11 bronze medals?
SELECT "Silver" FROM table_12831 WHERE "Gold" > '12' AND "Bronze" = '11'
wikisql
CREATE TABLE table_18569 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was clair engle first elected?
SELECT "First elected" FROM table_18569 WHERE "Incumbent" = 'Clair Engle'
wikisql
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE performers ( performer_id number, address_id number, customer_name text, customer_phone text, customer_email_address text, other_details text ) CREATE TABLE performers_in_bookings ( order_id number, performer_id number ) CREATE TABLE services ( service_id number, s...
SELECT planned_delivery_date, actual_delivery_date FROM bookings
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT demographic.admission_type, lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "18480"
mimicsql_data
CREATE TABLE table_name_79 ( player VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT PLAYER HAS A SCORE OF 66-73=139?
SELECT player FROM table_name_79 WHERE score = 66 - 73 = 139
sql_create_context
CREATE TABLE table_name_46 ( top_25 INTEGER, wins INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Top-25 when there are more than 0 wins?
SELECT SUM(top_25) FROM table_name_46 WHERE wins > 0
sql_create_context
CREATE TABLE table_56897 ( "Week" real, "EASTERN #1" text, "Eastern #2" text, "WESTERN #1" text, "Western #2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the eastern #1 for week of 5
SELECT "EASTERN #1" FROM table_56897 WHERE "Week" = '5'
wikisql
CREATE TABLE table_28493 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the original artist of the First solo theme?
SELECT "Original artist" FROM table_28493 WHERE "Theme" = 'First Solo'
wikisql
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "86" AND procedures.short_title = "Infusion of vasopressor"
mimicsql_data
CREATE TABLE player ( HS INTEGER, pID VARCHAR ) CREATE TABLE tryout ( pID VARCHAR, decision VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the average hours for the students whose tryout decision is no.
SELECT AVG(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no'
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT wdmzjzjlb.SG, wdmzjzjlb.TZ, wdmzjzjlb.TW, wdmzjzjlb.SSY, wdmzjzjlb.SZY, wdmzjzjlb.XL, wdmzjzjlb.HXPLC, wdmzjzjlb.ML FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '08031682316' UNION SELECT bdmzjzjlb.SG, bdmzjzjlb.TZ, bdmzjzjlb.TW, bdmzjzjlb.SSY, bdmzjzjlb.SZY, bdmzjzjlb.XL, bdmzjzjlb.HXPLC, bdmzjzjlb.ML FROM bdmzjzjlb ...
css
CREATE TABLE table_59309 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/junior/club team (league)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player in round 6?
SELECT "Player" FROM table_59309 WHERE "Round" = '6'
wikisql
CREATE TABLE status ( statusId INTEGER, status TEXT ) CREATE TABLE races ( raceId INTEGER, year INTEGER, round INTEGER, circuitId INTEGER, name TEXT, date TEXT, time TEXT, url TEXT ) CREATE TABLE drivers ( driverId INTEGER, driverRef TEXT, number TEXT, code TEXT...
SELECT name, COUNT(name) FROM races WHERE year BETWEEN 2009 AND 2011 GROUP BY name ORDER BY COUNT(name) DESC
nvbench
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 OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_ID = '51510159' AND IN_HOSP_DATE BETWEEN '2012-11-30' AND '2020-03-24' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_1566852_8 ( centerfold_model VARCHAR, pictorials VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the centerfold model when the issue's pictorial was amanda beard, reby sky , girls of montauk ?
SELECT centerfold_model FROM table_1566852_8 WHERE pictorials = "Amanda Beard, Reby Sky , Girls of Montauk"
sql_create_context
CREATE TABLE table_43102 ( "Date" text, "Race" text, "Country" text, "Winner" text, "Team" text, "World Cup Leader" text, "Leader's Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the team leading on August 17?
SELECT "Team" FROM table_43102 WHERE "Date" = 'august 17'
wikisql
CREATE TABLE table_26593 ( "#" real, "Player" text, "Country" text, "Points" real, "Reset points" real, "Events" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of points for 800 reset
SELECT COUNT("Points") FROM table_26593 WHERE "Reset points" = '800'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int,...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours...
advising
CREATE TABLE table_10640 ( "Gymnast" text, "Vault" real, "Uneven Bars" real, "Balance Beam" real, "Floor Exercise" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which gymnast had a balance beam larger than 8.687, had a total less ...
SELECT "Gymnast" FROM table_10640 WHERE "Balance Beam" > '8.687' AND "Total" < '38.049' AND "Floor Exercise" < '9.462' AND "Vault" < '9.275'
wikisql
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 MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '1027298' AND OUT_DIAG_DIS_CD = 'J20.239')
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "5110"
mimicsql_data
CREATE TABLE table_5390 ( "Name" text, "Years" text, "Seasons" real, "Lost" real, "Pct." real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of seasons for Terri Drake who lost less than 9?
SELECT AVG("Seasons") FROM table_5390 WHERE "Name" = 'terri drake' AND "Lost" < '9'
wikisql
CREATE TABLE table_name_59 ( tournament VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Tournament with Jade Curtis as the opponent?
SELECT tournament FROM table_name_59 WHERE opponent = "jade curtis"
sql_create_context
CREATE TABLE table_49795 ( "Province" text, "South Asians 2001" real, "% 2001" text, "South Asians 2011" real, "% 2011" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What % of South Asians were in Nova Scotia in 2001 with 115 and 2011 with 12,620?
SELECT "% 2001" FROM table_49795 WHERE "South Asians 2001" > '115' AND "South Asians 2011" > '12,620' AND "Province" = 'nova scotia'
wikisql
CREATE TABLE table_251272_4 ( year INTEGER, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the first year where the assassination attempt was at Martyrs' Mausoleum, Rangoon, Burma?
SELECT MIN(year) FROM table_251272_4 WHERE location = "Martyrs' Mausoleum, Rangoon, Burma"
sql_create_context
CREATE TABLE table_16796625_1 ( land_area__hectares_ VARCHAR, urban_area__locality_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many hectares of land area is Landsbro?
SELECT land_area__hectares_ FROM table_16796625_1 WHERE urban_area__locality_ = "Landsbro"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
SELECT Posts.OwnerUserId, Users.AboutMe, Users.Reputation, TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Tag...
sede
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
SELECT * FROM jybgb WHERE jybgb.JZLSH = '48646598839'
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patientheal...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-99708')) AND lab.labname = 'mch' AND DATETIME(lab.labresulttime, 'start of year...
eicu
CREATE TABLE table_name_45 ( hometown VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Jeff Lebo's hometown?
SELECT hometown FROM table_name_45 WHERE player = "jeff lebo"
sql_create_context
CREATE TABLE table_15621965_8 ( no INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What jersey number did Al Harrington wear
SELECT MAX(no) FROM table_15621965_8 WHERE player = "Al Harrington"
sql_create_context
CREATE TABLE table_75236 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the loss with save of || 23,391 ||17-18||?
SELECT "Loss" FROM table_75236 WHERE "Save" = '|| 23,391 ||17-18||'
wikisql
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 t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'intracranial inju...
eicu
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, Revision...
SELECT COUNT(*) FROM Users
sede
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 55281 AND STRFTIME('%y', admissions.admittime) >= '2105' ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_204_787 ( id number, "year" number, "category" text, "nominee(s)" text, "episode" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many nominees were there in 1985 ?
SELECT SUM("nominee(s)") FROM table_204_787 WHERE "year" = 1985
squall
CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE student ( stuid number, lname text, fname text, ...
SELECT COUNT(*), sex FROM student WHERE age > (SELECT AVG(age) FROM student) GROUP BY sex
spider
CREATE TABLE table_30068 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "Date" FROM table_30068 WHERE "Game" = '23'
wikisql
CREATE TABLE table_name_14 ( laps INTEGER, grid INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of laps with a grid larger than 24?
SELECT MIN(laps) FROM table_name_14 WHERE grid > 24
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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 numb...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_i...
mimic_iii
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO...
atis
CREATE TABLE table_name_68 ( opponent VARCHAR, round VARCHAR, method VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a round of 3 with a method of decision?
SELECT opponent FROM table_name_68 WHERE round = "3" AND method = "decision"
sql_create_context
CREATE TABLE Circulation_History ( document_id INTEGER, draft_number INTEGER, copy_number INTEGER, employee_id INTEGER ) CREATE TABLE Ref_Document_Types ( document_type_code CHAR(15), document_type_description VARCHAR(255) ) CREATE TABLE Documents ( document_id INTEGER, document_status...
SELECT receipt_date, COUNT(receipt_date) FROM Documents
nvbench
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 MED_ORG_DEPT_CD, IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '7856907' GROUP BY MED_ORG_DEPT_CD, IN_DIAG_DIS_CD
css
CREATE TABLE table_name_48 ( home_ground VARCHAR, founded VARCHAR, coach VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the home ground for the club coached by nick pantsaras and founded before 1946?
SELECT home_ground FROM table_name_48 WHERE founded < 1946 AND coach = "nick pantsaras"
sql_create_context
CREATE TABLE table_name_48 ( days VARCHAR, the_presenter VARCHAR, launch_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which days were presented by Andreas Mikroutsikos and were launched on March 10, 2003?
SELECT days FROM table_name_48 WHERE the_presenter = "andreas mikroutsikos" AND launch_date = "march 10, 2003"
sql_create_context
CREATE TABLE accounts ( name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all customers names in the alphabetical order.
SELECT name FROM accounts ORDER BY name
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '器质性精神综合征' AND jyjgzbb.JCZBMC = '同型半胱氨酸'
css
CREATE TABLE table_2622469_1 ( starts VARCHAR, avg_finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different starts had an average finish of 17.9?
SELECT COUNT(starts) FROM table_2622469_1 WHERE avg_finish = "17.9"
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 WHERE demographic.expire_flag = "0" AND procedures.short_title = "Incision of aorta"
mimicsql_data
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, ...
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' A...
atis