instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sal...
SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE table_75808 ( "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 less than 3 wins and less than 15 losses?
SELECT MAX("Against") FROM table_75808 WHERE "Wins" < '3' AND "Losses" < '15'
wikisql
CREATE TABLE qtb ( 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 '2013-12-16' AND '2014-11-24' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHE...
css
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%'
nvbench
CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE volume ( volume_i...
SELECT MAX(weeks_on_top), MIN(weeks_on_top) FROM volume
spider
CREATE TABLE table_1569516_1 ( destination VARCHAR, service_pattern VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the service pattern sydenham then fast to norwood junction?
SELECT destination FROM table_1569516_1 WHERE service_pattern = "Sydenham then fast to Norwood Junction"
sql_create_context
CREATE TABLE table_27547668_2 ( title VARCHAR, prod_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the episode with production code 102?
SELECT title FROM table_27547668_2 WHERE prod_code = 102
sql_create_context
CREATE TABLE table_64065 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" real, "League Cup Goals" real, "Total Apps" text, "Total Goals" real ) -- Using valid SQLite, answer the following questi...
SELECT COUNT("Total Goals") FROM table_64065 WHERE "League Cup Goals" < '0'
wikisql
CREATE TABLE table_name_12 ( result VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the result when the opponent is at dallas cowboys?
SELECT result FROM table_name_12 WHERE opponent = "at dallas cowboys"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, ...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5887) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(),...
mimic_iii
CREATE TABLE table_27167 ( "Tie no" real, "Home team" text, "Score 1" text, "Away team" text, "Attendance" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many dates are there for tie number 12?
SELECT COUNT("Date") FROM table_27167 WHERE "Tie no" = '12'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.ZZYSGH = '06844302' AND wdmzjzjlb.JZKSRQ BETWEEN '2016-12-27' AND '2020-09-19' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info...
css
CREATE TABLE table_name_61 ( game INTEGER, high_assists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the sum of the games that had paul (9) for high assists?
SELECT SUM(game) FROM table_name_61 WHERE high_assists = "paul (9)"
sql_create_context
CREATE TABLE table_33008 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What state has the University of California, Los Angeles?
SELECT "State" FROM table_33008 WHERE "Host" = 'university of california, los angeles'
wikisql
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, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT CAST(DATEADD(week, DATEDIFF(week, @LastQuestion, CreationDate), @LastQuestion) AS DATE) AS Week, 1.0 * COUNT(DISTINCT v.Id) / COUNT(DISTINCT p.Id) FROM Votes AS v JOIN Posts AS p ON PostId = p.Id JOIN Users AS u ON OwnerUserId = u.Id WHERE PostTypeId = 1 AND VoteTypeId IN (2, 3) AND Reputation > '##rep?1##' GROU...
sede
CREATE TABLE table_59529 ( "Perpetrator" text, "Date" text, "Year" real, "Location" text, "Country" text, "Killed" real, "Injured" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many kills have 15 as the injured, with a year prior to 198...
SELECT SUM("Killed") FROM table_59529 WHERE "Injured" = '15' AND "Year" < '1987'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '025-28600' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE park ( park_id VARCHAR, park_name VARCHAR ) CREATE TABLE home_game ( park_id VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games were played in park 'Columbia Park' in 1907?
SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park'
sql_create_context
CREATE TABLE table_15665 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What authority does the rototuna area have?
SELECT "Authority" FROM table_15665 WHERE "Area" = 'rototuna'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '何子美' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-11-27' AND '2017-03-05' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-4312' AND patient.hospitaldischargetime IS NULL)
eicu
CREATE TABLE table_8003 ( "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. -- What wa...
SELECT "Score" FROM table_8003 WHERE "Date" = 'may 21'
wikisql
CREATE TABLE table_name_1 ( gross_debt_in_ INTEGER, debt_held_by_public__$billions_ VARCHAR, end_of_fiscal_year VARCHAR, as__percentage_of_gdp_low_high VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For End of Fiscal Years past 1980 that also have as...
SELECT AVG(gross_debt_in_) AS $billions_undeflated_treas FROM table_name_1 WHERE end_of_fiscal_year > 1980 AND as__percentage_of_gdp_low_high = "83.4-84.4" AND debt_held_by_public__$billions_ < 7 OFFSET 552
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Other radiotherapeutic procedure"
mimicsql_data
CREATE TABLE table_53462 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the time/retired for grid of 17
SELECT "Time/Retired" FROM table_53462 WHERE "Grid" = '17'
wikisql
CREATE TABLE table_24320 ( "Draw" real, "Song" text, "Artist" text, "Panel Points" real, "Televotes" real, "Televote Points" real, "Score" real, "Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of televote p...
SELECT COUNT("Televote Points") FROM table_24320 WHERE "Song" = 'Cry on my shoulders'
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 COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1561) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
mimic_iii
CREATE TABLE table_25675509_1 ( depth VARCHAR, latitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the latitude is 08.979 s, what is the depth?
SELECT depth FROM table_25675509_1 WHERE latitude = "08.979° S"
sql_create_context
CREATE TABLE table_203_586 ( id number, "#" number, "nation" text, "qualification tournament" text, "place in qt" number, "sailor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which nation came in last in the 2007 worlds qualification tourname...
SELECT "nation" FROM table_203_586 WHERE "qualification tournament" = '2007 worlds' ORDER BY "place in qt" DESC LIMIT 1
squall
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 lab ( subject_id text, hadm_id text, ...
SELECT demographic.days_stay, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Miguel Hodges"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "SNF" AND diagnoses.long_title = "Pneumonitis due to inhalation of food or vomitus"
mimicsql_data
CREATE TABLE table_21994729_3 ( title VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all the title directed by reginald hudlin
SELECT COUNT(title) FROM table_21994729_3 WHERE directed_by = "Reginald Hudlin"
sql_create_context
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
SELECT Year, COUNT(Year) FROM wine ORDER BY COUNT(Year)
nvbench
CREATE TABLE table_name_84 ( season VARCHAR, level VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season has a Level of 2nd, 29 points?
SELECT season FROM table_name_84 WHERE level = "2nd" AND points = 29
sql_create_context
CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VA...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions ORDER BY date_of_transaction
nvbench
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 Founder, COUNT(Founder) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY COUNT(Founder) DESC
nvbench
CREATE TABLE table_67285 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game attended by 25,022?
SELECT "Date" FROM table_67285 WHERE "Attendance" = '25,022'
wikisql
CREATE TABLE table_42932 ( "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. -- How many losses have a played greater than 8, y...
SELECT COUNT("Lost") FROM table_42932 WHERE "Played" > '8' AND "Team" = 'ypiranga-sp' AND "Position" > '5'
wikisql
CREATE TABLE table_49544 ( "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 the score of the game where the record was 22-55?
SELECT "Score" FROM table_49544 WHERE "Record" = '22-55'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, ...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'OAKLAND' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_20490 ( "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. -- How many millions of viewers were there for the episode with a run time of 18:0...
SELECT "Viewers (in millions)" FROM table_20490 WHERE "Run time" = '18:00'
wikisql
CREATE TABLE table_name_68 ( home_team VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What home team had an attendance record of 16,971?
SELECT home_team FROM table_name_68 WHERE attendance = "16,971"
sql_create_context
CREATE TABLE table_204_846 ( id number, "tie no" number, "home team" text, "score" text, "away team" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which crowd was bigger , the first or third game ?
SELECT "tie no" FROM table_204_846 WHERE "tie no" IN (1, 3) ORDER BY "attendance" DESC LIMIT 1
squall
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 MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'backache nos') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'star...
mimic_iii
CREATE TABLE table_26878 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" text, "2nd (m)" text, "Points" text, "Overall FHT Points" text, "Overall WC points (Rank)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the rank fo...
SELECT COUNT("Rank") FROM table_26878 WHERE "Nationality" = 'Switzerland'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-13409')) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(...
eicu
CREATE TABLE table_26375386_18 ( public INTEGER, couple VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHat was the max public with danniella and matthew?
SELECT MAX(public) FROM table_26375386_18 WHERE couple = "Danniella and Matthew"
sql_create_context
CREATE TABLE table_44213 ( "Name of peak" text, "Height (m)" real, "Height (ft)" real, "Prominence (m)" real, "Prominence (ft)" real, "Nearest Higher Neighbor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest prominence in ft o...
SELECT MAX("Prominence (ft)") FROM table_44213 WHERE "Prominence (m)" < '103'
wikisql
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRG...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE table_69251 ( "January" text, "February" text, "March" text, "April" text, "June" text, "July" text, "August" text, "September" text, "October" text, "November" text, "December" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "December" FROM table_69251 WHERE "November" = 'marlene janssen'
wikisql
CREATE TABLE table_24055352_1 ( high_school VARCHAR, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the high school of the player number 5?
SELECT high_school FROM table_24055352_1 WHERE number = 5
sql_create_context
CREATE TABLE table_8012 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of game with tie number of 10?
SELECT "Date" FROM table_8012 WHERE "Tie no" = '10'
wikisql
CREATE TABLE table_33501 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue where the home team scored 10...
SELECT "Venue" FROM table_33501 WHERE "Home team score" = '10.15 (75)'
wikisql
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 COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '8721079' AND zyjybgb.BGRQ BETWEEN '2006-09-08' AND '2010-10-18' GROUP BY zyjybgb.KSBM HAVING COUNT(*) >= 16 UNION SELECT mzjybgb.KSBM FROM mzjz...
css
CREATE TABLE table_name_73 ( radio_station_production_company VARCHAR, role VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Radio Station/Production Company that has a Role of interviewee & monologues is what radio station?
SELECT radio_station_production_company FROM table_name_73 WHERE role = "interviewee & monologues"
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 COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '7841691' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-04-23' AND '2010-08-18' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 2085.24) AS T
css
CREATE TABLE aircraft ( Aircraft_ID int, Order_Year int, Manufacturer text, Model text, Fleet_Series text, Powertrain text, Fuel_Propulsion text ) CREATE TABLE pilot ( Pilot_ID int, Pilot_name text, Rank int, Age int, Nationality text, Position text, Join_Year in...
SELECT Position, COUNT(Position) FROM pilot GROUP BY Position ORDER BY Position
nvbench
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, ...
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
CREATE TABLE transactions_lots ( transaction_id number, lot_id number ) CREATE TABLE lots ( lot_id number, investor_id number, lot_details text ) CREATE TABLE ref_transaction_types ( transaction_type_code text, transaction_type_description text ) CREATE TABLE purchases ( purchase_tran...
SELECT lot_details, investor_id FROM lots
spider
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '98519847' AND mzjzjlb.JZKSRQ BETWEEN '2005-12-14' AND '2010-02-05') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_...
css
CREATE TABLE table_49537 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the score when the surface is clay and the tournament...
SELECT "Score" FROM table_49537 WHERE "Surface" = 'clay' AND "Tournament" = 'san marino'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE"
mimicsql_data
CREATE TABLE inventory ( inventory_id number, film_id number, store_id number, last_update time ) CREATE TABLE city ( city_id number, city text, country_id number, last_update time ) CREATE TABLE payment ( payment_id number, customer_id number, staff_id number, rental_i...
SELECT T2.name, T1.category_id, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id
spider
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
SELECT EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID
nvbench
CREATE TABLE table_203_224 ( id number, "title" text, "year" number, "channel" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was her first role ?
SELECT "role" FROM table_203_224 WHERE id = 1
squall
CREATE TABLE table_name_49 ( ri_song_hui___prk__ VARCHAR, world_record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Ri Song-Hui when the olympic record is the world record and snatch was snatch?
SELECT ri_song_hui___prk__ FROM table_name_49 WHERE world_record = "olympic record" AND "snatch" = "snatch"
sql_create_context
CREATE TABLE table_5487 ( "Frequency" real, "Callsign" text, "Brand" text, "Format" text, "City of License" text, "Website" text, "Webcast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the highest frequency of the KBDR callsign?
SELECT MAX("Frequency") FROM table_5487 WHERE "Callsign" = 'kbdr'
wikisql
CREATE TABLE table_name_71 ( points VARCHAR, draw VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of points when draw is 4?
SELECT COUNT(points) FROM table_name_71 WHERE draw = 4
sql_create_context
CREATE TABLE table_36127 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the highest December against the Pittsburgh Penguins in a game larger than 27, ...
SELECT MAX("December") FROM table_36127 WHERE "Game" > '27' AND "Opponent" = 'pittsburgh penguins' AND "Points" < '41'
wikisql
CREATE TABLE table_32841 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round did Takayo Hashi face Yoko Hattori?
SELECT SUM("Round") FROM table_32841 WHERE "Opponent" = 'yoko hattori'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, ...
SELECT COUNT(*) FROM jybgb WHERE YLJGDM = '9692570' AND BGRQ BETWEEN '2002-02-27' AND '2016-10-08'
css
CREATE TABLE table_55904 ( "Runs" text, "Wicket" text, "Partnerships" text, "Versus" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the partnership in the game with 166* runs and an opponent of Namibia?
SELECT "Partnerships" FROM table_55904 WHERE "Versus" = 'namibia' AND "Runs" = '166*'
wikisql
CREATE TABLE manager ( player_id text, year number, team_id text, league_id text, inseason number, g number, w number, l number, rank number, plyr_mgr text ) CREATE TABLE batting_postseason ( year number, round text, player_id text, team_id text, league_id te...
SELECT T2.park_name FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2008 ORDER BY T1.attendance DESC LIMIT 1
spider
CREATE TABLE membership_register_branch ( Member_ID int, Branch_ID text, Register_Year text ) CREATE TABLE purchase ( Member_ID int, Branch_ID text, Year text, Total_pounds real ) CREATE TABLE member ( Member_ID int, Card_Number text, Name text, Hometown text, Level int...
SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '凤高翰' AND t_kc22.STA_DATE BETWEEN '2010-05-21' AND '2019-08-03' AND t_kc22.SELF_PAY_PRO < 0.48
css
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby i...
SELECT DISTINCT cite.citedpaperid, COUNT(1) AS DERIVED_FIELDalias0 FROM author, cite, writes WHERE author.authorname = 'Michael I. Jordan' AND writes.authorid = author.authorid AND writes.paperid = cite.citingpaperid GROUP BY cite.citedpaperid ORDER BY DERIVED_FIELDalias0 DESC
scholar
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 3
mimic_iii
CREATE TABLE table_name_53 ( losses INTEGER, wins INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of losses for a team with more than 0 wins?
SELECT MIN(losses) FROM table_name_53 WHERE wins > 0
sql_create_context
CREATE TABLE table_name_94 ( country VARCHAR, transfer_fee VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Country, when the Transfer fee is 'loan', and when the Name is Lynch?
SELECT country FROM table_name_94 WHERE transfer_fee = "loan" AND name = "lynch"
sql_create_context
CREATE TABLE table_56046 ( "Rank" text, "Country (or dependent territory)" text, "July 1, 2013 projection" real, "% of pop." real, "Average relative annual growth (%)" real, "Average absolute annual growth" real ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT AVG("Average relative annual growth (%)") FROM table_56046 WHERE "Rank" = '3' AND "Average absolute annual growth" > '1,051,000'
wikisql
CREATE TABLE table_51147 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the ...
SELECT SUM("Position") FROM table_51147 WHERE "Points 1" < '36' AND "Goals For" < '40' AND "Drawn" < '9'
wikisql
CREATE TABLE table_15829930_5 ( wins INTEGER, success_rate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the maximum wins for 68.75%
SELECT MAX(wins) FROM table_15829930_5 WHERE success_rate = "68.75%"
sql_create_context
CREATE TABLE table_name_34 ( average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 1990-91 has an average number of 1.035?
SELECT 1990 AS _91 FROM table_name_34 WHERE average = 1.035
sql_create_context
CREATE TABLE table_60486 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is To par, when Player is 'Larry Rinker'?
SELECT "To par" FROM table_60486 WHERE "Player" = 'larry rinker'
wikisql
CREATE TABLE fgwyjzb ( 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 AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_NM = '小儿麻醉科' AND gwyjzb.IN_HOSP_DATE BETWEEN '2003-05-11' AND '2016-12-20' AND gwyjzb.IN_DIAG_DIS_CD = 'T40.906' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_NM = '小儿麻醉科' AND fgwyjzb.IN_HOSP_D...
css
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE cours...
SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'SAC' AND course.number = 490 AND program_course.course_id = course.course_id
advising
CREATE TABLE table_name_48 ( team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2nd leg score for the match with a team 2 of Werder Bremen?
SELECT 2 AS nd_leg FROM table_name_48 WHERE team_2 = "werder bremen"
sql_create_context
CREATE TABLE table_24307126_3 ( assets_2013__bil$_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2013 profit for assets being 11.2
SELECT 2013 AS _profit__mil_usd__ FROM table_24307126_3 WHERE assets_2013__bil$_ = "11.2"
sql_create_context
CREATE TABLE table_28482 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the original artist for the song ' rhiannon '?
SELECT "Original artist" FROM table_28482 WHERE "Song choice" = ' Rhiannon '
wikisql
CREATE TABLE table_74671 ( "Country" text, "Year (most recent)" real, "Adult (15+) Literacy Rate Total" text, "Adult Men" text, "Adult Women" text, "Youth (15-24) Literacy Rate Total" text, "Youth Men" text, "Youth Women" text ) -- Using valid SQLite, answer the following questions for...
SELECT "Country" FROM table_74671 WHERE "Youth (15-24) Literacy Rate Total" = '99%' AND "Youth Men" = '98%'
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2138" AND lab.itemid = "50817"
mimicsql_data
CREATE TABLE on_call ( nurse number, blockfloor number, blockcode number, oncallstart time, oncallend time ) CREATE TABLE block ( blockfloor number, blockcode number ) CREATE TABLE room ( roomnumber number, roomtype text, blockfloor number, blockcode number, unavailable...
SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = "John Wen"
spider
CREATE TABLE procedures ( 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 ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4576" AND prescriptions.route = "IV BOLUS"
mimicsql_data
CREATE TABLE table_60525 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What median family income h...
SELECT "Median family income" FROM table_60525 WHERE "Population" > '93,643' AND "County" = 'cleveland'
wikisql
CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min numeric(2) ) CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE prereq ( ...
SELECT building, COUNT(building) FROM department WHERE budget > (SELECT AVG(budget) FROM department) GROUP BY building
nvbench
CREATE TABLE table_1341640_14 ( candidates VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What candidates were featured in the 1974 election?
SELECT candidates FROM table_1341640_14 WHERE first_elected = 1974
sql_create_context
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 ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1)) - (S...
mimic_iii
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '由于使用酒精引起的精神病性障碍' AND jyjgzbb.JCZBDM = '172184' UNION SELECT jyjgzb...
css
CREATE TABLE accelerator_compatible_browser ( accelerator_id number, browser_id number, compatible_since_year number ) CREATE TABLE web_client_accelerator ( id number, name text, operating_system text, client text, connection text ) CREATE TABLE browser ( id number, name text, ...
SELECT DISTINCT T1.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.market_share > 15
spider