instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_40516 ( "Date" real, "Doubles, I Class" real, "Doubles, II Class" real, "Greater Doubles" real, "Doubles" real, "Semidoubles" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Date, when Doubl...
SELECT MIN("Date") FROM table_40516 WHERE "Doubles, II Class" = '18' AND "Total" < '164'
wikisql
CREATE TABLE table_19260_1 ( total VARCHAR, _percentage_core_moldova VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total for % core moldova for 4.36%
SELECT total FROM table_19260_1 WHERE _percentage_core_moldova = "4.36_percentage"
sql_create_context
CREATE TABLE classroom ( building text, room_number text, capacity number ) CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number ...
SELECT dept_name FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_33585 ( "Member" text, "Party" text, "Electorate" text, "State" text, "In office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which state is the Petrie electorate?
SELECT "State" FROM table_33585 WHERE "Electorate" = 'petrie'
wikisql
CREATE TABLE table_name_41 ( games VARCHAR, tied VARCHAR, goals_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games had a tied less 15 with goals against being fewer than 186?
SELECT COUNT(games) FROM table_name_41 WHERE tied < 15 AND goals_against < 186
sql_create_context
CREATE TABLE table_204_585 ( id number, "year" text, "player" text, "high school" text, "college" text, "nba/aba draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many went to cincinnati ?
SELECT COUNT(*) FROM table_204_585 WHERE "college" = 'cincinnati'
squall
CREATE TABLE table_959 ( "Season" text, "Regionalliga S\u00fcd" text, "Regionalliga West/S\u00fcdwest" text, "Regionalliga Nord" text, "Regionalliga Nord-Ost" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the season with regionalliga west/s ...
SELECT "Season" FROM table_959 WHERE "Regionalliga West/S\u00fcdwest" = 'Arminia Bielefeld'
wikisql
CREATE TABLE table_name_66 ( height__cm_ INTEGER, birthdate VARCHAR, weight__kg_ VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Height when the weight is less than 91 and the position is d, and a Birthdate of jul...
SELECT AVG(height__cm_) FROM table_name_66 WHERE weight__kg_ < 91 AND position = "d" AND birthdate = "july 4, 1975"
sql_create_context
CREATE TABLE table_54347 ( "Dismissals" text, "Player" text, "Versus" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Dismissals with a Player with source: cricinfo.com?
SELECT "Dismissals" FROM table_54347 WHERE "Player" = 'source: cricinfo.com'
wikisql
CREATE TABLE table_name_84 ( floors INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Floors is the highest one that has a Name of one indiana square?
SELECT MAX(floors) FROM table_name_84 WHERE name = "one indiana square"
sql_create_context
CREATE TABLE table_name_48 ( team_wins INTEGER, nation VARCHAR, individual_wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team Win is from sweden and has a Individual win smaller than 1
SELECT MAX(team_wins) FROM table_name_48 WHERE nation = "sweden" AND individual_wins < 1
sql_create_context
CREATE TABLE table_203_724 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many nations earned no bronze medals ?
SELECT COUNT("nation") FROM table_203_724 WHERE "bronze" = 0
squall
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Height, Weight FROM people
nvbench
CREATE TABLE table_30273 ( "Series no." real, "Season no." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many people wrote the episod...
SELECT COUNT("Written by") FROM table_30273 WHERE "Directed by" = 'Rob Schrab'
wikisql
CREATE TABLE table_17509 ( "Overall Pick #" real, "AFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does the Cincinnati Bengals' player have?
SELECT "Position" FROM table_17509 WHERE "AFL Team" = 'Cincinnati Bengals'
wikisql
CREATE TABLE table_21327 ( "Game" real, "Date" text, "Opponent" 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. -- Wh...
SELECT "Opponent" FROM table_21327 WHERE "Score" = 'L 68-60'
wikisql
CREATE TABLE table_3593 ( "Team" text, "Manager" text, "Chairman" text, "Team captain" text, "Kit maker" text, "Sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the captain of Dave Jones' team?
SELECT "Team captain" FROM table_3593 WHERE "Manager" = 'Dave Jones'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE o...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 245...
mimic_iii
CREATE TABLE table_name_98 ( top_5 INTEGER, events VARCHAR, top_25 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the sum of top 5 with events less than 12 and top 25 less than 0
SELECT SUM(top_5) FROM table_name_98 WHERE events < 12 AND top_25 < 0
sql_create_context
CREATE TABLE table_74833 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of round for wide receiver for kent state
SELECT COUNT("Round") FROM table_74833 WHERE "Position" = 'wide receiver' AND "College" = 'kent state'
wikisql
CREATE TABLE table_203_843 ( id number, "record" text, "date and time" text, "competition" text, "home or away" text, "opponent" text, "score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the first record broken ?
SELECT "record" FROM table_203_843 WHERE id = 1
squall
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_i...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96404) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', microbiologyevents.chartti...
mimic_iii
CREATE TABLE table_29458735_5 ( county VARCHAR, division VARCHAR, regiment VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is he name of the county where the 2nd division and the 41st regiment was
SELECT county FROM table_29458735_5 WHERE division = "2nd division" AND regiment = "41st regiment"
sql_create_context
CREATE TABLE table_36267 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Asian rider classification" text, "Team classification" text, "Asian team classification" text ) -- Using valid SQLite, answer the foll...
SELECT "Mountains classification" FROM table_36267 WHERE "Asian team classification" = 'seoul cycling team' AND "Winner" = 'alexandre usov'
wikisql
CREATE TABLE table_name_43 ( year_built VARCHAR, location_of_the_church VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the church in Arnafjord built?
SELECT year_built FROM table_name_43 WHERE location_of_the_church = "arnafjord"
sql_create_context
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.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '8925142' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT)
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2114"
mimicsql_data
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 t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_train_194 ( "id" int, "organ_transplantation" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "substance_dependence" bool, "diastolic_blood_pressure_dbp" int, "alcohol_abuse" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer ...
SELECT * FROM table_train_194 WHERE (systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 90)
criteria2sql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_10342194_3 ( total_amount_of_trees INTEGER, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total amount of trees when district is leninsky?
SELECT MAX(total_amount_of_trees) FROM table_10342194_3 WHERE district = "Leninsky"
sql_create_context
CREATE TABLE table_52629 ( "Week" text, "Opponent" text, "Result" text, "Game site" text, "Time" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opponent that has attendance of 76,965
SELECT "Opponent" FROM table_52629 WHERE "Attendance" = '76,965'
wikisql
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 t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '卫博裕' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 8489.49)
css
CREATE TABLE table_name_72 ( points INTEGER, entrant VARCHAR, year VARCHAR, engine VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Brown Motors best point total using the Offenhauser L4 engine since 1950?
SELECT MAX(points) FROM table_name_72 WHERE year > 1950 AND engine = "offenhauser l4" AND entrant = "brown motors"
sql_create_context
CREATE TABLE table_name_50 ( surface VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the surface for the game that was played on 12-Apr-2005?
SELECT surface FROM table_name_50 WHERE date = "12-apr-2005"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( ...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypocalcemia' AND DATETIME(diagnosis.diagnos...
eicu
CREATE TABLE happy_hour_member ( hh_id number, member_id number, total_amount number ) CREATE TABLE member ( member_id number, name text, membership_card text, age number, time_of_purchase number, level_of_membership number, address text ) CREATE TABLE happy_hour ( hh_id nu...
SELECT name FROM member WHERE address = 'Harford' OR address = 'Waterbury'
spider
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 person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE table_29736 ( "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_29736 WHERE "Game" = '23'
wikisql
CREATE TABLE table_204_833 ( id number, "game" number, "date" text, "team" text, "score" text, "high points" text, "high rebounds" text, "high assists" text, "location\nattendance" text, "record" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT "score" - "score" FROM table_204_833 WHERE "date" = 'april 9'
squall
CREATE TABLE table_name_46 ( seats_2010 INTEGER, in_de_creased_by VARCHAR, seats_2005 VARCHAR, governorate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lowest Seats 2010 which has Seats 2005 smaller than 9, and a Governorate of al muthanna...
SELECT MIN(seats_2010) FROM table_name_46 WHERE seats_2005 < 9 AND governorate = "al muthanna governorate" AND in_de_creased_by > 2
sql_create_context
CREATE TABLE table_11094950_1 ( conference VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What conference was the churchill chargers team in?
SELECT conference FROM table_11094950_1 WHERE team = "Churchill Chargers"
sql_create_context
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT JOB_TITLE, AVG(SALARY) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID GROUP BY T2.JOB_TITLE ORDER BY AVG(SALARY) DESC
nvbench
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E...
advising
CREATE TABLE table_39596 ( "Name" text, "Dist. from Origin" text, "Dist. from Terminus" text, "Speed Limit" text, "Location (all in Nagano )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which location includes Sakakita BS?
SELECT "Location (all in Nagano )" FROM table_39596 WHERE "Name" = 'sakakita bs'
wikisql
CREATE TABLE table_48302 ( "Round" text, "Team #1" text, "Agg." text, "Team #2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the agg when team #2 is 2006 UEFA Intertoto Cup?
SELECT "Agg." FROM table_48302 WHERE "Team #2" = '2006 uefa intertoto cup'
wikisql
CREATE TABLE table_255188_3 ( location VARCHAR, nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What location is nicknamed the 49ers?
SELECT location FROM table_255188_3 WHERE nickname = "49ers"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE customers_cards ( card_id number, customer_id number, card_type_code text, card_number text, date_valid_from time, date_valid_to time, other_card_details text ) CREATE TABLE customers ( customer_id number, customer_first_name text, customer_last_name text, custo...
SELECT customer_id, COUNT(*) FROM customers_cards GROUP BY customer_id
spider
CREATE TABLE table_name_60 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which record is dated April 8?
SELECT record FROM table_name_60 WHERE date = "april 8"
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, ...
SELECT Title, Body, Tags FROM Posts WHERE NOT Tags IS NULL LIMIT 500
sede
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, Price FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Price
nvbench
CREATE TABLE table_28042 ( "Series no." real, "No. in season" real, "Title" text, "Written by" text, "Directed by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the original...
SELECT "Original air date" FROM table_28042 WHERE "U.S. viewers (millions)" = '5.60'
wikisql
CREATE TABLE table_22032599_1 ( film_title_used_in_nomination VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- HOw many films did martin repka category:articles with hcards direct?
SELECT COUNT(film_title_used_in_nomination) FROM table_22032599_1 WHERE director = "Martin Repka Category:Articles with hCards"
sql_create_context
CREATE TABLE table_36971 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of first prizes in USD for the Canadian Open?
SELECT SUM("1st prize ( $ )") FROM table_36971 WHERE "Tournament" = 'canadian open'
wikisql
CREATE TABLE table_name_31 ( analog_channel VARCHAR, digital_channel VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which analog channel has a digital channel of 4.1?
SELECT analog_channel FROM table_name_31 WHERE digital_channel = "4.1"
sql_create_context
CREATE TABLE table_2866503_1 ( us_air_date VARCHAR, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the U.S. air date when the U.S. viewers are 7.5 million?
SELECT us_air_date FROM table_2866503_1 WHERE us_viewers__million_ = "7.5"
sql_create_context
CREATE TABLE table_name_76 ( location VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is nac breda club located?
SELECT location FROM table_name_76 WHERE club = "nac breda"
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date D...
SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type
nvbench
CREATE TABLE table_64020 ( "Actor" text, "Character" text, "Soap Opera" text, "Years" text, "Duration" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Soap Opera with the character Teemu Luotola?
SELECT "Soap Opera" FROM table_64020 WHERE "Character" = 'teemu luotola'
wikisql
CREATE TABLE table_name_59 ( record VARCHAR, home VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Record that has the Home of detroit, and the Visitor of phoenix?
SELECT record FROM table_name_59 WHERE home = "detroit" AND visitor = "phoenix"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT patients.dob FROM patients WHERE patients.subject_id = 1819
mimic_iii
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 zzmzjzjlb.JLSJ FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '15752379757' UNION SELECT fzzmzjzjlb.JLSJ FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '15752379757'
css
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text...
SELECT SUM(CASE WHEN LastActivityDate < DATEADD(mm, -1, GETDATE()) AND Score < 0 THEN 1 ELSE 0 END) FROM Posts WHERE ParentId = 2140
sede
CREATE TABLE table_name_9 ( player VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player from Japan?
SELECT player FROM table_name_9 WHERE country = "japan"
sql_create_context
CREATE TABLE table_300283_1 ( name_in_basque VARCHAR, official_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name in Basque of the municipality whose official name is Kuartango?
SELECT name_in_basque FROM table_300283_1 WHERE official_name = "Kuartango"
sql_create_context
CREATE TABLE table_name_32 ( nationality VARCHAR, cardinalatial_order_and_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the nationality of Cardinal-Bishop of Albano?
SELECT nationality FROM table_name_32 WHERE cardinalatial_order_and_title = "cardinal-bishop of albano"
sql_create_context
CREATE TABLE gwyjzb ( 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 COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '蒋飞白' AND t_kc22.STA_DATE BETWEEN '2000-04-18' AND '2006-08-04' AND gwyjzb.MED_SER_ORG_NO = '4684405' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_...
css
CREATE TABLE table_name_83 ( total INTEGER, position VARCHAR, a_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total when the position was more than 6 and had an A Score of less than 7.6?
SELECT MAX(total) FROM table_name_83 WHERE position > 6 AND a_score < 7.6
sql_create_context
CREATE TABLE table_name_70 ( runs INTEGER, innings VARCHAR, not_outs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average amount of Runs that has 40 innings, and Not outs larger than 6?
SELECT AVG(runs) FROM table_name_70 WHERE innings = 40 AND not_outs > 6
sql_create_context
CREATE TABLE table_60623 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on February 21 when the home team was the Pittsburgh Penguins?
SELECT "Score" FROM table_60623 WHERE "Home" = 'pittsburgh penguins' AND "Date" = 'february 21'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < "2105"
mimicsql_data
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ...
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 = 6196)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperature c (cal...
mimic_iii
CREATE TABLE table_3506 ( "Year" real, "Qatari Male" real, "Qatari Female" real, "Total Qatari" real, "Non Qatari Male" real, "Non Qatari Female" real, "Total Non Qatar" real, "Total Male" real, "Total Female" real, "Grand Total" real ) -- Using valid SQLite, answer the followi...
SELECT MAX("Grand Total") FROM table_3506 WHERE "Qatari Male" = '1104'
wikisql
CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, ...
SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname IN ('WordNet', 'Dbpedia') AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid GROUP BY paper.paperid
scholar
CREATE TABLE table_name_13 ( successful_defenses INTEGER, location VARCHAR, reign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of successful defenses in brandon, florida and a reign less than 1?
SELECT MAX(successful_defenses) FROM table_name_13 WHERE location = "brandon, florida" AND reign < 1
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 mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has friends that are ol...
SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person)
nvbench
CREATE TABLE table_name_76 ( railway VARCHAR, class VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which railway has a class of 250 and year 1936?
SELECT railway FROM table_name_76 WHERE class = "250" AND year = "1936"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG...
css
CREATE TABLE table_63221 ( "Season" text, "Pitcher" text, "Decision" text, "Opponent" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the pitcher from the 1994 season that had the Cleveland Indians as an opponent?
SELECT "Pitcher" FROM table_63221 WHERE "Opponent" = 'cleveland indians' AND "Season" = '1994'
wikisql
CREATE TABLE table_73464 ( "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. -- When g...
SELECT "Date" FROM table_73464 WHERE "High points" = 'George Hill (29)'
wikisql
CREATE TABLE table_33932 ( "Model Number" text, "Stepping" text, "Frequency" text, "L2 Cache" text, "Multi 1" text, "V Core" text, "Socket" text, "Release Date" text, "Part Number(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Stepping" FROM table_33932 WHERE "Part Number(s)" = 'adh4450iaa5do'
wikisql
CREATE TABLE table_10998 ( "1910" real, "1920" real, "1930" real, "1940" real, "1950" real, "1960" real, "1970" real, "1980" real, "1990" real, "2000" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest figure in ...
SELECT MIN("1960") FROM table_10998 WHERE "1940" = '1,115' AND "1990" < '928'
wikisql
CREATE TABLE table_72542 ( "Series #" real, "Season #" real, "Title" text, "Story by" text, "Teleplay by" text, "Directed by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of values for 'Te...
SELECT COUNT("Teleplay by") FROM table_72542 WHERE "Series #" = '35'
wikisql
CREATE TABLE table_26842217_6 ( time VARCHAR, visiting_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was #7 Oregon a visiting team?
SELECT time FROM table_26842217_6 WHERE visiting_team = "#7 Oregon"
sql_create_context
CREATE TABLE table_40787 ( "Date" text, "Result" text, "Score" text, "Brazil scorers" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for the South American Championship dated December 13, 1925?
SELECT "Result" FROM table_40787 WHERE "Competition" = 'south american championship' AND "Date" = 'december 13, 1925'
wikisql
CREATE TABLE table_29141354_1 ( scores VARCHAR, episode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the result on 01x06
SELECT scores FROM table_29141354_1 WHERE episode = "01x06"
sql_create_context
CREATE TABLE table_344 ( "Number Range" text, "Introduced" text, "Builder" text, "Engine" text, "Weight (long tons)" text, "Seats" text, "Withdrawn" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the builder where wi...
SELECT "Builder" FROM table_344 WHERE "Withdrawn" = '1954–1958'
wikisql
CREATE TABLE table_77726 ( "Driver" text, "Car #" real, "Make" text, "Points" real, "Laps" real, "Winnings" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the make of car 31?
SELECT "Make" FROM table_77726 WHERE "Car #" = '31'
wikisql
CREATE TABLE table_68515 ( "Round" real, "Name" text, "Position" text, "School" text, "Signed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Was the University of Michigan Signed?
SELECT "Signed" FROM table_68515 WHERE "School" = 'university of michigan'
wikisql
CREATE TABLE table_45372 ( "Stage" text, "Winner" text, "General Classification" text, "Mountains Classification" text, "Points Classification" text, "Sprints classification" text, "Team Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Mountains Classification" FROM table_45372 WHERE "Winner" = 'thor hushovd' AND "Sprints classification" = 'no award'
wikisql
CREATE TABLE table_73476 ( "Player" text, "Games Played" real, "Minutes" real, "Field Goals" real, "Three Pointers" real, "Free Throws" real, "Rebounds" real, "Assists" real, "Blocks" real, "Steals" real, "Points" real ) -- Using valid SQLite, answer the following questions...
SELECT MAX("Blocks") FROM table_73476 WHERE "Rebounds" = '198'
wikisql
CREATE TABLE table_name_60 ( nationality VARCHAR, years_for_jazz VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of the player on the Jazz from 1974-79?
SELECT nationality FROM table_name_60 WHERE years_for_jazz = "1974-79"
sql_create_context
CREATE TABLE table_name_54 ( year VARCHAR, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year was the artist Afro-dite?
SELECT year FROM table_name_54 WHERE artist = "afro-dite"
sql_create_context
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 t.Name AS "Close Reason", SUM(Count) AS Count FROM (SELECT CAST(PostHistory.Comment AS INT) AS CloseReasonId, 1 AS Count FROM PostHistory WHERE (PostHistoryTypeId = 10) AND ((Text LIKE @searchUserId1) OR (Text LIKE @searchUserId2))) AS a, CloseReasonTypes AS t WHERE a.CloseReasonId = t.Id GROUP BY a.CloseReasonI...
sede
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7279066' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT)
css
CREATE TABLE table_50134 ( "Model" text, "Manufacturer" text, "Weight (kg)" real, "Display size (in)" real, "Processor model" text, "Storage type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Display size (in) has a Model of vaio pcg-u3?...
SELECT COUNT("Display size (in)") FROM table_50134 WHERE "Model" = 'vaio pcg-u3'
wikisql
CREATE TABLE table_name_35 ( date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is it has 15,557 Attendances?
SELECT date FROM table_name_35 WHERE attendance = "15,557"
sql_create_context