instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, ...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND ground_...
atis
CREATE TABLE table_44592 ( "Season" text, "Series" text, "Team Name" text, "Races" real, "Poles" real, "Wins" real, "Points" real, "Final Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the lowest Races that has t...
SELECT MIN("Races") FROM table_44592 WHERE "Team Name" = 'piquet gp' AND "Points" > '24'
wikisql
CREATE TABLE table_23292220_4 ( daves_team VARCHAR, first_broadcast VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many daves team entries are there on 27 october 2006?
SELECT COUNT(daves_team) FROM table_23292220_4 WHERE first_broadcast = "27 October 2006"
sql_create_context
CREATE TABLE table_name_6 ( country VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has a loan as the type?
SELECT country FROM table_name_6 WHERE type = "loan"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE DEPARTMENT_ID = (SELECT DEPARTMENT_ID FROM employees WHERE FIRST_NAME = "Clara") AND FIRST_NAME <> "Clara"
nvbench
CREATE TABLE table_69465 ( "Ranking" real, "Nationality" text, "Name" text, "Years" text, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of ranking when the nationalits is England with more than 53 goals?
SELECT SUM("Ranking") FROM table_69465 WHERE "Nationality" = 'england' AND "Goals" > '53'
wikisql
CREATE TABLE table_74624 ( "Year" real, "Player" text, "Nation of citizenship" text, "Team represented" text, "Position primarily played" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of all the years that Landon Donovan won the ESP...
SELECT COUNT("Year") FROM table_74624 WHERE "Player" = 'landon donovan'
wikisql
CREATE TABLE WINE ( Name VARCHAR, Appelation VARCHAR, price VARCHAR ) CREATE TABLE APPELLATIONS ( Appelation VARCHAR, County VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the wines that have prices lower than 50 and have appelations in...
SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.price < 50
sql_create_context
CREATE TABLE table_54052 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue features an away side score of 11.11 ...
SELECT "Venue" FROM table_54052 WHERE "Away team score" = '11.11 (77)'
wikisql
CREATE TABLE table_67894 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What average Total has a Gold award of 13 and a Bronze award less than 13?
SELECT AVG("Total") FROM table_67894 WHERE "Gold" = '13' AND "Bronze" < '13'
wikisql
CREATE TABLE Catalogs ( catalog_id INTEGER, catalog_name VARCHAR(50), catalog_publisher VARCHAR(80), date_of_publication DATETIME, date_of_latest_revision DATETIME ) CREATE TABLE Attribute_Definitions ( attribute_id INTEGER, attribute_name VARCHAR(30), attribute_data_type VARCHAR(10) ) ...
SELECT date_of_publication, COUNT(date_of_publication) FROM Catalogs AS t1 JOIN Catalog_Structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5 ORDER BY COUNT(date_of_publication) DESC
nvbench
CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ) CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ) CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ...
SELECT Party, COUNT(*) FROM people GROUP BY Party
nvbench
CREATE TABLE table_29538 ( "Members" text, "Country" text, "Year Established" real, "World Rank by THE-WUR , 2013" text, "World Rank by ARWU , 2013" text, "World Rank by QS , 2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the worl...
SELECT "World Rank by ARWU , 2013" FROM table_29538 WHERE "Members" = 'University of Tübingen'
wikisql
CREATE TABLE table_name_84 ( date VARCHAR, against VARCHAR, opposing_teams VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date has fewer than 32 against and the opposing team of Australia?
SELECT date FROM table_name_84 WHERE against < 32 AND opposing_teams = "australia"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, ...
SELECT * FROM Posts WHERE Body LIKE '%sinatra%' AND Body LIKE '%get%' AND Body LIKE '%parameters%'
sede
CREATE TABLE table_name_53 ( series VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Series are on september 15, 2007?
SELECT series FROM table_name_53 WHERE date = "september 15, 2007"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3523362' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING MIN(gwyjzb.IN_HOSP_DAYS) > 8 UNION SELECT fgwyjzb.MED_ORG_DEPT_CD FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3523362' GROUP BY fgwyjzb.MED_ORG_DEPT_CD HAVING MIN(fgwyjzb.IN_HO...
css
CREATE TABLE table_name_25 ( outcome VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome in 1975?
SELECT outcome FROM table_name_25 WHERE year = 1975
sql_create_context
CREATE TABLE party_host ( party_id number, host_id number, is_main_in_charge others ) CREATE TABLE party ( party_id number, party_theme text, location text, first_year text, last_year text, number_of_hosts number ) CREATE TABLE host ( host_id number, name text, national...
SELECT first_year, last_year FROM party WHERE party_theme = "Spring" OR party_theme = "Teqnology"
spider
CREATE TABLE table_10962 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the height for the center position from kans...
SELECT "Height in Ft." FROM table_10962 WHERE "Position" = 'center' AND "School/Club Team/Country" = 'kansas'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "(Aorto)coronary bypass of two coronary arteries" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_name_24 ( nation VARCHAR, gold VARCHAR, silver VARCHAR, total VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the total is larger than 1,and the bronze is less than 3, and silver larger than 2, and a gold la...
SELECT nation FROM table_name_24 WHERE total > 1 AND bronze < 3 AND silver > 2 AND gold > 2
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 Posts.Id AS "post_link", Posts.Score, v.BountyAmount, Posts.OwnerUserId AS "user_link" FROM Votes AS v INNER JOIN Posts ON v.PostId = Posts.Id WHERE v.VoteTypeId = 9 AND Posts.Score < 1 AND v.BountyAmount > 0 ORDER BY Posts.Score
sede
CREATE TABLE table_74543 ( "Class" text, "Date" text, "Race" text, "Driver" text, "Position" real, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what driver has a team of officine alfieri maserati and belongs to the class of non-champion...
SELECT "Driver" FROM table_74543 WHERE "Team" = 'officine alfieri maserati' AND "Class" = 'non-championship f2' AND "Position" = '2' AND "Date" = '9/1952'
wikisql
CREATE TABLE table_46043 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Nationality" text, "Club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Club team has a Pick larger than 139?
SELECT "Club team" FROM table_46043 WHERE "Pick" > '139'
wikisql
CREATE TABLE table_name_72 ( country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Country Scored 66-69=135?
SELECT country FROM table_name_72 WHERE score = 66 - 69 = 135
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CELO-VESSICLE FISTULA" AND demographic.age < "74"
mimicsql_data
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
WITH Editors AS (SELECT DISTINCT PostId, UserId, 1 AS ECount FROM PostHistory WHERE PostHistoryTypeId = 5), QuestionCount AS (SELECT COUNT(*) AS TotalQuestions FROM Posts WHERE PostTypeId = 1 AND ClosedDate IS NULL) SELECT ROW_NUMBER() OVER (ORDER BY SUM(ECount) DESC) AS "rank", Users.Id AS "user_link", Users.DisplayNa...
sede
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number,...
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 = 'dermatitis nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9833) AND DATETIME(diagnose...
mimic_iii
CREATE TABLE Faculty_participates_in ( FacID VARCHAR ) CREATE TABLE Faculty ( FacID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the ids of the faculty who don't participate in any activity.
SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar...
SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'MUSICOL' AND course.number = 478 AND program_course.category LIKE '%ULCS%'
advising
CREATE TABLE table_3943 ( "Finish" real, "Start" real, "Car" real, "Driver" text, "Make" text, "Sponsor" text, "Pts/bns" text, "Laps" real, "Status" text, "Winnings" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points ...
SELECT "Pts/bns" FROM table_3943 WHERE "Driver" = 'Kurt Busch'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'oxygen therapy (40% to 60%)' AND STRFTIME('%y', treatment.treatmenttime) >= '2103') AS t1 JOIN (SELECT patie...
eicu
CREATE TABLE table_11617 ( "Rank" real, "Movie" text, "Year" real, "Studio(s)" text, "Opening Weekend Net Gross" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the sum of Opening Weekend Net Gross at the Studio of UTV Motion Pictures?
SELECT SUM("Opening Weekend Net Gross") FROM table_11617 WHERE "Studio(s)" = 'utv motion pictures'
wikisql
CREATE TABLE parking_fines ( council_tax_id number, cmi_cross_ref_id number ) CREATE TABLE benefits_overpayments ( council_tax_id number, cmi_cross_ref_id number ) CREATE TABLE business_rates ( business_rates_id number, cmi_cross_ref_id number ) CREATE TABLE rent_arrears ( council_tax_id ...
SELECT T1.cmi_cross_ref_id, T1.source_system_code FROM cmi_cross_references AS T1 JOIN council_tax AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING COUNT(*) >= 1
spider
CREATE TABLE table_49272 ( "Name" text, "Type" text, "Themed area" text, "Manufacturer" text, "Opened" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the dreamworks experience from Ferrari?
SELECT "Name" FROM table_49272 WHERE "Themed area" = 'dreamworks experience' AND "Manufacturer" = 'ferrari'
wikisql
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_da...
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 = 'DETROIT...
atis
CREATE TABLE table_204_970 ( id number, "year" number, "award" text, "category" text, "title" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which did he win more , best foreign actor or best actor ?
SELECT "category" FROM table_204_970 WHERE "category" IN ('best foreign actor', 'best actor') GROUP BY "category" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_15637071_1 ( headquarters VARCHAR, icao VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the headquarters of the airline which has the ICAO code of AAU?
SELECT headquarters FROM table_15637071_1 WHERE icao = "AAU"
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
SELECT Country, COUNT(*) FROM stadium GROUP BY Country ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, ...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZ...
css
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT COUNT(Id) FROM Users WHERE LOWER(DisplayName) LIKE 'john%'
sede
CREATE TABLE table_13080 ( "Date (dd.mm.yyyy)" text, "Soviet Unit" text, "Aircraft flown" text, "Enemy Aircraft" text, "Axis Unit" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Soviet Unit when the Enemy Aircraft was bf.109g-2 'yellow ...
SELECT "Soviet Unit" FROM table_13080 WHERE "Enemy Aircraft" = 'bf.109g-2 "yellow 2'
wikisql
CREATE TABLE table_35612 ( "Rank" text, "Margin" text, "Opponent" text, "Venue" text, "Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue has 2 as the rank?
SELECT "Venue" FROM table_35612 WHERE "Rank" = '2'
wikisql
CREATE TABLE table_204_488 ( id number, "order in\nposition" number, "president of\nthe republic" text, "length of\nthe presidential\naction" text, "rank by\nlength\nof term(s)" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who ...
SELECT "president of\nthe republic" FROM table_204_488 WHERE "president of\nthe republic" IN ('mauno koivisto', 'martti ahtisaari') ORDER BY "rank by\nlength\nof term(s)" LIMIT 1
squall
CREATE TABLE table_360 ( "Rocket launch" text, "Launch Date" text, "Mission" text, "Institutional authority" text, "Launch Site" text, "Outcomes" text, "Derivatives" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which authority has a rocket...
SELECT "Institutional authority" FROM table_360 WHERE "Rocket launch" = 'Rehbar-II'
wikisql
CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE class ( class_code text, crs_code text, class_sec...
SELECT emp_fname, emp_lname FROM employee ORDER BY emp_dob LIMIT 1
spider
CREATE TABLE table_35420 ( "Name" text, "Innhabitants" real, "Area" real, "Mayor" text, "Party" text, "Municipal code" real, "Language form" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the area of ask y, with a Municipal code less ...
SELECT SUM("Area") FROM table_35420 WHERE "Name" = 'askøy' AND "Municipal code" < '1247'
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1846" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_16551 ( "Engine" text, "Power, continuous" text, "Critical altitude This is the highest altitude at which the engine can achieve its full continuous power rating. Above this altitude, power falls off with height as with a naturally aspirated engine . See Supercharger#Altitude effects for ...
SELECT "Compression ratio" FROM table_16551 WHERE "Critical altitude This is the highest altitude at which the engine can achieve its full continuous power rating. Above this altitude, power falls off with height as with a naturally aspirated engine . See Supercharger#Altitude effects for details." = 'sea level' AND "S...
wikisql
CREATE TABLE table_203_358 ( id number, "pos." number, "athlete" text, "run 1" number, "run 2" number, "total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the slowest athlete in run 2 ?
SELECT "athlete" FROM table_203_358 ORDER BY "run 2" DESC LIMIT 1
squall
CREATE TABLE table_40456 ( "Election" real, "First member" text, "First party" text, "Second member" text, "Second party" text, "Third member" text, "Third party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the third member of the ...
SELECT "Third member" FROM table_40456 WHERE "Second party" = 'liberal' AND "Third party" = 'conservative' AND "Second member" = 'humphrey mildmay'
wikisql
CREATE TABLE table_203_536 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "crowd" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the next game ...
SELECT "opponent" FROM table_203_536 WHERE id = (SELECT id FROM table_203_536 WHERE "date" = 'apr 19') + 1
squall
CREATE TABLE table_22825 ( "Team #1" text, "Agg. score" text, "Team #2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the 2nd leg result in the round where team #1 is Iraklis?
SELECT "2nd leg" FROM table_22825 WHERE "Team #1" = 'Iraklis'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE table_name_93 ( bronze VARCHAR, gold VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Bronze when gold is more than 1 and nation is total?
SELECT COUNT(bronze) FROM table_name_93 WHERE gold > 1 AND nation = "total"
sql_create_context
CREATE TABLE table_15038373_1 ( operating_systems VARCHAR, software VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all the operating systems for sbagen?
SELECT operating_systems FROM table_15038373_1 WHERE software = "SBaGen"
sql_create_context
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(5...
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings GROUP BY booking_end_date ORDER BY booking_end_date DESC
nvbench
CREATE TABLE Customer ( CustomerId integer, FirstName varchar(40), LastName varchar(20), Company varchar(80), Address varchar(70), City varchar(40), State varchar(40), Country varchar(40), PostalCode varchar(10), Phone varchar(24), Fax varchar(24), Email varchar(60), ...
SELECT InvoiceDate, COUNT(InvoiceDate) FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber"
nvbench
CREATE TABLE table_1360997_3 ( jockey VARCHAR, venue VARCHAR, weight__kg_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the jockey at Rosehill and the weight was 57.5 kg?
SELECT jockey FROM table_1360997_3 WHERE venue = "Rosehill" AND weight__kg_ = "57.5"
sql_create_context
CREATE TABLE Locations ( Location_ID INTEGER, Location_Name VARCHAR(255), Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Royal_Family ( Royal_Family_ID INTEGER, Royal_Family_Details VARCHAR(255) ) CREATE TABLE Photos ( Photo_ID INTEGER, Tourist_Attraction_ID INTEGER, ...
SELECT hotel_id, star_rating_code FROM Hotels ORDER BY price_range
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'transaminase el...
eicu
CREATE TABLE table_name_52 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team score for St Kilda?
SELECT home_team AS score FROM table_name_52 WHERE home_team = "st kilda"
sql_create_context
CREATE TABLE table_30329 ( "No. in series" 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. -- Who wrote episode number 19 in the series?
SELECT "Written by" FROM table_30329 WHERE "No. in series" = '19'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevent...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'mini-bal' AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-2 year'))
mimic_iii
CREATE TABLE table_name_78 ( venue VARCHAR, date VARCHAR, result VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the friendly competition that Andriy Yarmolenko won on 28 may 2012?
SELECT venue FROM table_name_78 WHERE result = "won" AND competition = "friendly" AND date = "28 may 2012"
sql_create_context
CREATE TABLE table_44482 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the surface on 26 May 1996?
SELECT "Surface" FROM table_44482 WHERE "Date" = '26 may 1996'
wikisql
CREATE TABLE table_24223834_3 ( no_in_series VARCHAR, us_viewers__in_millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What episode number in the series had 2.528 million u.s. viewers?
SELECT no_in_series FROM table_24223834_3 WHERE us_viewers__in_millions_ = "2.528"
sql_create_context
CREATE TABLE table_15895 ( "Name" text, "Canton" text, "Height (meters)" real, "Crest length (meters)" real, "Type" text, "Year of construction" real, "Name of the Lake" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the ...
SELECT "Name" FROM table_15895 WHERE "Crest length (meters)" = '375'
wikisql
CREATE TABLE table_51612 ( "Date" text, "Opponents" text, "Score" text, "Competition" text, "Match Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the GC competition when the opponents are 1. FC Nuremberg?
SELECT "Date" FROM table_51612 WHERE "Opponents" = '1. fc nuremberg' AND "Competition" = 'gc'
wikisql
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.short_title = "Contr abd arteriogrm NEC"
mimicsql_data
CREATE TABLE table_75045 ( "Outcome" text, "Event" text, "Year" text, "Venue" text, "Opponent in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Outcome when All England Open is the Opponent in the final?
SELECT "Outcome" FROM table_75045 WHERE "Opponent in the final" = 'all england open'
wikisql
CREATE TABLE table_30608 ( "Callsign" text, "City of license" text, "Virtual channel" text, "Digital channel" text, "Network" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What digital channel corresponds to virtual channel 5.2?
SELECT "Digital channel" FROM table_30608 WHERE "Virtual channel" = '5.2'
wikisql
CREATE TABLE table_name_6 ( founded INTEGER, affiliation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Founded which has a Affiliation of private/methodist?
SELECT MAX(founded) FROM table_name_6 WHERE affiliation = "private/methodist"
sql_create_context
CREATE TABLE market ( Market_ID int, Country text, Number_cities int ) CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID ...
SELECT Title, COUNT(Title) FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY Title DESC
nvbench
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 ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 ORDER BY course.department
advising
CREATE TABLE table_name_55 ( visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the visiting team on May 7?
SELECT visitor FROM table_name_55 WHERE date = "may 7"
sql_create_context
CREATE TABLE table_34864 ( "Year" text, "Title" text, "Role" text, "Producer" text, "Director" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Title has a Director of rowell santiago?
SELECT "Title" FROM table_34864 WHERE "Director" = 'rowell santiago'
wikisql
CREATE TABLE table_24546 ( "Year" real, "Horse" text, "Driver" text, "Trainer" text, "Country of owner" text, "Odds of winner" text, "Winning time (km rate)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many countries did Utah Bulwark'...
SELECT COUNT("Country of owner") FROM table_24546 WHERE "Horse" = 'Utah Bulwark'
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 diagnoses ( 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "61" AND lab.label = "Prostate Specific Antigen"
mimicsql_data
CREATE TABLE procedures_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 transfers ( row_id number, subject_id number, ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28447) AND icustays.outtime IS NULL
mimic_iii
CREATE TABLE MEMBER_OF ( FacID VARCHAR, DNO VARCHAR ) CREATE TABLE FACULTY ( Fname VARCHAR, Lname VARCHAR, FacID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the full names of faculties who are members of department with department number...
SELECT T1.Fname, T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID = T2.FacID WHERE T2.DNO = 520
sql_create_context
CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, OnScholarship VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ...
SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY SportName
nvbench
CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE instructor ( ID var...
SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name
nvbench
CREATE TABLE table_62914 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Attendance of the game on November 6, 1966?
SELECT "Attendance" FROM table_62914 WHERE "Date" = 'november 6, 1966'
wikisql
CREATE TABLE table_35916 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the bronze medal when the Asian Games were held in Busan?
SELECT "Bronze" FROM table_35916 WHERE "Location" = 'busan'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(School_ID) DESC
nvbench
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE restrict...
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 = 'WASHING...
atis
CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, ...
SELECT Name, Total_Passengers FROM station WHERE Location <> 'London'
nvbench
CREATE TABLE table_24850630_4 ( group VARCHAR, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the group in the British Champion Stakes?
SELECT group FROM table_24850630_4 WHERE race = "British Champion Stakes"
sql_create_context
CREATE TABLE table_12657 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the frequency where the power is 25kw?
SELECT "Frequency" FROM table_12657 WHERE "Power (kW)" = '25kw'
wikisql
CREATE TABLE table_77423 ( "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. -- What is the average To Par, when Score is '72-67-71-72=282'?
SELECT AVG("To par") FROM table_77423 WHERE "Score" = '72-67-71-72=282'
wikisql
CREATE TABLE table_name_91 ( socket VARCHAR, frequency VARCHAR, release_price___usd__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Frequency of 1.2 ghz, and a Release price ( USD ) of $70 is what socket?
SELECT socket FROM table_name_91 WHERE frequency = "1.2 ghz" AND release_price___usd__ = "$70"
sql_create_context
CREATE TABLE table_name_72 ( outcome VARCHAR, partner VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome on 11 October 2009, when his partner was Jordan Kerr?
SELECT outcome FROM table_name_72 WHERE partner = "jordan kerr" AND date = "11 october 2009"
sql_create_context
CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE stock ( Shop_ID int, Device_ID int, Quantity int ) CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Dat...
SELECT Carrier, COUNT(Carrier) FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID GROUP BY Carrier ORDER BY COUNT(Carrier) DESC
nvbench
CREATE TABLE table_34517 ( "Year" real, "Champion" text, "Country" text, "Venue" text, "Location" text, "Score" text, "To par" text, "Purse ( $ )" real, "Winner's share ($)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Champi...
SELECT "Champion" FROM table_34517 WHERE "Venue" = 'old waverly golf club'
wikisql
CREATE TABLE table_name_89 ( bronze VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nation had 135 Bronze medals?
SELECT COUNT(bronze) FROM table_name_89 WHERE total = 135
sql_create_context
CREATE TABLE Engineer_Visits ( engineer_visit_id INTEGER, contact_staff_id INTEGER, engineer_id INTEGER, fault_log_entry_id INTEGER, fault_status VARCHAR(10), visit_start_datetime DATETIME, visit_end_datetime DATETIME, other_visit_details VARCHAR(255) ) CREATE TABLE Asset_Parts ( as...
SELECT skill_description, COUNT(skill_description) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description ORDER BY skill_description
nvbench
CREATE TABLE table_19663 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of years for womens doubles being dian...
SELECT COUNT("Year") FROM table_19663 WHERE "Womens doubles" = 'Diana Koleva Emilia Dimitrova' AND "Mens singles" = 'Jeliazko Valkov'
wikisql
CREATE TABLE table_38349 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week had a Result of w 10-0, and an Attendance smaller than 58,571?
SELECT COUNT("Week") FROM table_38349 WHERE "Result" = 'w 10-0' AND "Attendance" < '58,571'
wikisql