instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id n...
SELECT (SELECT chartevents.valuenum 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 = 28443 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM...
mimic_iii
CREATE TABLE table_name_37 ( carrier VARCHAR, package_version VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE CARRIER WITH 5.0.0.742 VERSION?
SELECT carrier FROM table_name_37 WHERE package_version = "5.0.0.742"
sql_create_context
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2126.0" AND diagnoses.long_title = "Other convulsions"
mimicsql_data
CREATE TABLE table_7344 ( "Name" text, "Years" text, "League a" text, "FA Cup" text, "League Cup" text, "Other b" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the League a for 1908 1928?
SELECT "League a" FROM table_7344 WHERE "Years" = '1908–1928'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(2...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_25187 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List a...
SELECT "High rebounds" FROM table_25187 WHERE "Date" = 'May 11'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51200" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_24640 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the episode directed by Miguel Art...
SELECT "Title" FROM table_24640 WHERE "Directed by" = 'Miguel Arteta'
wikisql
CREATE TABLE table_name_6 ( year_s__won VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year has a winning finish of T27?
SELECT year_s__won FROM table_name_6 WHERE finish = "t27"
sql_create_context
CREATE TABLE table_name_54 ( second_member VARCHAR, second_party VARCHAR, election VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the second member that is a second party Whig in the 1834 election?
SELECT second_member FROM table_name_54 WHERE second_party = "whig" AND election = "1834"
sql_create_context
CREATE TABLE Customers ( Customer_ID VARCHAR(100), Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Invoices ( Invoice_ID INTEGER, Order_ID INTEGER, payment_method_code CHAR(15...
SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name
nvbench
CREATE TABLE table_name_36 ( trial_start_date VARCHAR, candidate_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Trial Start Date, when Candidate Name is Notes?
SELECT trial_start_date FROM table_name_36 WHERE candidate_name = "notes"
sql_create_context
CREATE TABLE table_10709 ( "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 was the crowd size when Geelong played at h...
SELECT AVG("Crowd") FROM table_10709 WHERE "Home team" = 'geelong'
wikisql
CREATE TABLE table_75572 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the match with Aron Lofton ...
SELECT "Location" FROM table_75572 WHERE "Opponent" = 'aron lofton'
wikisql
CREATE TABLE table_66819 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the qual when the rank was 2?
SELECT "Qual" FROM table_66819 WHERE "Rank" = '2'
wikisql
CREATE TABLE table_train_45 ( "id" int, "child_pugh_class" string, "consent" bool, "renal_disease" bool, "hepatic_disease" bool, "intestinal_obstruction" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- signed i...
SELECT * FROM table_train_45 WHERE consent = 1
criteria2sql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE com...
SELECT DISTINCT course.department, course.name, course.number FROM program_course INNER JOIN course ON program_course.course_id = course.course_id WHERE course.department = 'BIOSTAT'
advising
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId...
SELECT u.Id AS "user_link", u.Reputation FROM Users AS u LEFT JOIN Badges AS b ON b.UserId = u.Id WHERE b.Name = 'Peer Pressure' AND u.Reputation > 101 ORDER BY Reputation
sede
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_des...
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) DESC
nvbench
CREATE TABLE table_name_35 ( wins VARCHAR, points VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins for the team with points less than 6 and a 350cc class?
SELECT wins FROM table_name_35 WHERE points < 6 AND class = "350cc"
sql_create_context
CREATE TABLE table_9044 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which score has a Date of october 29, 2008?
SELECT "Score" FROM table_9044 WHERE "Date" = 'october 29, 2008'
wikisql
CREATE TABLE customer_orders ( order_id number, customer_id number, order_status text, order_date time, order_details text ) CREATE TABLE customers ( customer_id number, payment_method text, customer_name text, date_became_customer time, other_customer_details text ) CREATE TAB...
SELECT city FROM addresses WHERE NOT city IN (SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id)
spider
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'surg tooth extract nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9338) AND DA...
mimic_iii
CREATE TABLE table_name_21 ( status VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Status of primitive confuciusornithid .?
SELECT status FROM table_name_21 WHERE notes = "primitive confuciusornithid ."
sql_create_context
CREATE TABLE table_70771 ( "Year" real, "Points" text, "Rebounds" text, "Assists" text, "Steals" text, "Blocks" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the leader in Steals when Travis Watson (9) was the leader in Rebounds?
SELECT "Steals" FROM table_70771 WHERE "Rebounds" = 'travis watson (9)'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.short_title = "Migrne unsp wo ntrc mgrn"
mimicsql_data
CREATE TABLE table_63331 ( "Restaurant Name" text, "Original Name" text, "Location" text, "Chef" text, "Designer" text, "Still Open?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the restaurant originally named Essence?
SELECT "Restaurant Name" FROM table_63331 WHERE "Original Name" = 'essence'
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.drug = "Glycerin (Ped)"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
SELECT jyjgzbb.BGDH FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '02569386743'
css
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 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 = '78591362' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_25607 ( "Star" text, "Stellar classification" text, "Distance from Earth ( ly )" text, "Constellation" text, "Dust (or Debris; Temperature (K)" text, "System" text, "Dust (or Debris) Location (AU)" text, "Cool Dust > 10 AU" text, "Stellar Age (Myr)" text ) -- Usi...
SELECT "Dust (or Debris) Location (AU)" FROM table_25607 WHERE "Star" = 'HD 69830'
wikisql
CREATE TABLE table_name_59 ( style VARCHAR, choreographer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Style of the dance by Choreographer Luda and Oliver?
SELECT style FROM table_name_59 WHERE choreographer = "luda and oliver"
sql_create_context
CREATE TABLE table_name_93 ( bb_pop VARCHAR, riaa VARCHAR, cb_cw VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the BB pop of the song with a CB CW of 1, RIAA of P and was released more recently than 1976?
SELECT bb_pop FROM table_name_93 WHERE cb_cw = "1" AND year > 1976 AND riaa = "p"
sql_create_context
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int...
SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY COUNT(Country)
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 WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2175"
mimicsql_data
CREATE TABLE table_name_24 ( loss VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the loss of the game attended by 37,119?
SELECT loss FROM table_name_24 WHERE attendance = "37,119"
sql_create_context
CREATE TABLE table_61448 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2008 value of the hamburg masters?
SELECT "2008" FROM table_61448 WHERE "Tournament" = 'hamburg masters'
wikisql
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, ...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date)
nvbench
CREATE TABLE table_name_16 ( to_par VARCHAR, place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the par for the t5 place player Steve Jones?
SELECT to_par FROM table_name_16 WHERE place = "t5" AND player = "steve jones"
sql_create_context
CREATE TABLE table_8117 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent before week 3 and a result of w 28-6?
SELECT "Opponent" FROM table_8117 WHERE "Week" < '3' AND "Result" = 'w 28-6'
wikisql
CREATE TABLE table_name_91 ( ceremony VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which award ceremony took place on May 15, 1965?
SELECT ceremony FROM table_name_91 WHERE date = "may 15, 1965"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2103"
mimicsql_data
CREATE TABLE table_name_44 ( record VARCHAR, decision VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record for November 26, with the decision made by Prusek?
SELECT record FROM table_name_44 WHERE decision = "prusek" AND date = "november 26"
sql_create_context
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 * FROM t_kc21 WHERE MED_SER_ORG_NO = '2609401' AND IN_HOSP_DATE BETWEEN '2006-07-02' AND '2021-01-28') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '2609401' AND IN_HOSP_DATE BETWEEN '2006-07-02' AND '2021-01-28' AND MED_ORG_DEPT_NM = '麻醉科')
css
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Diabetes with neurological manifestations, type I [juvenile type], not stated as uncontrolled" AND lab.fluid = ...
mimicsql_data
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-146783' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hosp...
eicu
CREATE TABLE table_69133 ( "January" text, "February" text, "March" text, "April" text, "June" text, "July" text, "August" text, "September" text, "October" text, "November" text, "December" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "October" FROM table_69133 WHERE "November" = 'buffy tyler'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "0" AND diagnoses.long_title = "Asthma, unspecified type, unspecified"
mimicsql_data
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int,...
SELECT DISTINCT name, number FROM course WHERE department = 'APPPHYS' AND credits = 15
advising
CREATE TABLE table_29449 ( "Club" text, "Chairman" text, "Current manager" text, "Team captain" text, "Kitmaker" text, "Shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the chairman when the current manager is bob peeters?
SELECT "Chairman" FROM table_29449 WHERE "Current manager" = 'Bob Peeters'
wikisql
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.icd9_code = "6140"
mimicsql_data
CREATE TABLE table_8492 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Location has a Game greater than 20 and a Date of Wed. Dec. 26?
SELECT "Location" FROM table_8492 WHERE "Game" > '20' AND "Date" = 'wed. dec. 26'
wikisql
CREATE TABLE artist ( name VARCHAR, age VARCHAR, country VARCHAR, Year_Join VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all artist name, age, and country ordered by the yeared they joined.
SELECT name, age, country FROM artist ORDER BY Year_Join
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
SELECT jybgb.BGJGDM, jybgb.BGJGMC FROM jybgb WHERE jybgb.BGDH = '81389511365'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Skin disorders NEC" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
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 zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '褚丽佳' AND hz_info.YLJGDM = '0572536' AND zzmzjzjlb.JZZDSM LIKE '%(%' UNION SELECT * FROM person_info JOIN hz...
css
CREATE TABLE table_name_97 ( points_against VARCHAR, tries_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- tries against is 29, what is the points against?
SELECT points_against FROM table_name_97 WHERE tries_against = "29"
sql_create_context
CREATE TABLE table_name_39 ( coach VARCHAR, big_ten VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Coach with a Big Ten that is 1st (148)?
SELECT coach FROM table_name_39 WHERE big_ten = "1st (148)"
sql_create_context
CREATE TABLE table_11442 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Object Type has a 21h01m37.7s Right Ascension (J200...
SELECT "Object type" FROM table_11442 WHERE "NGC number" > '6995' AND "Right ascension ( J2000 )" = '21h01m37.7s'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time,...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 6440 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_72 ( country VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when Place is 'Torino'?
SELECT country FROM table_name_72 WHERE place = "torino"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", AboutMe, Reputation, UpVotes, CreationDate, Views, DownVotes, LastAccessDate FROM Users WHERE LOWER(Location) LIKE '%hyderabad%' OR UPPER(Location) LIKE '%MOZ' ORDER BY UpVotes DESC LIMIT 200
sede
CREATE TABLE table_60010 ( "Provider" text, "Years" text, "Free or pay" text, "Transmission" text, "On demand" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Years which have Transmission of digital satellite, an On demand of no, and a Free...
SELECT "Years" FROM table_60010 WHERE "Transmission" = 'digital satellite' AND "On demand" = 'no' AND "Free or pay" = 'free + ppv'
wikisql
CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE college ( cname text, state text, enr number ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT COUNT(*) FROM player WHERE hs > 1000
spider
CREATE TABLE table_16365 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the original air date...
SELECT "Original air date" FROM table_16365 WHERE "Production code" = '2394087'
wikisql
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0...
SELECT LAST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID
nvbench
CREATE TABLE table_51551 ( "5:00" text, "6:00" text, "7:00" text, "8:00" text, "10:00" text, "11:00" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 6:00 with a 7:00 of mostly true stories: urban legends revealed, and a 10:00 with mys...
SELECT "6:00" FROM table_51551 WHERE "7:00" = 'mostly true stories: urban legends revealed' AND "10:00" = 'mysteryquest'
wikisql
CREATE TABLE table_15651 ( "Date" text, "Round" text, "Opponents" text, "Result F\u2013A" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the round for southampton opponents
SELECT "Round" FROM table_15651 WHERE "Opponents" = 'southampton'
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
CREATE TABLE table_name_47 ( founded INTEGER, left VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of teams founded that were left in 1976?
SELECT SUM(founded) FROM table_name_47 WHERE left = "1976"
sql_create_context
CREATE TABLE table_75714 ( "Week #" text, "Theme" text, "Original artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original artist of top 9 as the week number?
SELECT "Original artist" FROM table_75714 WHERE "Week #" = 'top 9'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int,...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 532 AND NOT instructor.name LIKE '%Patricia Reuter-lorenz%' AND offering_instructor.instructor_id = instructor.instructor_id...
advising
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE table_44718 ( "Year" text, "Winner" text, "Country" text, "Score" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the Runner(s)-up of the 1956 Championship?
SELECT "Runner(s)-up" FROM table_44718 WHERE "Year" = '1956'
wikisql
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 SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '柏向明' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2017-05-05' AND '2018-01-22'
css
CREATE TABLE university ( school_id number, school text, location text, founded number, affiliation text, enrollment number, nickname text, primary_conference text ) CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text...
SELECT SUM(enrollment), affiliation FROM university GROUP BY affiliation
spider
CREATE TABLE people ( Name VARCHAR, People_ID VARCHAR ) CREATE TABLE body_builder ( People_ID VARCHAR, Total INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of body builders whose total score is higher than 300?
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300
sql_create_context
CREATE TABLE table_53821 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On the Date of 4 Oct 2009, who was the Runner(s)-up?
SELECT "Runner(s)-up" FROM table_53821 WHERE "Date" = '4 oct 2009'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '39646244' AND t_kc22.STA_DATE BETWEEN '2005-11-19' AND '2013-12-01' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_171748_3 ( change_over_previous_year_as_a_whole VARCHAR, change_over_same_quarter_the_previous_year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the change over previous year as a whole in the period in which the change over same ...
SELECT change_over_previous_year_as_a_whole FROM table_171748_3 WHERE change_over_same_quarter_the_previous_year = "Up 2.8%"
sql_create_context
CREATE TABLE table_77434 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Position for the European U23 Championships?
SELECT "Position" FROM table_77434 WHERE "Competition" = 'european u23 championships'
wikisql
CREATE TABLE table_name_85 ( kansas_state_vs VARCHAR, current_streak VARCHAR, games_played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kansas vs. that has w 2 as the current streak, and 31 as games played?
SELECT kansas_state_vs FROM table_name_85 WHERE current_streak = "w 2" AND games_played = "31"
sql_create_context
CREATE TABLE table_28575 ( "Country" text, "Area (km\u00b2) 2010" real, "Population 2011" real, "GDP (PPP) ( Intl. $ ) 2011" text, "GDP (PPP) per capita ( Intl. $ ) 2011" text, "Income inequality 1992-2010 (latest available)" text, "HDI 2012" text, "FSI 2012" text, "CPI 2012" text, ...
SELECT "HDI 2012" FROM table_28575 WHERE "Country" = 'Dominica'
wikisql
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
advising
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, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
advising
CREATE TABLE table_name_19 ( number VARCHAR, acquisition_via VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the acquisition of import in the 2002 season?
SELECT number FROM table_name_19 WHERE acquisition_via = "import" AND season = "2002"
sql_create_context
CREATE TABLE table_24143253_1 ( deceased_spouse VARCHAR, length_of_marriage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the deceased spouse for length of marriage being 24 years
SELECT deceased_spouse FROM table_24143253_1 WHERE length_of_marriage = "24 years"
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 jybgb.BGRGH, jybgb.BGRXM FROM jybgb WHERE jybgb.BGDH = '26254830519'
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) ...
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2100' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num...
SELECT Creation, AVG(Budget_in_Billions) FROM department ORDER BY Creation DESC
nvbench
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT Q.Id, Q.AcceptedAnswerId, U.Reputation AS AnswererReputation, CAST((JULIANDAY(CreationDate) - JULIANDAY(Q.CreationDate)) * 1440.0 AS INT) AS QATimeGap FROM Posts AS Q, Posts AS A, Users AS U WHERE Q.AcceptedAnswerId = A.Id AND A.OwnerUserId = U.Id AND Q.Tags LIKE '%<android>%' AND Q.CreationDate > '2014-08-01'
sede
CREATE TABLE table_name_82 ( versus VARCHAR, bowling_figures_wickets_runs__overs_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent during the competition in which the bowling figures were 5-33 (10)?
SELECT versus FROM table_name_82 WHERE bowling_figures_wickets_runs__overs_ = "5-33 (10)"
sql_create_context
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '14111458' AND t_kc22.STA_DATE BETWEEN '2005-03-22' AND '2009-01-07' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸多奈哌齐胶囊'
css
CREATE TABLE table_30758 ( "No in. series" real, "No in. season" real, "Title" text, "Original air date" text, "Production Code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many numbers in the season have a...
SELECT COUNT("No in. season") FROM table_30758 WHERE "Original air date" = 'June 3, 2012'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'albumin 5% (12.5 g)'
mimic_iii
CREATE TABLE table_18322 ( "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 is the result for the district missouri 2?
SELECT "Result" FROM table_18322 WHERE "District" = 'Missouri 2'
wikisql
CREATE TABLE table_24211 ( "Competition" text, "Round" text, "Opponent" text, "Result" text, "Score" text, "Home/Away" text, "Venue" text, "Attendance" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- state the opponent on...
SELECT "Opponent" FROM table_24211 WHERE "Venue" = 'Halliwell Jones Stadium' AND "Competition" = 'Super League XIV'
wikisql
CREATE TABLE table_name_68 ( week INTEGER, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks have an Attendance of 62,289?
SELECT SUM(week) FROM table_name_68 WHERE attendance = 62 OFFSET 289
sql_create_context
CREATE TABLE table_7732 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par when the tournament involved was the Transi...
SELECT "To par" FROM table_7732 WHERE "Tournament" = 'transitions championship'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 68280 AND admissions.dischtime IS NULL)) AND transfers...
mimic_iii