instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_16381914_1 ( affiliation VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of school is Canton, New York?
SELECT affiliation FROM table_16381914_1 WHERE location = "Canton, New York"
sql_create_context
CREATE TABLE table_25551880_2 ( winner VARCHAR, mountains_classification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many winners were there when the mountains classification was not awarded?
SELECT COUNT(winner) FROM table_25551880_2 WHERE mountains_classification = "not awarded"
sql_create_context
CREATE TABLE table_203_674 ( id number, "name" text, "mark" text, "system" text, "from" number, "to" number, "successor" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what now defunct railroad existed for the shortest time...
SELECT "name" FROM table_203_674 ORDER BY "to" - "from" LIMIT 1
squall
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar...
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AN...
advising
CREATE TABLE table_13646 ( "Year" real, "Song" text, "Artist" text, "Place" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years have claudia beni as the artist?
SELECT SUM("Year") FROM table_13646 WHERE "Artist" = 'claudia beni'
wikisql
CREATE TABLE table_203_603 ( id number, "service" text, "service id" text, "bit rate" text, "audio channels" text, "description" text, "analogue availability" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name the only indie/alternative/roc...
SELECT "service" FROM table_203_603 WHERE "description" = 'indie / alternative / rock music'
squall
CREATE TABLE table_41874 ( "First District" text, "Second District" text, "Third District" text, "Fourth District" text, "Fifth District" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the First District with a Fifth District of prudy adam?
SELECT "First District" FROM table_41874 WHERE "Fifth District" = 'prudy adam'
wikisql
CREATE TABLE table_52193 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the high grid that has a Time/Retired of +6 laps, and under 69 laps?
SELECT MAX("Grid") FROM table_52193 WHERE "Time/Retired" = '+6 laps' AND "Laps" < '69'
wikisql
CREATE TABLE table_name_71 ( serial_no VARCHAR, engine_no VARCHAR, colour VARCHAR, pilot_car_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the serial number of the pilot car that is black, has a pilot car number larger than 2, and an engi...
SELECT serial_no FROM table_name_71 WHERE colour = "black" AND pilot_car_no > 2 AND engine_no = 1008
sql_create_context
CREATE TABLE table_13808 ( "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 genre has the game god of war?
SELECT "Genre" FROM table_13808 WHERE "Game" = 'god of war'
wikisql
CREATE TABLE table_25730123_2 ( player VARCHAR, extra_points VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the player/s when there were 20 points with less than 1.0 extra point .
SELECT player FROM table_25730123_2 WHERE extra_points < 1.0 AND points = 20
sql_create_context
CREATE TABLE table_name_49 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent in the September 20, 2010 match?
SELECT opponent FROM table_name_49 WHERE date = "september 20, 2010"
sql_create_context
CREATE TABLE table_44928 ( "Season" text, "Club" text, "Country" text, "Apps." real, "Goals" real, "Assists" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the assists when the club is chicago fire and goals is more than 2?
SELECT SUM("Assists") FROM table_44928 WHERE "Club" = 'chicago fire' AND "Goals" > '2'
wikisql
CREATE TABLE table_2508633_11 ( nfl_team VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the NFL Teams in College North Texas State?
SELECT nfl_team FROM table_2508633_11 WHERE college = "North Texas State"
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 demographic.admission_type, lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_4191 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes of the se...
SELECT COUNT("No. in season") FROM table_4191 WHERE "Title" = 'World''s Greatest Dick'
wikisql
CREATE TABLE table_50343 ( "Callsign" text, "Area served" text, "Band" text, "Freq currently" text, "Purpose" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Freq currently of the 4GG Callsign?
SELECT "Freq currently" FROM table_50343 WHERE "Callsign" = '4gg'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId ...
SELECT Title, Posts.Id AS "post_link" FROM Posts RIGHT JOIN (SELECT Posts.Id AS selid FROM Posts JOIN PostTags ON PostId = Posts.Id JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName = 'nginx' OR Tags.TagName = 'haproxy' GROUP BY Posts.Id HAVING COUNT(Posts.Id) > 1) AS tmp1 ON Posts.Id = tmp1.selid JOIN PostLinks...
sede
CREATE TABLE table_70758 ( "Class" text, "Type" text, "Names" text, "Quantity made" text, "Manufacturer" text, "Date made" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the locomotive with a Waterford class?
SELECT "Date made" FROM table_70758 WHERE "Class" = 'waterford'
wikisql
CREATE TABLE table_78211 ( "Date" text, "Competition" text, "Venue" text, "Result" text, "Score" text, "Tries" text, "Goals" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the tries on 14/6/97?
SELECT "Tries" FROM table_78211 WHERE "Date" = '14/6/97'
wikisql
CREATE TABLE table_14770 ( "Gersdorf" text, "Gershausen" text, "Heddersdorf" text, "Kemmerode" text, "Kirchheim" text, "Reckerode ****" text, "Reimboldsh." text, "Rotterterode" text, "Willingshain" text ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT "Rotterterode" FROM table_14770 WHERE "Reimboldsh." = '80'
wikisql
CREATE TABLE table_71732 ( "Hull No." real, "Year" real, "Project" text, "Length overall in meters (without bowsprit)" real, "Name" text, "Destination" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sum of hull number for italy and year...
SELECT SUM("Hull No.") FROM table_71732 WHERE "Destination" = 'italy' AND "Year" > '1999'
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 person_info.XM FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb 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 AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '8...
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_name_81 ( winning_score VARCHAR, margin_of_victory VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the winning score with a margin victory of 2 strokes?
SELECT winning_score FROM table_name_81 WHERE margin_of_victory = "2 strokes"
sql_create_context
CREATE TABLE table_70181 ( "Year" real, "Chassis" text, "Engine(s)" text, "Tyres" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tyres received 8 points?
SELECT "Tyres" FROM table_70181 WHERE "Points" = '8'
wikisql
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.drug = "Sertraline"
mimicsql_data
CREATE TABLE table_name_34 ( winners VARCHAR, runners_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner when the runner-up was Guangzhou Apollo?
SELECT winners FROM table_name_34 WHERE runners_up = "guangzhou apollo"
sql_create_context
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 Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_1745843_10 ( part_4 VARCHAR, verb_meaning VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many verbs mean to bear
SELECT COUNT(part_4) FROM table_1745843_10 WHERE verb_meaning = "to bear"
sql_create_context
CREATE TABLE table_48382 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the CFL Team which has a Player of chris evraire?
SELECT "CFL Team" FROM table_48382 WHERE "Player" = 'chris evraire'
wikisql
CREATE TABLE table_25800134_4 ( director VARCHAR, series__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many directors worked on #158?
SELECT COUNT(director) FROM table_25800134_4 WHERE series__number = 158
sql_create_context
CREATE TABLE table_19401346_1 ( no_in_season VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the season number of the episode originally aired on October 14, 2008?
SELECT no_in_season FROM table_19401346_1 WHERE original_air_date = "October 14, 2008"
sql_create_context
CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3),...
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY cust_name DESC
nvbench
CREATE TABLE table_8589 ( "Train No." text, "Train Name" text, "From" text, "Arrival" text, "Runs On" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What train arrives from Kazipet?
SELECT "Train Name" FROM table_8589 WHERE "From" = 'kazipet'
wikisql
CREATE TABLE Member_of ( FacID INTEGER, DNO INTEGER, Appt_Type VARCHAR(15) ) CREATE TABLE Minor_in ( StuID INTEGER, DNO INTEGER ) CREATE TABLE Department ( DNO INTEGER, Division VARCHAR(2), DName VARCHAR(25), Room VARCHAR(5), Building VARCHAR(13), DPhone INTEGER ) CREATE T...
SELECT CID, Credits FROM Course ORDER BY Credits
nvbench
CREATE TABLE table_name_77 ( year VARCHAR, venue VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of years that the event was foil team and took place in Los Angeles?
SELECT COUNT(year) FROM table_name_77 WHERE venue = "los angeles" AND event = "foil team"
sql_create_context
CREATE TABLE table_32948 ( "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. -- At what venue did the away team score 10.10 (70)...
SELECT "Venue" FROM table_32948 WHERE "Away team score" = '10.10 (70)'
wikisql
CREATE TABLE table_name_66 ( grid VARCHAR, time_retired VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the total number of Grid for Time/Retired of +2 Laps and Laps less than 70
SELECT COUNT(grid) FROM table_name_66 WHERE time_retired = "+2 laps" AND laps < 70
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3979463' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 18
css
CREATE TABLE table_71294 ( "Year" real, "Award Show" text, "Category" text, "Recipient(s)" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On which award show was Bad Girls nominated for Most Popular Drama in 2004?
SELECT "Award Show" FROM table_71294 WHERE "Year" = '2004' AND "Category" = 'most popular drama'
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.Y...
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_name_39 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record on February 19?
SELECT record FROM table_name_39 WHERE date = "february 19"
sql_create_context
CREATE TABLE table_21377473_7 ( stadium VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 3 - 1 hughes 64' is the score what is the stadium?
SELECT stadium FROM table_21377473_7 WHERE score = "3 - 1 Hughes 64'"
sql_create_context
CREATE TABLE table_name_92 ( round VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the round number for March 22?
SELECT round FROM table_name_92 WHERE date = "march 22"
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 prescriptions...
SELECT demographic.dob, demographic.religion FROM demographic WHERE demographic.subject_id = "14755"
mimicsql_data
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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 )...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'other gastrostomy') A...
mimic_iii
CREATE TABLE table_79261 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Nationality of the Swimmer in Lane 4 or larger with a Rank of 5 or more?
SELECT "Nationality" FROM table_79261 WHERE "Lane" > '4' AND "Rank" > '5'
wikisql
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id 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 text, ...
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 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 jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '05667360222' AND NOT jybgb.KSMC LIKE '%皮肤科%'
css
CREATE TABLE table_79289 ( "Opposing Team" text, "Against" real, "Date" text, "Venue" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the round for Villa Park?
SELECT "Round" FROM table_79289 WHERE "Venue" = 'villa park'
wikisql
CREATE TABLE table_name_71 ( games VARCHAR, marks VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the games with marks of 21
SELECT games FROM table_name_71 WHERE marks = "21"
sql_create_context
CREATE TABLE table_74073 ( "Player" text, "Team" text, "Matches" real, "Runs" real, "Average" text, "Strike rate" text, "Highest Score" text, "100s" real, "50s" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the average is 50.16, ...
SELECT "Player" FROM table_74073 WHERE "Average" = '50.16'
wikisql
CREATE TABLE table_50369 ( "Start Date/Time" text, "Duration" text, "End Time" text, "Spacecraft" text, "Crew" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What spacecraft had an EVA that ended at 17:28?
SELECT "Spacecraft" FROM table_50369 WHERE "End Time" = '17:28'
wikisql
CREATE TABLE table_31793 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average value of Bronze when silver is 0 and the total is less than 1?
SELECT AVG("Bronze") FROM table_31793 WHERE "Silver" = '0' AND "Total" < '1'
wikisql
CREATE TABLE table_71984 ( "Church name" text, "Location" text, "Rebuilt" text, "Date of demolition" real, "Subsuming parish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location that has a date of demolition of 1940 and has a church ...
SELECT "Location" FROM table_71984 WHERE "Date of demolition" = '1940' AND "Church name" = 'christ church greyfriars'
wikisql
CREATE TABLE table_9603 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average pick for Florida State?
SELECT AVG("Pick") FROM table_9603 WHERE "School/Club Team" = 'florida state'
wikisql
CREATE TABLE table_203_5 ( id number, "season" text, "competition" text, "round" text, "opponent" text, "home" text, "away" text, "aggregate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times did they make it to the first rou...
SELECT COUNT(*) FROM table_203_5 WHERE "round" = 'first round'
squall
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) C...
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLOTTE' AND date_day.day_number = 22 AND date_day.month_number = 6 AND...
atis
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, ...
SELECT COUNT(*) FROM Posts WHERE CreationDate >= DATEFROMPARTS(2013, 3, 1)
sede
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 paper.journalid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Temporal Data' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid GROUP BY paper.journalid
scholar
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 Ref_Transaction_Types ( transaction_type_code...
SELECT Investor_details, COUNT(Investor_details) FROM Investors GROUP BY Investor_details ORDER BY COUNT(Investor_details) DESC
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeou...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-35670' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE table_name_91 ( position_in_table VARCHAR, team VARCHAR, replaced_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position is team mons who was replaced by Christophe Dessy (caretaker)?
SELECT position_in_table FROM table_name_91 WHERE team = "mons" AND replaced_by = "christophe dessy (caretaker)"
sql_create_context
CREATE TABLE table_name_70 ( type VARCHAR, entered_service VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type entered service in 2000?
SELECT type FROM table_name_70 WHERE entered_service = "2000"
sql_create_context
CREATE TABLE table_train_30 ( "id" int, "serum_potassium" float, "hyperkalemia" bool, "renal_disease" bool, "cardiopulmonary_resuscitation" bool, "receiving_vasopressor" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT * FROM table_train_30 WHERE receiving_vasopressor = 1
criteria2sql
CREATE TABLE Tasks ( task_id INTEGER, project_id INTEGER, task_details VARCHAR(255), "eg Agree Objectives" VARCHAR(1) ) CREATE TABLE Organisations ( organisation_id INTEGER, organisation_type VARCHAR(10), organisation_details VARCHAR(255) ) CREATE TABLE Document_Types ( document_type_c...
SELECT date_from, COUNT(date_from) FROM Project_Staff
nvbench
CREATE TABLE table_30505 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Du...
SELECT "Tournament Winner" FROM table_30505 WHERE "Conference" = 'Mid-American Conference'
wikisql
CREATE TABLE table_12447 ( "Mininera DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of byes when wins are 8, and losses are larger than 10?
SELECT COUNT("Byes") FROM table_12447 WHERE "Wins" = '8' AND "Losses" > '10'
wikisql
CREATE TABLE table_78812 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the 2nd party of 2nd member william goodenough hayter when the 1st member is hedwor...
SELECT "2nd Party" FROM table_78812 WHERE "1st Member" = 'hedworth hylton jolliffe' AND "2nd Member" = 'william goodenough hayter'
wikisql
CREATE TABLE table_name_83 ( elevation__m_ INTEGER, peak VARCHAR, isolation__km_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest elevation for the peak daurm l, and an Isolation (km) larger than 4?
SELECT MAX(elevation__m_) FROM table_name_83 WHERE peak = "daurmål" AND isolation__km_ > 4
sql_create_context
CREATE TABLE table_name_8 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has january 15, 2005 as the date?
SELECT score FROM table_name_8 WHERE date = "january 15, 2005"
sql_create_context
CREATE TABLE table_54650 ( "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the director of the episode with production code ad1a26?
SELECT "Directed by" FROM table_54650 WHERE "Production code" = 'ad1a26'
wikisql
CREATE TABLE table_9493 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team picked a player(s) from South Carolina?
SELECT "CFL Team" FROM table_9493 WHERE "College" = 'south carolina'
wikisql
CREATE TABLE table_1569516_1 ( line VARCHAR, destination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When London Bridge is the destination, how many lines are there?
SELECT COUNT(line) FROM table_1569516_1 WHERE destination = "London Bridge"
sql_create_context
CREATE TABLE table_14342367_13 ( hometown VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is George W. Gregory from?
SELECT hometown FROM table_14342367_13 WHERE player = "George W. Gregory"
sql_create_context
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, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
(SELECT jyjgzbb.JYZBLSH 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 AND jybgb.YLJGDM =...
css
CREATE TABLE table_name_7 ( year INTEGER, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Metroid Prime Hunters 5 released?
SELECT SUM(year) FROM table_name_7 WHERE title = "metroid prime hunters 5"
sql_create_context
CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time ) CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE reviewer ( rid number, name text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT COUNT(*) FROM rating WHERE stars > 3
spider
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '15522613' AND t_kc22.STA_DATE BETWEEN '2007-12-20' AND '2016-09-01' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_43839 ( "Series" text, "Title" text, "Broadcasts (TV) 1" real, "Episodes (TV+extra) 2" text, "Directors" text, "Aired in Japan 3" text, "US Release Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total num...
SELECT COUNT("Broadcasts (TV) 1") FROM table_43839 WHERE "Aired in Japan 3" = '5 january 2003 to 30 march 2003'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
SELECT Id AS "post_link", AnswerCount AS "number_of_answers" FROM Posts WHERE PostTypeId = 1 ORDER BY AnswerCount DESC LIMIT 20
sede
CREATE TABLE table_39544 ( "Rank" real, "Place" text, "County" text, "Per Capita Income" text, "Median House- hold Income" text, "Median Family Income" text, "Population" real, "Number of Households" real ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT AVG("Number of Households") FROM table_39544 WHERE "Per Capita Income" = '$21,345'
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Hx traumatic fracture"
mimicsql_data
CREATE TABLE table_7617 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the attendance during the game against the philadelphia eagles after week 9?
SELECT SUM("Attendance") FROM table_7617 WHERE "Opponent" = 'philadelphia eagles' AND "Week" > '9'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-6959')) AND STRFTIME('%y-%m', allergy.allergytime) = '2105-12'
eicu
CREATE TABLE table_16132 ( "No." real, "#" real, "Title" text, "Director" text, "Writer" text, "US air date" text, "Storyteller" text, "Villains" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the villains in the episodes where M...
SELECT "Villains" FROM table_16132 WHERE "Storyteller" = 'Megan' AND "Director" = 'Lorette LeBlanc'
wikisql
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, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyj...
css
CREATE TABLE table_25466 ( "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. -- How ma...
SELECT MIN("Game") FROM table_25466 WHERE "Date" = 'April 30'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849')) AND intakeoutput.celllabel = 'chest t...
eicu
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE ...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Sociology of Latin America%' OR name LIKE '%Sociology of Latin America%') AND credits = 3
advising
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-2001')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.cel...
eicu
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.diagnosis, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Wilbur Braatz"
mimicsql_data
CREATE TABLE table_24350 ( "Type of Record" text, "Attendance" real, "Date/Year" text, "Stadium" text, "Result/Games" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the attendance in 2011 records
SELECT "Attendance" FROM table_24350 WHERE "Date/Year" = '2011'
wikisql
CREATE TABLE table_36570 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Record that has the Home of ny islanders?
SELECT "Record" FROM table_36570 WHERE "Home" = 'ny islanders'
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 microlab ( microl...
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-17122')) AND NOT vitalperiodic.respiration ...
eicu
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '袁文栋' AND t_kc22.STA_DATE BETWEEN '2004-09-29' AND '2021-10-04' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE customers ( customer_id number, customer_details text ) CREATE TABLE claims ( claim_id number, policy_id number, date_claim_made time, date_claim_settled time, amount_claimed number, amount_settled number ) CREATE TABLE customer_policies ( policy_id number, custome...
SELECT T1.claim_id, COUNT(*) FROM claims AS T1 JOIN settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id
spider
CREATE TABLE table_18618707_1 ( contestant VARCHAR, height VARCHAR, geographical_regions VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When el cibao is the geographical region and the height is 1.80 who is the contestant?
SELECT contestant FROM table_18618707_1 WHERE height = "1.80" AND geographical_regions = "El Cibao"
sql_create_context