instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_80136 ( "Name" text, "Gender" text, "Area" text, "Authority" text, "Decile" text, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What area is Central Takaka School in?
SELECT "Area" FROM table_80136 WHERE "Name" = 'central takaka school'
wikisql
CREATE TABLE table_4798 ( "Rank" real, "Player" text, "Years" text, "Games" real, "Ast. Avg." real, "Total Assists" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average rank for players with less than 2.9 Assists per game?
SELECT AVG("Rank") FROM table_4798 WHERE "Ast. Avg." < '2.9'
wikisql
CREATE TABLE table_name_68 ( overall INTEGER, college VARCHAR, position VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the overall draft number for the running back drafted after round 1 from fresno state?
SELECT SUM(overall) FROM table_name_68 WHERE position = "running back" AND round > 1 AND college = "fresno state"
sql_create_context
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(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FRO...
mimic_iii
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "5" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_2146364_2 ( third_place INTEGER, city_ VARCHAR, _nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of third place finishes when the city & nation was Vancouver, Canada?
SELECT MIN(third_place) FROM table_2146364_2 WHERE city_ & _nation = "Vancouver, Canada"
sql_create_context
CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_...
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY Competition_type
nvbench
CREATE TABLE table_name_23 ( date VARCHAR, week VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the date for the week larger than 1 and the opponent detroit lions?
SELECT date FROM table_name_23 WHERE week > 1 AND opponent = "detroit lions"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf...
css
CREATE TABLE table_242813_2 ( season INTEGER, pitcher VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most season for old hoss radbourn
SELECT MAX(season) FROM table_242813_2 WHERE pitcher = "Old Hoss Radbourn"
sql_create_context
CREATE TABLE table_12303563_2 ( winners VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many winners from vietnam
SELECT winners FROM table_12303563_2 WHERE nation = "Vietnam"
sql_create_context
CREATE TABLE user ( uid int, user_id varchar, name varchar ) CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, l...
SELECT business_id FROM business WHERE city = 'Los Angeles' AND name = 'Apple Store'
yelp
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 JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT demographic.days_stay, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "17595"
mimicsql_data
CREATE TABLE table_name_90 ( round VARCHAR, rank INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Round, when Rank is less than 117?
SELECT round FROM table_name_90 WHERE rank < 117
sql_create_context
CREATE TABLE table_name_92 ( goals_against INTEGER, wins VARCHAR, draws VARCHAR, losses VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average goals against for draws of 8 and wins more than 22 with losses less than 12
SELECT AVG(goals_against) FROM table_name_92 WHERE draws = 8 AND losses < 12 AND wins > 22
sql_create_context
CREATE TABLE table_name_18 ( userpics_free VARCHAR, name VARCHAR, registration VARCHAR, yearly_cost_for_paid_account VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Userpics Free, when Registration is Open, when Yearly Cost For Paid Account is...
SELECT userpics_free FROM table_name_18 WHERE registration = "open" AND yearly_cost_for_paid_account = "unknown" AND name = "kraslan"
sql_create_context
CREATE TABLE csu_fees ( campus number, year number, campusfee number ) CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE discipline_enrollments ( ca...
SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees LIMIT 1
spider
CREATE TABLE table_54749 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time/retired for a grid less than 19, under 21 laps, and made by aprilia?
SELECT "Time/Retired" FROM table_54749 WHERE "Grid" < '19' AND "Manufacturer" = 'aprilia' AND "Laps" < '21'
wikisql
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 wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '谢修雅' AND hz_info.YLJGDM = '6550085' AND NOT wdmzjzjlb.JZKSMC LIKE '%小儿%' UNION SELECT bdmzjzj...
css
CREATE TABLE table_44788 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the away team that played home team of Perth Wildcats?
SELECT "Away team" FROM table_44788 WHERE "Home team" = 'perth wildcats'
wikisql
CREATE TABLE table_name_54 ( record VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Record, when Game is 27?
SELECT record FROM table_name_54 WHERE game = 27
sql_create_context
CREATE TABLE table_1342013_12 ( result VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many results are listed for the election where Noah M. Mason was elected?
SELECT COUNT(result) FROM table_1342013_12 WHERE incumbent = "Noah M. Mason"
sql_create_context
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "80" AND prescriptions.formulary_drug_cd = "AZTR1000FB"
mimicsql_data
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, MIN(Weight) FROM people GROUP BY Sex
nvbench
CREATE TABLE table_204_791 ( id number, "event" text, "winner" text, "second" text, "third" text, "fourth" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of times chelsea williams was the winner between 2007 and 2010 ?
SELECT COUNT(*) FROM table_204_791 WHERE "winner" = 'chelsea wlliams'
squall
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '何欣欣' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID...
css
CREATE TABLE table_name_72 ( player VARCHAR, country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What United States player has a score of 69-73-68=210?
SELECT player FROM table_name_72 WHERE score = 69 - 73 - 68 = 210 AND country = "united states"
sql_create_context
CREATE TABLE table_9361 ( "Name" text, "Pinnacle height planned" text, "Year completion expected" real, "Structure type" text, "Country" text, "Town" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How high is the Goldin Finance 117 building curr...
SELECT "Pinnacle height planned" FROM table_9361 WHERE "Country" = 'china' AND "Name" = 'goldin finance 117'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, ...
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY la...
eicu
CREATE TABLE table_name_89 ( season VARCHAR, league VARCHAR, away VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season has a league 3rd liga, and away of 1-0?
SELECT season FROM table_name_89 WHERE league = "3rd liga" AND away = "1-0"
sql_create_context
CREATE TABLE table_16514 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the dates of the outgoing mana...
SELECT "Date of appointment" FROM table_16514 WHERE "Outgoing manager" = 'Colin Hendry'
wikisql
CREATE TABLE table_32914 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record of Jeremija Sanders' opponent?
SELECT "Record" FROM table_32914 WHERE "Opponent" = 'jeremija sanders'
wikisql
CREATE TABLE table_13211 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Gold has a Nation of south korea (kor), and Bronze smaller than 65?
SELECT AVG("Gold") FROM table_13211 WHERE "Nation" = 'south korea (kor)' AND "Bronze" < '65'
wikisql
CREATE TABLE table_name_99 ( money___$__ VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the money ($) for player justin leonard?
SELECT money___$__ FROM table_name_99 WHERE player = "justin leonard"
sql_create_context
CREATE TABLE trip ( id number, duration number, start_date text, start_station_name text, start_station_id number, end_date text, end_station_name text, end_station_id number, bike_id number, subscription_type text, zip_code number ) CREATE TABLE status ( station_id numb...
SELECT COUNT(*) FROM weather WHERE mean_humidity > 50 AND mean_visibility_miles > 8
spider
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
SELECT MIN(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-17348' AND NOT patient.hospitaldischargetime IS NULL ...
eicu
CREATE TABLE table_26625 ( "Name" text, "Deceased Spouse" text, "Cause of Death" text, "Date of Spouses Death" text, "Length of Marriage" text, "Children Together" text, "Current Marital Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT "Children Together" FROM table_26625 WHERE "Deceased Spouse" = 'Dennis Hawley'
wikisql
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_28330 ( "Frequency (Hz)" text, "R (\u03a9/km)" text, "L (mH/km)" text, "G (\u03bcS/km)" text, "C (nF/km)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the r ( /km) when the frequency is 10k?
SELECT "R (\u03a9/km)" FROM table_28330 WHERE "Frequency (Hz)" = '10k'
wikisql
CREATE TABLE invoices ( id INTEGER, customer_id INTEGER, invoice_date TIMESTAMP, billing_address VARCHAR(70), billing_city VARCHAR(40), billing_state VARCHAR(40), billing_country VARCHAR(40), billing_postal_code VARCHAR(10), total NUMERIC(10,2) ) CREATE TABLE artists ( id INTEGE...
SELECT first_name, SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10
nvbench
CREATE TABLE person ( name text, age number, city text, gender text, job text ) CREATE TABLE personfriend ( name text, friend text, year number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the friends of Alice that are doctors?
SELECT T2.friend FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'
spider
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) >= '2105' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 3
eicu
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_NM = '俞玉轩' AND t_kc21.CLINIC_TYPE = '住院' AND MOD(t_kc21.MED_AMOUT, 1) = 0
css
CREATE TABLE table_name_26 ( season VARCHAR, school_club_team VARCHAR, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season did the player who had the number 26 play on who came from far eastern?
SELECT season FROM table_name_26 WHERE school_club_team = "far eastern" AND number = 26
sql_create_context
CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT cname FROM college WHERE enr > (SELECT MAX(enr) FROM college WHERE state = 'FL')
spider
CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age...
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE Player_Attributes ( player_api_id VARCHAR ) CREATE TABLE Player ( player_name VARCHAR, player_api_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the top 3 players in terms of overall rating?
SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY overall_rating DESC LIMIT 3
sql_create_context
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE keyphrase...
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE paper.year = 2007 AND venue.venueid = paper.venueid AND venue.venuename = 'CVPR' AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(paper.paperid) DESC
scholar
CREATE TABLE table_name_11 ( tournament VARCHAR, winning_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament had a Winning score of 9 (69-72-68-70=279)?
SELECT tournament FROM table_name_11 WHERE winning_score = –9(69 - 72 - 68 - 70 = 279)
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.admission_location = "PHYS REFERRAL/NORMAL DELI"
mimicsql_data
CREATE TABLE table_50821 ( "Model number" text, "sSpec number" text, "Frequency" text, "L2 cache" text, "Mult." text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" text ) -- Using valid SQLite, answer the following questions ...
SELECT "Part number(s)" FROM table_50821 WHERE "Model number" = 'atom z500'
wikisql
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE CL...
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION, EMP_FNAME ORDER BY COUNT(EMP_FNAME)
nvbench
CREATE TABLE table_name_63 ( incumbent VARCHAR, republican VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the incumbent when Bo Itshaky was the Republican?
SELECT incumbent FROM table_name_63 WHERE republican = "bo itshaky"
sql_create_context
CREATE TABLE table_45159 ( "Date" text, "Race" text, "Track" text, "Winner" text, "Reports" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race happened at pocono on 08-02-2008?
SELECT "Race" FROM table_45159 WHERE "Track" = 'pocono' AND "Date" = '08-02-2008'
wikisql
CREATE TABLE table_name_12 ( nationality VARCHAR, games VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Nationality of the athlete in 1999 Fort-de-France in the Triple Jump?
SELECT nationality FROM table_name_12 WHERE games = "1999 fort-de-france" AND event = "triple jump"
sql_create_context
CREATE TABLE table_name_9 ( tckl VARCHAR, year VARCHAR, p_ko_ret VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of TCKL in 2000 with a P/KO RET less than 14?
SELECT COUNT(tckl) FROM table_name_9 WHERE year = "2000" AND p_ko_ret < 14
sql_create_context
CREATE TABLE table_name_53 ( date VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was the bell atlantic classic?
SELECT date FROM table_name_53 WHERE tournament = "bell atlantic classic"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Fetal/neonatal jaund NOS" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_name_12 ( match_report VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the match report for the game that was against Houston?
SELECT match_report FROM table_name_12 WHERE opponent = "houston"
sql_create_context
CREATE TABLE Customer_Address_History ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(15), customer_number VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255...
SELECT product_name, COUNT(product_name) FROM Products WHERE product_price > 1000 OR product_price < 500 GROUP BY product_name ORDER BY COUNT(product_name) DESC
nvbench
CREATE TABLE table_42074 ( "Category" text, "Frequency" text, "White" text, "Brown" text, "Black" text, "Amerindian" text, "Yellow" text, "Total" text, "difference between White and Black" real ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "White" FROM table_42074 WHERE "Black" = '38,05%'
wikisql
CREATE TABLE table_63689 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "React" real, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total time of the athlete from Canada with a lane less than 8 and a rank less t...
SELECT COUNT("Time") FROM table_63689 WHERE "Lane" < '8' AND "Nationality" = 'canada' AND "Rank" < '8'
wikisql
CREATE TABLE table_18878 ( "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 di...
SELECT "Team" FROM table_18878 WHERE "Record" = '13-48'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT SUM(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '朱秀兰' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-04-24' AND '2021-01-07' UNION SELECT SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PERSON...
css
CREATE TABLE table_46921 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country has the player Ted Schulz?
SELECT "Country" FROM table_46921 WHERE "Player" = 'ted schulz'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, s...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 26995 AND DATETIME(admissions.dischtime) >= DATETIME(CURRENT_TIME(), '-6 year') ORDER BY admissions.dischtime LIMIT 1
mimic_iii
CREATE TABLE table_76997 ( "Date" text, "Opponents" text, "H / A" text, "Result F \u2013 A" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the match when Manchester United played against the Hearts?
SELECT SUM("Attendance") FROM table_76997 WHERE "Opponents" = 'hearts'
wikisql
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.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_12419515_5 ( season__number INTEGER, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of season that was written by adam milch
SELECT MIN(season__number) FROM table_12419515_5 WHERE written_by = "Adam Milch"
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE 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 wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'M60.726' AND jyjgzbb.JCZBMC = 'D2聚体(柠檬酸盐)' UNION SELECT jyjgzbb.CK...
css
CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time bool ) CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type...
SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city
nvbench
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TI...
SELECT COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_26555737_1 ( result VARCHAR, year__ceremony_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 2012 (85th) is the year (ceremony) how many results?
SELECT COUNT(result) FROM table_26555737_1 WHERE year__ceremony_ = "2012 (85th)"
sql_create_context
CREATE TABLE table_78182 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What grad has a Time/Retired of + 1:24.3?
SELECT "Grid" FROM table_78182 WHERE "Time/Retired" = '+ 1:24.3'
wikisql
CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Services ( service_id INTEGER, organization_id INTEGER, service_type_code CHAR(15), service_details VARCHAR(255) ) CREATE TABLE Timed_Sta...
SELECT other_details, resident_id FROM Residents ORDER BY other_details DESC
nvbench
CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Financial_Transactions ( ...
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' ORDER BY COUNT(date_account_opened) DESC
nvbench
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "9744"
mimicsql_data
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum nu...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >...
mimic_iii
CREATE TABLE table_name_84 ( comp VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Comp is on 2004-10-17?
SELECT comp FROM table_name_84 WHERE date = "2004-10-17"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE table_2930244_3 ( number_of_major_hurricanes VARCHAR, deaths VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the death is none what is the number of major hurricanes?
SELECT COUNT(number_of_major_hurricanes) FROM table_2930244_3 WHERE deaths = "None"
sql_create_context
CREATE TABLE table_name_85 ( year INTEGER, result VARCHAR, nominated_work_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the latest year that has the result of nominated and the nominated work title is n/a?
SELECT MAX(year) FROM table_name_85 WHERE result = "nominated" AND nominated_work_title = "n/a"
sql_create_context
CREATE TABLE table_204_364 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the year with the most events ?
SELECT "year" FROM table_204_364 GROUP BY "year" ORDER BY COUNT("competition") DESC LIMIT 1
squall
CREATE TABLE table_name_81 ( attendance INTEGER, opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average attendance when the New York Mets were opponents with a record of 51-33?
SELECT AVG(attendance) FROM table_name_81 WHERE opponent = "new york mets" AND record = "51-33"
sql_create_context
CREATE TABLE table_4750 ( "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 away team score at victoria park?
SELECT "Away team score" FROM table_4750 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE table_19839391_3 ( stats INTEGER, pitcher VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are Doug Davis' maximum pitching stats?
SELECT MAX(stats) FROM table_19839391_3 WHERE pitcher = "Doug Davis"
sql_create_context
CREATE TABLE table_204_310 ( id number, "month" text, "year" number, "player" text, "county" text, "club" text, "position" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many players were from waterford ?
SELECT COUNT("player") FROM table_204_310 WHERE "county" = 'waterford'
squall
CREATE TABLE table_24496403_1 ( completed VARCHAR, ship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many ships were named Carysfort?
SELECT COUNT(completed) FROM table_24496403_1 WHERE ship = "Carysfort"
sql_create_context
CREATE TABLE table_26939 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of period for yvon le roux
SELECT COUNT("Period") FROM table_26939 WHERE "Name" = 'Yvon Le Roux'
wikisql
CREATE TABLE table_36606 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Bronze has a Nation of mexico, and a Total larger than 1?
SELECT SUM("Bronze") FROM table_36606 WHERE "Nation" = 'mexico' AND "Total" > '1'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT COUNT(*) FROM jybgb WHERE JZLSH = '76583474062'
css
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Sc...
SELECT Id AS "comment_link", Text, UserId AS "user_link", CreationDate FROM Comments WHERE (Text LIKE '%##Word##%') AND (UserId = '##userid##') ORDER BY CreationDate
sede
CREATE TABLE table_15187735_15 ( netflix VARCHAR, segment_d VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the netflix episode number where Segment D is high-performance engines?
SELECT netflix FROM table_15187735_15 WHERE segment_d = "High-Performance Engines"
sql_create_context
CREATE TABLE table_26986076_2 ( wed_25_aug VARCHAR, mon_23_aug VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is wed 25 aug when mon 23 aug is 26' 57.82 89.957mph?
SELECT wed_25_aug FROM table_26986076_2 WHERE mon_23_aug = "26' 57.82 89.957mph"
sql_create_context
CREATE TABLE table_19763 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the game date in week 13?
SELECT "Date" FROM table_19763 WHERE "Week" = '13'
wikisql
CREATE TABLE table_name_36 ( opponent VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at the game with a loss of Sele (0-1)?
SELECT opponent FROM table_name_36 WHERE loss = "sele (0-1)"
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC te...
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '34439326471'
css
CREATE TABLE table_27859 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" text, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many places ...
SELECT COUNT("Settlement") FROM table_27859 WHERE "Cyrillic Name Other Names" = 'Његошево'
wikisql