instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_27 ( try_bonus VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What try bonus has a club of caerphilly rfc?
SELECT try_bonus FROM table_name_27 WHERE club = "caerphilly rfc"
sql_create_context
CREATE TABLE table_name_46 ( combined VARCHAR, super_g VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Combined, when Super G is less than 10, and when Overall is less than 4?
SELECT combined FROM table_name_46 WHERE super_g < 10 AND overall < 4
sql_create_context
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter DESC
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "3" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_8149 ( "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. -- Who had...
SELECT "High points" FROM table_8149 WHERE "Location Attendance" = 'united center 20,389'
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 demographic.expire_flag, demographic.diagnosis FROM demographic WHERE demographic.name = "Walter Locher"
mimicsql_data
CREATE TABLE table_name_76 ( time VARCHAR, react VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total Time listings have a 0.209 React entry and a Rank that is greater than 7?
SELECT COUNT(time) FROM table_name_76 WHERE react = 0.209 AND rank > 7
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 diagnoses.short_title = "Seroma complicting proc"
mimicsql_data
CREATE TABLE mzb ( CLINIC_ID 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, INSU_TYPE text, IN...
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '魏嘉宝' AND t_kc22.STA_DATE BETWEEN '2000-01-30' AND '2018-10-28' AND t_kc22.SOC_SRT_DIRE_NM = '奥氮平片' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '魏嘉宝' AN...
css
CREATE TABLE table_52420 ( "Result" text, "Opponent" text, "Method" text, "Event" text, "Date" real, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result with notes of quarter-finals and event of adcc 2001 absolute
SELECT "Result" FROM table_52420 WHERE "Notes" = 'quarter-finals' AND "Event" = 'adcc 2001 absolute'
wikisql
CREATE TABLE table_35983 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Events is the highest one that has a Top-10 larger than 7,...
SELECT MAX("Events") FROM table_35983 WHERE "Top-10" > '7' AND "Wins" < '2'
wikisql
CREATE TABLE table_61420 ( "Name" text, "Street address" text, "Years as tallest" text, "Height ft ( m )" text, "Floors" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE YEAR'S TALLEST VALUE WITH FLOORS LESS THAN 24, AND 05.0 210 north cha...
SELECT "Years as tallest" FROM table_61420 WHERE "Floors" < '24' AND "Street address" = '05.0 210 north charles street'
wikisql
CREATE TABLE table_name_83 ( catalogue VARCHAR, song_title VARCHAR, track VARCHAR, recorded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What catalogue has a track less than 16 and 2/3/56 recorded with a song titled Lawdy Miss Clawdy?
SELECT catalogue FROM table_name_83 WHERE track < 16 AND recorded = "2/3/56" AND song_title = "lawdy miss clawdy"
sql_create_context
CREATE TABLE table_70829 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average of Fiji with t10 Finish?
SELECT AVG("Total") FROM table_70829 WHERE "Finish" = 't10' AND "Country" = 'fiji'
wikisql
CREATE TABLE table_53 ( "Year" real, "Aircraft kilometers" real, "Departures" real, "Flying hours" real, "Passengers" real, "Seat factor" text, "Employees" real, "Profit/loss" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Of the years t...
SELECT MAX("Aircraft kilometers") FROM table_53 WHERE "Departures" = '17096'
wikisql
CREATE TABLE table_name_50 ( gold VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country won gold in the year(s) that Chinese Taipei won bronze?
SELECT gold FROM table_name_50 WHERE bronze = "chinese taipei"
sql_create_context
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
SELECT T3.Name, COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_83 ( provider VARCHAR, free_or_pay VARCHAR, transmission VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which provider is pay with analogue cable?
SELECT provider FROM table_name_83 WHERE free_or_pay = "pay" AND transmission = "analogue cable"
sql_create_context
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 t.Id, 'site://review/low-quality-posts/' + CAST(t.Id AS TEXT) AS "review_link", t.ReviewTaskTypeId, tt.Name, t.PostId, r.ReviewTaskResultTypeId, rt.Name, r.CreationDate FROM ReviewTasks AS t, ReviewTaskTypes AS tt, ReviewTaskResults AS r, ReviewTaskResultTypes AS rt WHERE t.ReviewTaskTypeId IN (3) AND t.ReviewTa...
sede
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT * FROM t_kc22 WHERE MED_CLINIC_ID = '84341147451' AND NOT MED_ORG_DEPT_NM LIKE '%传染科%'
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 hz_info ( KH text, KLX number...
SELECT zyjzjlb.CYKSDM, zyjzjlb.CYKSMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '19545678298'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.icd9_code = "5188"
mimicsql_data
CREATE TABLE table_50207 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the years won with a total of 282?
SELECT "Year(s) won" FROM table_50207 WHERE "Total" = '282'
wikisql
CREATE TABLE table_name_85 ( county VARCHAR, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What counties mascot are the Red Ramblers?
SELECT county FROM table_name_85 WHERE mascot = "red ramblers"
sql_create_context
CREATE TABLE table_name_19 ( opened INTEGER, manufacturer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which average Opened has a Manufacturer of vekoma?
SELECT AVG(opened) FROM table_name_19 WHERE manufacturer = "vekoma"
sql_create_context
CREATE TABLE table_29702 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the po...
SELECT "Position" FROM table_29702 WHERE "Series" = 'Austria Formel 3 Cup'
wikisql
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_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY Team_ID
nvbench
CREATE TABLE table_name_41 ( co_driver VARCHAR, number VARCHAR, laps VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the co-driver for the team with more than 160 laps and the number 6 after 2010?
SELECT co_driver FROM table_name_41 WHERE laps > 160 AND year > 2010 AND number = 6
sql_create_context
CREATE TABLE table_10015132_9 ( nationality VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the nationality of the players on the Fresno State school/club team?
SELECT nationality FROM table_10015132_9 WHERE school_club_team = "Fresno State"
sql_create_context
CREATE TABLE table_11303072_9 ( nationality VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of David Bairstow?
SELECT nationality FROM table_11303072_9 WHERE player = "David Bairstow"
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID...
SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME ORDER BY SUM(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE a...
SELECT t3.labname FROM (SELECT t2.labname, 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 = 'breast ca' AND DATETIME(diagnosis.diagnosistime) >= ...
eicu
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Cr...
SELECT (COUNT(CASE WHEN Title LIKE '%?' THEN 1 END) * 1.0 / COUNT(*)) * 100 AS percent_question_marked, 100.0 * COUNT(CASE WHEN LOWER(LEFT(Title, 2)) = 'wh' THEN 1 END) / COUNT(*) AS percent_begin_wh, 100.0 * COUNT(CASE WHEN LOWER(LEFT(Title, 2)) = 'wh' AND Title LIKE '%?' THEN 1 END) / COUNT(*) AS percent_both FROM Po...
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM 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_NM = '奚心思' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_2538117_7 ( nickname VARCHAR, founding_university VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the founding university is in Charlotte, NC, what is the nickname?
SELECT nickname FROM table_2538117_7 WHERE founding_university = "Charlotte, NC"
sql_create_context
CREATE TABLE table_42395 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Result of the 2010 (83rd) Ceremony?
SELECT "Result" FROM table_42395 WHERE "Year (Ceremony)" = '2010 (83rd)'
wikisql
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CR...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI' AND CITY_2.city...
atis
CREATE TABLE table_52914 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Driver has 28 Laps and a Grid greater than 5?
SELECT "Driver" FROM table_52914 WHERE "Grid" > '5' AND "Laps" = '28'
wikisql
CREATE TABLE table_name_23 ( district VARCHAR, area__km_2__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total population of the district of Klang, with an area larger than 636?
SELECT COUNT(2010 AS _population) FROM table_name_23 WHERE district = "klang" AND area__km_2__ > 636
sql_create_context
CREATE TABLE table_name_23 ( losses INTEGER, win__percentage VARCHAR, no_result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of losses for the game with a win % of 71.43%, and No Result is more than 0?
SELECT SUM(losses) FROM table_name_23 WHERE win__percentage = "71.43%" AND no_result > 0
sql_create_context
CREATE TABLE table_name_19 ( result VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game played in front of 65,473?
SELECT result FROM table_name_19 WHERE attendance = "65,473"
sql_create_context
CREATE TABLE table_78523 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For teams with 7 wins, what is the number of goals against...
SELECT "Goals Against" FROM table_78523 WHERE "Wins" = '7'
wikisql
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_Games, School_ID FROM basketball_match
nvbench
CREATE TABLE table_21103 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" text, "Year named" real, "Name origin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years have a longitude measure of 20.0e?
SELECT COUNT("Year named") FROM table_21103 WHERE "Longitude" = '20.0E'
wikisql
CREATE TABLE procedures_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 admissions.admittime FROM admissions WHERE admissions.subject_id = 5364 AND STRFTIME('%y', admissions.admittime) >= '2100' ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
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 MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.insurance = "Medicaid"
mimicsql_data
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5351')) AND STRFTIME('%y-%m', allergy.allergytime) = '2105-06'
eicu
CREATE TABLE table_62961 ( "Hampden FL" text, "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 least amount of Byes when there are more than 2 wins and 1946 against?
SELECT MIN("Byes") FROM table_62961 WHERE "Against" = '1946' AND "Wins" > '2'
wikisql
CREATE TABLE table_203_697 ( id number, "player" text, "career" text, "nickname" text, "team inducted as" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many players were inducted as players of the philadelphia phillies ?
SELECT COUNT("player") FROM table_203_697 WHERE "team inducted as" = 'philadelphia phillies'
squall
CREATE TABLE table_name_89 ( region VARCHAR, catalogue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which region had a catalogue number of 9362482872?
SELECT region FROM table_name_89 WHERE catalogue = "9362482872"
sql_create_context
CREATE TABLE table_name_48 ( result VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Result in 2013?
SELECT result FROM table_name_48 WHERE year = 2013
sql_create_context
CREATE TABLE table_60393 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When rank is 7 and silver is less than 0, what is the total gold?
SELECT SUM("Gold") FROM table_60393 WHERE "Rank" = '7' AND "Silver" < '0'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT LAST_NAME, LOCATION_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID ORDER BY LAST_NAME DESC
nvbench
CREATE TABLE Financial_transactions ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many transactions do we have?
SELECT COUNT(*) FROM Financial_transactions
sql_create_context
CREATE TABLE table_name_54 ( region VARCHAR, label VARCHAR, catalog VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the region of the Alfa Records release with catalog ALCA-282?
SELECT region FROM table_name_54 WHERE label = "alfa records" AND catalog = "alca-282"
sql_create_context
CREATE TABLE table_14310205_1 ( team VARCHAR, conmebol_1996 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of teams where conmebol 1996 did not qualify?
SELECT COUNT(team) FROM table_14310205_1 WHERE conmebol_1996 = "did not qualify"
sql_create_context
CREATE TABLE table_28628309_6 ( player VARCHAR, totals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the player when totals were 105-161?
SELECT player FROM table_28628309_6 WHERE totals = "105-161"
sql_create_context
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 AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_CD = '18989' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-02-10' AND '2002-02-22' AND t_kc21.IN_DIAG_DIS_NM = '后循环缺血' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of...
SELECT Name, Market_Rate FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte) ORDER BY Name DESC
nvbench
CREATE TABLE table_24172078_2 ( segment_1 VARCHAR, episode__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the segment 1 for episode # 2/225
SELECT segment_1 FROM table_24172078_2 WHERE episode__number = "2/225"
sql_create_context
CREATE TABLE table_name_63 ( total VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total with a +4 to par?
SELECT total FROM table_name_63 WHERE to_par = "+4"
sql_create_context
CREATE TABLE table_12463 ( "College or Campus Name" text, "Location" text, "District" text, "Affiliation" text, "Estd" real, "Weblink" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year was anna university - panruti campus established?
SELECT SUM("Estd") FROM table_12463 WHERE "College or Campus Name" = 'anna university - panruti campus'
wikisql
CREATE TABLE table_23339 ( "Contestant" text, "Background" text, "Original team" text, "Age" real, "Hometown" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team was the contestant who finished in 10th place originally on?
SELECT "Original team" FROM table_23339 WHERE "Result" = '10th place'
wikisql
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT jybgb.BGDH FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '52622012' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO...
css
CREATE TABLE table_name_43 ( city VARCHAR, past_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what city has a past season of n/a?
SELECT city FROM table_name_43 WHERE past_season = "n/a"
sql_create_context
CREATE TABLE table_22214 ( "Position" real, "Channel" text, "Analogue terrestrial channel" text, "Digital terrestrial channel" text, "Internet" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the digital terrestria channel number for itv3?
SELECT "Digital terrestrial channel" FROM table_22214 WHERE "Channel" = 'ITV3'
wikisql
CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, PrepNurse INTEGER, Physician INTEGER, Start DATETIME, End DATETIME, ExaminationRoom TEXT ) CREATE TABLE Affiliated_With ( Physician INTEGER, Department INTEGER, PrimaryAffiliation BOOLEAN ) CREATE TABLE Departme...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(Name)
nvbench
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'bicarbonate - sodium bicarbonate' AND STRFTIME('%y', treatment.treatmentt...
eicu
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT vitalperiodic.systemicdiastolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-140729')) AND NOT vitalperiodic.systemicdiast...
eicu
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "0" AND lab.label = "Phosphate"
mimicsql_data
CREATE TABLE table_2668243_17 ( first_elected VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of first elected for thomas maxwell (j) 60.1% david woodcock (aj) 39.9%
SELECT COUNT(first_elected) FROM table_2668243_17 WHERE candidates = "Thomas Maxwell (J) 60.1% David Woodcock (AJ) 39.9%"
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 t_kc21.MED_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '47989923435')
css
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD...
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9763546' AND t_kc21.MED_ORG_DEPT_CD = '8589') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-01-18' AND '2018-09-14'
css
CREATE TABLE table_13305 ( "Period" text, "Internet Explorer" text, "Firefox" text, "Safari" text, "Opera" text, "Netscape" text, "Other Mozilla" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of users were using other Mozill...
SELECT "Other Mozilla" FROM table_13305 WHERE "Opera" = '2.29%'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2164.0"
mimicsql_data
CREATE TABLE table_42972 ( "City of License /Market" text, "Station" text, "Channel TV ( DT )" text, "Years owned" text, "Current affiliation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the city containing the KDKA-TV station?
SELECT "City of License /Market" FROM table_42972 WHERE "Station" = 'kdka-tv'
wikisql
CREATE TABLE table_name_32 ( competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition listed is dated November 17, 2003?
SELECT competition FROM table_name_32 WHERE date = "november 17, 2003"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-55642')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutpu...
eicu
CREATE TABLE table_33389 ( "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 venue did melbourne play at as the away tea...
SELECT "Venue" FROM table_33389 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE table_name_2 ( services VARCHAR, area_of_operation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What services were in the area of operation Wadi Borjuj?
SELECT services FROM table_name_2 WHERE area_of_operation = "wadi borjuj"
sql_create_context
CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text ) CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE el...
SELECT DISTINCT district FROM election
spider
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varch...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE (((flight.arrival_time <= 1715 AND flight.arrival_time >= 1645) AND CITY_2.city_code = AIRPORT_SERVICE_2.ci...
atis
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId numb...
SELECT Id AS "post_link", Score FROM Posts WHERE NOT DeletionDate IS NULL ORDER BY Score LIMIT 100
sede
CREATE TABLE table_name_7 ( venue VARCHAR, competition VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which venue did he place 3rd in the World Race Walking Cup?
SELECT venue FROM table_name_7 WHERE competition = "world race walking cup" AND position = "3rd"
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 txmzjzjlb.JZZDBM, txmzjzjlb.JZZDSM FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '91671154792' UNION SELECT ftxmzjzjlb.JZZDBM, ftxmzjzjlb.JZZDSM FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '91671154792'
css
CREATE TABLE table_name_47 ( state VARCHAR, member VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What state did Hon David Beddall belong to?
SELECT state FROM table_name_47 WHERE member = "hon david beddall"
sql_create_context
CREATE TABLE table_8891 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of points with more than 5 losses and more than 14 played?
SELECT SUM("Points") FROM table_8891 WHERE "Lost" > '5' AND "Played" > '14'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "1821"
mimicsql_data
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 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 = '29536209' AND t_kc22.STA_DATE BETWEEN '2016-09-15' AND '2019-01-13' AND t_kc21.MED_SER_ORG_NO = '8557813' AND t_kc22.MED_INV...
css
CREATE TABLE table_name_8 ( attenmdance VARCHAR, stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance at war memorial stadium?
SELECT attenmdance FROM table_name_8 WHERE stadium = "war memorial stadium"
sql_create_context
CREATE TABLE table_2411 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When there are 7.5 million viewers what is the archive?
SELECT "Archive" FROM table_2411 WHERE "Viewers (in millions)" = '7.5'
wikisql
CREATE TABLE table_name_19 ( best_score VARCHAR, worst_dancer_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the best score, with the worst dancer(s) gethin jones/kenny logan?
SELECT best_score FROM table_name_19 WHERE worst_dancer_s_ = "gethin jones/kenny logan"
sql_create_context
CREATE TABLE table_56967 ( "Track" real, "Title" text, "Translation" text, "Composer" text, "Recorded" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tracks were Recorded 1964-01-08?
SELECT COUNT("Track") FROM table_56967 WHERE "Recorded" = '1964-01-08'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilirubin, indirect') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admi...
mimic_iii
CREATE TABLE table_203_494 ( id number, "party" text, "votes" number, "%" number, "swing" number, "seats" number, "change" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many seats does the independent party hold ?
SELECT "seats" FROM table_203_494 WHERE "party" = 'independent'
squall
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 inputevents_cv ( ...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'loc exc les metatar/t...
mimic_iii
CREATE TABLE table_9202 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest round for the player Claude Periard?
SELECT MIN("Round") FROM table_9202 WHERE "Player" = 'claude periard'
wikisql
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(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-7471') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unit...
eicu
CREATE TABLE table_32665 ( "Player" text, "Nationality" text, "Position" text, "From" real, "School/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which of the above are from 1987?
SELECT "School/Country" FROM table_32665 WHERE "From" = '1987'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImage...
SELECT Users.Id, Posts.Id, Posts.Tags FROM Posts INNER JOIN Users ON Users.Id = Posts.OwnerUserId
sede