instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_203_751 ( id number, "year" number, "title" text, "peak chart positions\nus\nair" number, "peak chart positions\nus\nmain" number, "peak chart positions\nus\nmod" number, "album" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "album" FROM table_203_751 GROUP BY "album" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_name_9 ( notes VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Notes, when Date is 2007?
SELECT notes FROM table_name_9 WHERE date = "2007"
sql_create_context
CREATE TABLE table_200_22 ( id number, "year" number, "single" text, "peak chart positions\nger" number, "peak chart positions\nire" number, "peak chart positions\nuk" number, "peak chart positions\nus" number, "peak chart positions\nus\nmain" number, "peak chart positions\nus\ndance...
SELECT "year" FROM table_200_22 WHERE "single" = '"old habits die hard"'
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients (...
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12938) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1
mimic_iii
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE...
SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY Payment_Method_Code
nvbench
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '14234507' AND hz_info.YLJGDM = '6215327' AND NOT zyjzjlb.CYKSMC LIKE '%心血管%'
css
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, ...
SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, program_course AS PROGRAM_COURSE_0, program_course AS PROGRAM_COURSE_1 WHERE COURSE_0.department = 'SAC' AND COURSE_0.number = 600 AND COURSE_1.department = 'SAC' AND COURSE_1.number = 480 AND PROGRAM_COURSE_0.course_id = COURSE_0.course_id AND PROGRAM_CO...
advising
CREATE TABLE table_41955 ( "Tournament" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text...
SELECT "2009" FROM table_41955 WHERE "2008" = '1r' AND "Tournament" = 'french open'
wikisql
CREATE TABLE table_2508633_11 ( college VARCHAR, nfl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many colleges have the NFL Team Buffalo Bills?
SELECT COUNT(college) FROM table_2508633_11 WHERE nfl_team = "Buffalo Bills"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(Team_ID) DESC
nvbench
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '5862783' AND fzzmzjzjlb.JZKSRQ BETWEEN '2005-08-04' AND '2010-11-06'
css
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people are under 4...
SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender
nvbench
CREATE TABLE table_27533947_1 ( players VARCHAR, grand_average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the grand average is 12.76-202, who is the player?
SELECT players FROM table_27533947_1 WHERE grand_average = "12.76-202"
sql_create_context
CREATE TABLE manager_half ( player_id TEXT, year INTEGER, team_id TEXT, league_id TEXT, inseason INTEGER, half INTEGER, g INTEGER, w INTEGER, l INTEGER, rank INTEGER ) CREATE TABLE pitching ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_i...
SELECT yearid, COUNT(yearid) FROM hall_of_fame
nvbench
CREATE TABLE table_name_7 ( team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the 2008 head coach of UCLA?
SELECT 2008 AS _head_coach FROM table_name_7 WHERE team = "ucla"
sql_create_context
CREATE TABLE table_21100348_11 ( player VARCHAR, runs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has 477 runs?
SELECT player FROM table_21100348_11 WHERE runs = 477
sql_create_context
CREATE TABLE table_6460 ( "District" text, "2010 Population (000)" real, "2008 GDP (USD bn) a" real, "2008 GDP per capita (USD) a" real, "Agri culture b" real, "Mining b" real, "Manufac turing b" real, "Services & cons truction b" real, "Exports (USD mn) 2011" text, "Median mo. s...
SELECT MIN("Vehicles (per 1000) d") FROM table_6460 WHERE "Agri culture b" > '12.6'
wikisql
CREATE TABLE table_72853 ( "Game" real, "Date" text, "Opponent" text, "Score/Time" text, "High points" text, "High rebounds" text, "High assists" text, "Arena/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT "Date" FROM table_72853 WHERE "Score/Time" = 'W 74-63'
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 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1882" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%malaga%' OR UPPER(Location) LIKE '%MALAGA%' OR Location LIKE '%Malaga%' AND Reputation >= 1000 ORDER BY Reputation DESC
sede
CREATE TABLE table_name_45 ( rank INTEGER, population_density___km_2__ VARCHAR, _percentage_growth__2006_11_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest rank of an area with a population density larger than 5.7 and a 2006 2011 per...
SELECT MAX(rank) FROM table_name_45 WHERE population_density___km_2__ > 5.7 AND _percentage_growth__2006_11_ = "5.7%"
sql_create_context
CREATE TABLE table_26734 ( "Year" text, "Championship" text, "54 holes" text, "Winning score" text, "Margin" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what tournament was the difference only 1 stroke and 54 holes wit...
SELECT "Championship" FROM table_26734 WHERE "Margin" = '1 stroke' AND "54 holes" = '2 shot deficit'
wikisql
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_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3985817' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM HAVING AVG(t_kc21.PERSON_AGE) > 23
css
CREATE TABLE table_name_27 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on January 12?
SELECT score FROM table_name_27 WHERE date = "january 12"
sql_create_context
CREATE TABLE table_72984 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Raiders points" real, "Opponents" real, "Raiders first downs" real, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who ...
SELECT "Opponent" FROM table_72984 WHERE "Attendance" = '60425'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY MAX(T1.Price) DESC
nvbench
CREATE TABLE table_60136 ( "Name" text, "Position" text, "Height" text, "Weight" real, "Year" text, "Home Town" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Year of the Player weighing 185?
SELECT "Year" FROM table_60136 WHERE "Weight" = '185'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe tex...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%tunis%' ORDER BY Reputation DESC LIMIT 10
sede
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'sputum, expectorated' AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-3 year'))
eicu
CREATE TABLE table_train_78 ( "id" int, "mini_mental_state_examination_mmse" int, "consent" bool, "swallow_oral_medication" bool, "rosen_modified_hachinski_ischemic_score" int, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- subject must...
SELECT * FROM table_train_78 WHERE mini_mental_state_examination_mmse >= 16 AND mini_mental_state_examination_mmse <= 26
criteria2sql
CREATE TABLE table_dev_6 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "renal_disease" bool, "hematocrit_hct" float, "creatinine_clearance_cl" float, "diastolic_blood_pressure_dbp" int, "symptomatic_coronary_artery_disease" bool, "hypertens...
SELECT * FROM table_dev_6 WHERE hypertension = 1 OR systolic_blood_pressure_sbp > 140 OR diastolic_blood_pressure_dbp > 90
criteria2sql
CREATE TABLE table_9029 ( "Date" text, "Time" text, "ACC Team" text, "Big Ten Team" text, "Location" text, "Television" text, "Attendance" real, "Winner" text, "Challenge Leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is ...
SELECT "Challenge Leader" FROM table_9029 WHERE "Time" = '9:30 pm' AND "Date" = 'wed., nov. 28'
wikisql
CREATE TABLE table_34521 ( "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 was the 1st leg of the match that had an aggregate of 4-3?
SELECT "1st leg" FROM table_34521 WHERE "Agg." = '4-3'
wikisql
CREATE TABLE reservations ( code number, room text, checkin text, checkout text, rate number, lastname text, firstname text, adults number, kids number ) CREATE TABLE rooms ( roomid text, roomname text, beds number, bedtype text, maxoccupancy number, basepric...
SELECT roomname FROM rooms WHERE baseprice > (SELECT AVG(baseprice) FROM rooms)
spider
CREATE TABLE Events ( Event_ID INTEGER, Address_ID INTEGER, Channel_ID INTEGER, Event_Type_Code CHAR(15), Finance_ID INTEGER, Location_ID INTEGER ) CREATE TABLE Assets_in_Events ( Asset_ID INTEGER, Event_ID INTEGER ) CREATE TABLE Parties ( Party_ID INTEGER, Party_Details VARCHA...
SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY COUNT(Product_Name)
nvbench
CREATE TABLE table_name_66 ( road_numbers VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the road numbers when the class is z-7?
SELECT road_numbers FROM table_name_66 WHERE class = "z-7"
sql_create_context
CREATE TABLE table_40100 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has an Against larger than 17, a...
SELECT MIN("Position") FROM table_40100 WHERE "Against" > '17' AND "Team" = 'juventus' AND "Drawn" < '4'
wikisql
CREATE TABLE table_43699 ( "Rank" real, "Date" text, "Attendance" real, "Opponent" text, "Texas Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent on September 26, 2009?
SELECT "Opponent" FROM table_43699 WHERE "Date" = 'september 26, 2009'
wikisql
CREATE TABLE table_67717 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of points when dr...
SELECT COUNT("Points") FROM table_67717 WHERE "Draw" = '4'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyeve...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hpt c w/o hepat co...
mimic_iii
CREATE TABLE table_name_63 ( player VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player is from France?
SELECT player FROM table_name_63 WHERE country = "france"
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2154" AND diagnoses.short_title = "Full incontinence-feces"
mimicsql_data
CREATE TABLE table_204_160 ( id number, "rank" number, "name" text, "nationality" text, "time" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many canadian swimmers were there ?
SELECT COUNT("name") FROM table_204_160 WHERE "nationality" = 'canada'
squall
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit...
eicu
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE chart...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14621) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE table_name_78 ( year VARCHAR, host_city VARCHAR, hosts VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year will Bangkok be the host city and Alicia Keys host?
SELECT year FROM table_name_78 WHERE host_city = "bangkok" AND hosts = "alicia keys"
sql_create_context
CREATE TABLE table_203_583 ( id number, "title" text, "release" number, "6th gen" text, "handheld" text, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many more games were released in 2005 than 2003 ?
SELECT (SELECT COUNT("title") FROM table_203_583 WHERE "release" = 2005) - (SELECT COUNT("title") FROM table_203_583 WHERE "release" = 2003)
squall
CREATE TABLE table_17995 ( "Year" real, "Competition" text, "Location" text, "Event" text, "Final-Rank" text, "Final-Score" text, "Qualifying Rank" real, "Qualifying Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highe...
SELECT MAX("Qualifying Rank") FROM table_17995 WHERE "Competition" = 'Olympic Trials' AND "Final-Rank" = '4' AND "Qualifying Score" = '15.100'
wikisql
CREATE TABLE table_75806 ( "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number listed under against when there were 15 losses and more than 1 win?
SELECT MAX("Against") FROM table_75806 WHERE "Losses" = '15' AND "Wins" > '1'
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 c...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808 AND admissions.dischtime IS NULL) AND transfers.careunit = 'sicu' ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE table_name_13 ( draw INTEGER, points VARCHAR, goals_conceded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the the highest Draw which has Points of 22 and Goals Conceded smaller than 26?
SELECT MAX(draw) FROM table_name_13 WHERE points = "22" AND goals_conceded < 26
sql_create_context
CREATE TABLE table_204_175 ( id number, "pos" text, "no." number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "laps led" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who rac...
SELECT "driver" FROM table_204_175 ORDER BY "pos" LIMIT 1
squall
CREATE TABLE table_1724 ( "Player" text, "League" real, "Scottish Cup" real, "League Cup" real, "Challenge Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most challenge cup for damon gray
SELECT MAX("Challenge Cup") FROM table_1724 WHERE "Player" = 'Damon Gray'
wikisql
CREATE TABLE district ( District_ID int, District_name text, Headquartered_City text, City_Population real, City_Area real ) CREATE TABLE store ( Store_ID int, Store_Name text, Type text, Area_size real, Number_of_product_category real, Ranking int ) CREATE TABLE store_prod...
SELECT Type, COUNT(*) FROM store GROUP BY Type
nvbench
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_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 = '50917298' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
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 = '022-82169' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE branch ( branch_id number, name text, open_year text, address_road text, city text, membership_amount text ) CREATE TABLE member ( member_id number, card_number text, name text, hometown text, level number ) CREATE TABLE purchase ( member_id number, bra...
SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3
spider
CREATE TABLE table_53991 ( "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode that has the production code ad1c05?
SELECT "Written by" FROM table_53991 WHERE "Production code" = 'ad1c05'
wikisql
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Hemodialysis"
mimicsql_data
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_203_621 ( id number, "player" text, "games played" number, "minutes played" number, "minutes played per game" number, "rebounds" number, "rebounds per game" number, "assists" number, "assists per game" number, "field goal %" number, "free throw %" number, ...
SELECT COUNT("player") FROM table_203_621
squall
CREATE TABLE table_name_60 ( mountains_classification VARCHAR, winner VARCHAR, general_classification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mountain classification of Mario Cipollini, who has a general classification of Pavel tonkov?...
SELECT mountains_classification FROM table_name_60 WHERE winner = "mario cipollini" AND general_classification = "pavel tonkov"
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 * FROM qtb WHERE qtb.PERSON_ID = '59383313' AND qtb.MED_SER_ORG_NO = '5882181' AND qtb.MED_ORG_DEPT_NM LIKE '%复工%' UNION SELECT * FROM gyb WHERE gyb.PERSON_ID = '59383313' AND gyb.MED_SER_ORG_NO = '5882181' AND gyb.MED_ORG_DEPT_NM LIKE '%复工%' UNION SELECT * FROM zyb WHERE zyb.PERSON_ID = '59383313' AND zyb.MED_S...
css
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 MIN(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2065"
mimicsql_data
CREATE TABLE table_29207 ( "Model" text, "Speed (GHz)" text, "L2 Cache (MB)" real, "L3 Cache (MB)" real, "FSB (MHz)" real, "TDP (W)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different FSB are there for the 7140N model?
SELECT COUNT("FSB (MHz)") FROM table_29207 WHERE "Model" = '7140N'
wikisql
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 OUT_HOSP_DATE FROM t_kc21 WHERE MED_CLINIC_ID = '39443182794'
css
CREATE TABLE table_4093 ( "Country" text, "Area (km 2 )" real, "Population(2012)" real, "Density (/km 2 )" real, "GDP (nominal), USD (2012)" text, "GDP (nominal) per capita, USD (2012)" text, "HDI (2012)" text, "Capital" text ) -- Using valid SQLite, answer the following questions for ...
SELECT MIN("Area (km 2 )") FROM table_4093 WHERE "Capital" = 'Nay Pyi Taw'
wikisql
CREATE TABLE match_result ( Rank int, Club_ID int, Gold int, Big_Silver int, Small_Silver int, Bronze int, Points int ) CREATE TABLE club ( Club_ID int, Club_name text, Region text, Start_year int ) CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starti...
SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '95814994943'
css
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 mzjzjlb ( HXPLC number, HZXM ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ...
css
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 demographic.diagnosis, prescriptions.drug_dose FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "18480"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.admityear < "2177"
mimicsql_data
CREATE TABLE product ( product_name VARCHAR, product_id VARCHAR ) CREATE TABLE problems ( product_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many problems does the product with the most problems have? List the number of the problems and produ...
SELECT COUNT(*), T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY Team_ID DESC
nvbench
CREATE TABLE table_54619 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the home game at Tampa Bay?
SELECT "Score" FROM table_54619 WHERE "Home" = 'tampa bay'
wikisql
CREATE TABLE enzyme ( name VARCHAR, location VARCHAR, product VARCHAR, id VARCHAR ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id VARCHAR, interaction_type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the distinct name, loc...
SELECT DISTINCT T1.name, T1.location, T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51218" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '65683500' AND t_kc22.STA_DATE BETWEEN '2004-07-13' AND '2012-06-26' AND t_kc22.SELF_PAY_AMO > 6686.51
css
CREATE TABLE table_58366 ( "Mid Gippsland FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sum of draws for losses less than 2 and wins of 16
SELECT SUM("Draws") FROM table_58366 WHERE "Wins" = '16' AND "Losses" < '2'
wikisql
CREATE TABLE table_55183 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the kickoff time for the Huber...
SELECT "Kickoff [a ]" FROM table_55183 WHERE "Game site" = 'hubert h. humphrey metrodome'
wikisql
CREATE TABLE table_204_637 ( id number, "type" text, "gauge" text, "railway" text, "works no." text, "year" text, "builder" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many total garratts did south african railways have ?
SELECT COUNT(*) FROM table_204_637 WHERE "railway" = 'south african railways'
squall
CREATE TABLE table_21362 ( "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 "Score" FROM table_21362 WHERE "Team" = 'Milwaukee'
wikisql
CREATE TABLE table_47598 ( "Rank" text, "Team" text, "Run 1" text, "Run 2" text, "Run 3" text, "Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which run 2 with final of 5:24.47?
SELECT "Run 2" FROM table_47598 WHERE "Final" = '5:24.47'
wikisql
CREATE TABLE machine ( machine_id number, making_year number, class text, team text, machine_series text, value_points number, quality_rank number ) CREATE TABLE repair_assignment ( technician_id number, repair_id number, machine_id number ) CREATE TABLE repair ( repair_id ...
SELECT name FROM technician WHERE team <> "NYY"
spider
CREATE TABLE store_district ( Store_ID int, District_ID int ) CREATE TABLE store ( Store_ID int, Store_Name text, Type text, Area_size real, Number_of_product_category real, Ranking int ) CREATE TABLE store_product ( Store_ID int, Product_ID int ) CREATE TABLE product ( pr...
SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000 ORDER BY City_Population DESC
nvbench
CREATE TABLE table_44446 ( "Designation" text, "Name" text, "Launch date" text, "ISS docking date" text, "Deorbit date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the ATV that deorbited on 29 september 2008, launch?
SELECT "Launch date" FROM table_44446 WHERE "Deorbit date" = '29 september 2008'
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Toxic encephalopathy" AND prescriptions.route = "IM"
mimicsql_data
CREATE TABLE table_name_18 ( operating_system_version VARCHAR, storage___flash__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which operating system has a storage (flash) of 128MB?
SELECT operating_system_version FROM table_name_18 WHERE storage___flash__ = "128mb"
sql_create_context
CREATE TABLE table_76167 ( "Year" text, "Winner" text, "Points" real, "Playoff result" text, "Win #" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Winner, when Win # is greater than 1, and when Points is less than 94?
SELECT "Winner" FROM table_76167 WHERE "Win #" > '1' AND "Points" < '94'
wikisql
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE class_of_service ( booking_...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE (city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.departure_time BETWEEN 0 AND 1200 AND flight.to_airport = airport_service.airport_code) AND flight.airline_code = 'AA'
atis
CREATE TABLE actor ( actor_id number, first_name text, last_name text, last_update time ) CREATE TABLE staff ( staff_id number, first_name text, last_name text, address_id number, picture others, email text, store_id number, active boolean, username text, passwor...
SELECT title FROM film WHERE rating = 'R'
spider
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.insurance = "Self Pay"
mimicsql_data
CREATE TABLE table_17080868_8 ( location_attendance VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 54 is the game where location attendance are.
SELECT location_attendance FROM table_17080868_8 WHERE game = 54
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC
nvbench
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( ...
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 99647 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
mimic_iii
CREATE TABLE table_name_89 ( chassis VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which chassis has marlboro brm as the team?
SELECT chassis FROM table_name_89 WHERE team = "marlboro brm"
sql_create_context
CREATE TABLE table_34170 ( "Team" text, "City, Region" text, "Arena" text, "Colours" text, "Head coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team is in the toyota h llin arena?
SELECT "Team" FROM table_34170 WHERE "Arena" = 'toyota höllin'
wikisql
CREATE TABLE table_45434 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Record, when Date is October 31?
SELECT "Record" FROM table_45434 WHERE "Date" = 'october 31'
wikisql
CREATE TABLE table_12028543_3 ( losingteam VARCHAR, cup_finaldate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losingteams were for the cup finaldate 20 August 1989?
SELECT COUNT(losingteam) FROM table_12028543_3 WHERE cup_finaldate = "20 August 1989"
sql_create_context