instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_76573 ( "Tournament" text, "Surface" text, "Week" text, "Winner and score" text, "Finalist" text, "Semifinalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the semifinalist for the Key Biscane tournament?
SELECT "Semifinalists" FROM table_76573 WHERE "Tournament" = 'key biscane'
wikisql
CREATE TABLE table_name_72 ( scored VARCHAR, position INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number scored of the team positioned lower than 10?
SELECT COUNT(scored) FROM table_name_72 WHERE position > 10
sql_create_context
CREATE TABLE table_name_35 ( name VARCHAR, time_retired VARCHAR, team VARCHAR, laps VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Name, when Laps is '50', when Grid is greater than 9, when Team is 'Jim Beam Racing', and whe...
SELECT name FROM table_name_35 WHERE laps = 50 AND grid > 9 AND team = "jim beam racing" AND time_retired = "+ 18.0s"
sql_create_context
CREATE TABLE table_name_7 ( tries_against VARCHAR, points_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tries against has Points for of 564?
SELECT tries_against FROM table_name_7 WHERE points_for = "564"
sql_create_context
CREATE TABLE table_47519 ( "Season" real, "Premiered" text, "Bachelorette" text, "Profile" text, "Winner" text, "Runner(s)-Up" text, "Proposal" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the bachelorette of the season that premier...
SELECT "Bachelorette" FROM table_47519 WHERE "Premiered" = 'may 24, 2010'
wikisql
CREATE TABLE table_name_18 ( country VARCHAR, place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country placed t8 and scored 71-71-71=213?
SELECT country FROM table_name_18 WHERE place = "t8" AND score = 71 - 71 - 71 = 213
sql_create_context
CREATE TABLE table_7765 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in final" text, "Score in final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament is on October 27, 2003?
SELECT "Tournament" FROM table_7765 WHERE "Date" = 'october 27, 2003'
wikisql
CREATE TABLE table_74443 ( "Rank" real, "Country/Territory" text, "Mister World" real, "1st runner-up" real, "2nd runner-up" real, "3rd runner-up" real, "4th runner-up" real, "Semifinalists" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT COUNT("1st runner-up") FROM table_74443 WHERE "Country/Territory" = 'Jamaica'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "BUCCAL"
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '38590585' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT LName, AVG(Age) FROM Student WHERE Sex = 'F' GROUP BY LName
nvbench
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SEC...
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_NAME) FROM DEPARTMENT
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 zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '90549392' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2021-11-01')
css
CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREA...
SELECT T1.Participant_ID, COUNT(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_ID
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE table_39192 ( "Round" text, "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Attendance has an Opponent of oxford united?
SELECT SUM("Attendance") FROM table_39192 WHERE "Opponent" = 'oxford united'
wikisql
CREATE TABLE table_28538368_2 ( young_rider_classification VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the young rider classification when Diego Ulissi won?
SELECT COUNT(young_rider_classification) FROM table_28538368_2 WHERE winner = "Diego Ulissi"
sql_create_context
CREATE TABLE Electoral_Register ( electoral_register_id INTEGER, cmi_cross_ref_id INTEGER ) CREATE TABLE Business_Rates ( business_rates_id INTEGER, cmi_cross_ref_id INTEGER ) CREATE TABLE Customer_Master_Index ( master_customer_id INTEGER, cmi_details VARCHAR(255) ) CREATE TABLE Benefits_Ove...
SELECT cmi_details, COUNT(cmi_details) FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax' GROUP BY cmi_details
nvbench
CREATE TABLE table_1341973_3 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the candidates in the election where the incumbent is George M. Grant?
SELECT candidates FROM table_1341973_3 WHERE incumbent = "George M. Grant"
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE table_name_6 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the tournament with carlos moy as the opponent?
SELECT date FROM table_name_6 WHERE opponent = "carlos moyà"
sql_create_context
CREATE TABLE table_203_525 ( id number, "car" text, "engine" text, "compression" text, "power" text, "torque" text, "turbo" text, "stock boost" text, "turbine" text, "compressor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how...
SELECT COUNT(*) FROM table_203_525 WHERE "engine" = 'redtop'
squall
CREATE TABLE table_name_84 ( pick__number VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the Position is Running Back what is the Total number of Pick #?
SELECT COUNT(pick__number) FROM table_name_84 WHERE position = "running back"
sql_create_context
CREATE TABLE table_22815568_12 ( unemployment_rate VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the unemployment rate for botetourt
SELECT unemployment_rate FROM table_22815568_12 WHERE county = "Botetourt"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Posts ( Id number, PostTypeId number, Accepted...
SELECT SUM(CASE WHEN UserId = -1 THEN 1 ELSE 0 END) AS "community_closed", SUM(CASE WHEN UserId = -1 THEN 0 ELSE 1 END) AS "mod_or_dupehammer_closed", COUNT(Id) AS "total" FROM PostHistory WHERE PostHistoryTypeId = 10 AND CreationDate >= '2014-01-01'
sede
CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Docume...
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY Document_Type_Code DESC
nvbench
CREATE TABLE table_43014 ( "Game" real, "Date" text, "Team" text, "Score" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location Attendance with a Record that is 1-4?
SELECT "Location Attendance" FROM table_43014 WHERE "Record" = '1-4'
wikisql
CREATE TABLE table_56125 ( "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 date did Essendon play as the home team?
SELECT "Date" FROM table_56125 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE table_956 ( "Season" text, "Regionalliga S\u00fcd" text, "Regionalliga West/S\u00fcdwest" text, "Regionalliga Nord" text, "Regionalliga Nord-Ost" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the regionalliga nord with regionall...
SELECT "Regionalliga Nord" FROM table_956 WHERE "Regionalliga S\u00fcd" = '1. FC Nuremberg SpVgg Greuther Fürth'
wikisql
CREATE TABLE table_22003 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of weeks for october 26
SELECT COUNT("Week") FROM table_22003 WHERE "Date" = 'October 26'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime tim...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'other myectomy') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-5 year')
mimic_iii
CREATE TABLE table_13237088_28 ( no_yds VARCHAR, ast VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all number of yards with an AST of 8.
SELECT no_yds FROM table_13237088_28 WHERE ast = 8
sql_create_context
CREATE TABLE table_name_60 ( school_club_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which school was Chris Robinson from?
SELECT school_club_team FROM table_name_60 WHERE player = "chris robinson"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL))
eicu
CREATE TABLE Department ( DNO INTEGER, Division VARCHAR(2), DName VARCHAR(25), Room VARCHAR(5), Building VARCHAR(13), DPhone INTEGER ) CREATE TABLE Gradeconversion ( lettergrade VARCHAR(2), gradepoint FLOAT ) CREATE TABLE Minor_in ( StuID INTEGER, DNO INTEGER ) CREATE TABLE Fa...
SELECT T1.CName, COUNT(T1.CName) FROM Course AS T1 JOIN Enrolled_in AS T2 ON T1.CID = T2.CID GROUP BY T1.CName, T2.CID HAVING COUNT(*) >= 5 ORDER BY T1.CName DESC
nvbench
CREATE TABLE table_name_95 ( top_10 INTEGER, cuts_made VARCHAR, top_5 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Top-10 has a Cuts made of 10, and a Top-5 larger than 1?
SELECT MIN(top_10) FROM table_name_95 WHERE cuts_made = 10 AND top_5 > 1
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '姜璇子' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '阿立哌唑口腔崩解片')
css
CREATE TABLE table_16729063_2 ( date VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games were played at Cleveland Stadium?
SELECT COUNT(date) FROM table_16729063_2 WHERE game_site = "Cleveland Stadium"
sql_create_context
CREATE TABLE table_26800 ( "School" text, "Mascot" text, "Location" text, "Founded" real, "Entered ISL" real, "Grades" text, "Number of Students" text, "Varsity Teams" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many varsity teams...
SELECT MAX("Varsity Teams") FROM table_26800 WHERE "Location" = 'West Roxbury, MA'
wikisql
CREATE TABLE table_24427210_1 ( payout___us VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of payout for december 28, 2009
SELECT COUNT(payout___us) AS $__ FROM table_24427210_1 WHERE date = "December 28, 2009"
sql_create_context
CREATE TABLE table_name_82 ( money___ INTEGER, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average money when the score was 74-72-75-71=292?
SELECT AVG(money___) AS $__ FROM table_name_82 WHERE score = 74 - 72 - 75 - 71 = 292
sql_create_context
CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE department ( dept_name text, building text, budget number ) CREATE TABLE instructor ( id text, name text, dept_name text, salary number ) CREATE TABLE time_slot ( ...
SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department)
spider
CREATE TABLE table_204_616 ( id number, "township" text, "fips" number, "population\ncenter" text, "population" number, "population\ndensity\n/km2 (/sq mi)" text, "land area\nkm2 (sq mi)" text, "water area\nkm2 (sq mi)" text, "water %" text, "geographic coordinates" text ) -- U...
SELECT "township" FROM table_204_616 ORDER BY "land area\nkm2 (sq mi)" LIMIT 1
squall
CREATE TABLE table_25919 ( "Episode" text, "First broadcast" text, "Seans team" text, "Jasons team" text, "Scores" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of scores for 5x06
SELECT COUNT("Scores") FROM table_25919 WHERE "Episode" = '5x06'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) 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...
SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT 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 = '09954947689')
css
CREATE TABLE table_2066296_5 ( totals VARCHAR, interior_roof VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different total results are there for the model with parchment/black interior/roof?
SELECT COUNT(totals) FROM table_2066296_5 WHERE interior_roof = "Parchment/black"
sql_create_context
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases IN...
SELECT Year, COUNT(Year) FROM wine WHERE Price > 100 GROUP BY Year ORDER BY Year
nvbench
CREATE TABLE table_204_494 ( id number, "episode #" text, "original air date (uk)" text, "episode title" text, "guest cast" text, "dvd # 1" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total of guest for the month of january
SELECT SUM("guest cast") FROM table_204_494 WHERE "original air date (uk)" = 1
squall
CREATE TABLE table_name_81 ( loss VARCHAR, name VARCHAR, long VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses have jake sharp as the name, with a long less than 30?
SELECT COUNT(loss) FROM table_name_81 WHERE name = "jake sharp" AND long < 30
sql_create_context
CREATE TABLE table_name_75 ( date VARCHAR, against VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is date when against is smaller than 6 and location was durban?
SELECT date FROM table_name_75 WHERE against < 6 AND venue = "durban"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, C...
SELECT TIME_TO_STR(Posts.CreationDate, '%Y') * 100 + TIME_TO_STR(Posts.CreationDate, '%m') AS YYYYMM, COUNT(0) AS CT FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId WHERE Posts.CreationDate > '2015-01-01' AND Tags.TagName = 'algorithms' GROUP BY TIME_TO_STR...
sede
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC
nvbench
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE fare_basis ( fare_basis_cod...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c...
atis
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C...
atis
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, h...
SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ileostomy status') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12572) AND DATETIME(diagn...
mimic_iii
CREATE TABLE table_name_39 ( games VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of games for Roger Merrett?
SELECT games FROM table_name_39 WHERE player = "roger merrett"
sql_create_context
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "43" AND diagnoses.icd9_code = "E8786"
mimicsql_data
CREATE TABLE table_27514362_7 ( status VARCHAR, entrant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many status figures does James Finch have?
SELECT COUNT(status) FROM table_27514362_7 WHERE entrant = "James Finch"
sql_create_context
CREATE TABLE table_1745843_10 ( class VARCHAR, part_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What class is the verb wich its part 3 is heldu
SELECT class FROM table_1745843_10 WHERE part_3 = "heldu"
sql_create_context
CREATE TABLE table_name_88 ( grid INTEGER, rider VARCHAR, laps VARCHAR, bike VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Grid has Laps smaller than 22, and a Bike of honda cbr1000rr, and a Rider of luca morelli?
SELECT MIN(grid) FROM table_name_88 WHERE laps < 22 AND bike = "honda cbr1000rr" AND rider = "luca morelli"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '002-34744') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica...
eicu
CREATE TABLE Apartments ( apt_number VARCHAR, apt_id VARCHAR ) CREATE TABLE Apartment_Bookings ( apt_id VARCHAR, booking_status_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the distinct apartment numbers of the apartments that have booki...
SELECT DISTINCT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Confirmed"
sql_create_context
CREATE TABLE table_204_946 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who ran the least number of l...
SELECT "driver" FROM table_204_946 ORDER BY "laps" LIMIT 1
squall
CREATE TABLE table_name_54 ( round INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest round associated with Samuel Scheschuk?
SELECT MIN(round) FROM table_name_54 WHERE name = "samuel scheschuk"
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.icd9_code = "74602" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE table_name_6 ( state VARCHAR, member VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is State, when Member is 'Gil Duthie'?
SELECT state FROM table_name_6 WHERE member = "gil duthie"
sql_create_context
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 intakeoutput ( i...
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-161415' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS N...
eicu
CREATE TABLE table_13789248_2 ( artist VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the the artbeingt with position being 32
SELECT artist FROM table_13789248_2 WHERE position = 32
sql_create_context
CREATE TABLE table_name_80 ( category VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the category that sheridan smith was nominated for in 2011?
SELECT category FROM table_name_80 WHERE year = 2011
sql_create_context
CREATE TABLE table_25716399_1 ( no_in_season INTEGER, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what season was written by jonathan collier?
SELECT MAX(no_in_season) FROM table_25716399_1 WHERE written_by = "Jonathan Collier"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzj...
css
CREATE TABLE technician ( technician_id number, name text, team text, starting_year number, age number ) CREATE TABLE repair ( repair_id number, name text, launch_date text, notes text ) CREATE TABLE machine ( machine_id number, making_year number, class text, team ...
SELECT COUNT(*) FROM technician
spider
CREATE TABLE constructorResults ( constructorResultsId INTEGER, raceId INTEGER, constructorId INTEGER, points REAL, status TEXT ) CREATE TABLE drivers ( driverId INTEGER, driverRef TEXT, number TEXT, code TEXT, forename TEXT, surname TEXT, dob TEXT, nationality TEXT,...
SELECT name, COUNT(name) FROM races WHERE year BETWEEN 2009 AND 2011 GROUP BY name ORDER BY name
nvbench
CREATE TABLE table_15862 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which school did the player that played 2004-05 attend?
SELECT "School/Club Team" FROM table_15862 WHERE "Years in Toronto" = '2004-05'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILAD...
atis
CREATE TABLE table_42762 ( "Element" text, "Nuclide" text, "Z ( p )" real, "N ( n )" real, "isotopic mass ( u )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Z (p) when the N (n) is less than 30, and scandium is the element?
SELECT AVG("Z ( p )") FROM table_42762 WHERE "N ( n )" < '30' AND "Element" = 'scandium'
wikisql
CREATE TABLE table_name_59 ( college_junior_club_team VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college or team has a pick of 196?
SELECT college_junior_club_team FROM table_name_59 WHERE pick = "196"
sql_create_context
CREATE TABLE table_17671 ( "Year" text, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the regular season listing in 2007?
SELECT "Regular Season" FROM table_17671 WHERE "Year" = '2007'
wikisql
CREATE TABLE products ( product_id number, product_details text ) CREATE TABLE customer_contact_channels ( customer_id number, channel_code text, active_from_date time, active_to_date time, contact_number text ) CREATE TABLE order_items ( order_id number, product_id number, ord...
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orde...
spider
CREATE TABLE table_2102898_1 ( viewers__in_millions_ VARCHAR, broadcast_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On broadcast date is 21march1970, how many people tuned in?
SELECT COUNT(viewers__in_millions_) FROM table_2102898_1 WHERE broadcast_date = "21March1970"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count ...
SELECT * FROM Tags WHERE LENGTH(Text) > 4 ORDER BY Count
sede
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( paperid int, title...
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'Chris Mattmann' AND writes.authorid = author.authorid
scholar
CREATE TABLE table_69641 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sum To par for score of 71-74-71-72=288
SELECT SUM("To par") FROM table_69641 WHERE "Score" = '71-74-71-72=288'
wikisql
CREATE TABLE table_17459 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which players have the position of centre and play for the n...
SELECT "Player" FROM table_17459 WHERE "Position" = 'Centre' AND "NHL team" = 'New York Rangers'
wikisql
CREATE TABLE table_name_29 ( status VARCHAR, co_contestant__yaar_vs_pyaar_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Status has a Co-contestant (Yaar vs. Pyaar) of tina parekh?
SELECT status FROM table_name_29 WHERE co_contestant__yaar_vs_pyaar_ = "tina parekh"
sql_create_context
CREATE TABLE table_8422 ( "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 tie number that has Portsmouth Home team
SELECT "Tie no" FROM table_8422 WHERE "Home team" = 'portsmouth'
wikisql
CREATE TABLE table_42769 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Home Captain, when Date is 23,24,26,27,28,29 Feb, 1 Mar 1912?
SELECT "Home captain" FROM table_42769 WHERE "Date" = '23,24,26,27,28,29 feb, 1 mar 1912'
wikisql
CREATE TABLE table_7043 ( "Year" real, "Band" text, "Song" text, "Album" text, "Contribution" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the album Board Up the House, what is the contribution?
SELECT "Contribution" FROM table_7043 WHERE "Album" = 'board up the house'
wikisql
CREATE TABLE table_13807 ( "Year" text, "Game" text, "Genre" text, "Platform(s)" text, "Developer(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year has a genre the platform game?
SELECT "Year" FROM table_13807 WHERE "Genre" = 'platform game'
wikisql
CREATE TABLE table_28527 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text, "Left" text, "Nickname" text, "Primary Conference when joining the MSFA" text, "Current Primary Conference" text ) -- Using valid SQLite, answer the fo...
SELECT COUNT("Location") FROM table_28527 WHERE "Nickname" = 'Panthers'
wikisql
CREATE TABLE table_29372 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT COUNT("Original air date") FROM table_29372 WHERE "Production code" = '12003'
wikisql
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, A...
SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor ORDER BY Governor
nvbench
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) 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...
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jybgb.JYSQJGMC, jybgb.JYJGMC FROM jybgb WHERE jybgb.BGDH = '01566167620'
css
CREATE TABLE table_name_29 ( opponent VARCHAR, week VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent after week 9 at rich stadium?
SELECT opponent FROM table_name_29 WHERE week > 9 AND game_site = "rich stadium"
sql_create_context
CREATE TABLE table_20433 ( "Episode Number" real, "Air Date" text, "Guest Host" text, "Musical Guest (Song performed)" text, "Who knows the most about the guest host? panelists" text, "Coat Of Cash Wearing Celebrity" text ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT "Who knows the most about the guest host? panelists" FROM table_20433 WHERE "Guest Host" = 'David Tennant'
wikisql
CREATE TABLE table_name_46 ( date INTEGER, surface VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest Date David Adams played on a Clay Surface with Brett Steven as Partner?
SELECT MIN(date) FROM table_name_46 WHERE surface = "clay" AND partner = "brett steven"
sql_create_context
CREATE TABLE table_name_39 ( earnings__ INTEGER, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the earnings for rank 3?
SELECT SUM(earnings__) AS $__ FROM table_name_39 WHERE rank = 3
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE area ( course_id int, area varchar ) ...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) ...
advising