instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_33674 ( "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 DID HAWTHORN SCORE AT ITS AWAY GAME?
SELECT "Away team score" FROM table_33674 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1011651' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-05-20' AND '2018-12-18' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 1777.85) AS T
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'beta blocker - metoprolol' AND DATETIME(treatment....
eicu
CREATE TABLE table_name_6 ( venue VARCHAR, runner_up__average_in_final_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the venue when the runner-up (average in final) is wayne jones (94.64)?
SELECT venue FROM table_name_6 WHERE runner_up__average_in_final_ = "wayne jones (94.64)"
sql_create_context
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(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(Team_ID) DESC
nvbench
CREATE TABLE table_33253 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Cuba's ICAO?
SELECT "ICAO" FROM table_33253 WHERE "Country" = 'cuba'
wikisql
CREATE TABLE table_204_737 ( id number, "year" number, "order" text, "quantity" number, "ger nos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the last year listed ?
SELECT "year" FROM table_204_737 ORDER BY id DESC LIMIT 1
squall
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_name_54 ( on_air_id VARCHAR, band VARCHAR, callsign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the On-air ID of FM broadcaster 4nsa?
SELECT on_air_id FROM table_name_54 WHERE band = "fm" AND callsign = "4nsa"
sql_create_context
CREATE TABLE table_name_84 ( goals_for INTEGER, goals_against VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest goals entry with drawn larger than 6 and goals against 85?
SELECT MAX(goals_for) FROM table_name_84 WHERE goals_against = 85 AND drawn > 6
sql_create_context
CREATE TABLE table_28741_1 ( area__km_2__ INTEGER, capital VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How few km 2 does the area with Nay Pyi Taw as capital cover?
SELECT MIN(area__km_2__) FROM table_28741_1 WHERE capital = "Nay Pyi Taw"
sql_create_context
CREATE TABLE table_name_9 ( pick INTEGER, round VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name of the highest Pick is also a Round greater than 5 and Player as Tom Ivey?
SELECT MAX(pick) FROM table_name_9 WHERE round > 5 AND player = "tom ivey"
sql_create_context
CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE lives_in ( stuid number, dormid number, room_numb...
SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name
spider
CREATE TABLE table_77390 ( "Rank" real, "Mountain Peak" text, "State" text, "Mountain Range" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the mountain peak when the location is 37.5775 n 105.4856 w?
SELECT "Mountain Peak" FROM table_77390 WHERE "Location" = '37.5775°n 105.4856°w'
wikisql
CREATE TABLE table_name_14 ( name VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Name has a Time of 01:17:01?
SELECT name FROM table_name_14 WHERE time = "01:17:01"
sql_create_context
CREATE TABLE table_name_52 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2009 for when 2007 is 3r and 2010 is q2
SELECT 2009 FROM table_name_52 WHERE 2007 = "3r" AND 2010 = "q2"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE time_inte...
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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare AS FARE_0, fare AS FARE_1, fare_basis, flight, flight_fare AS FLIGHT_FARE_0, flight_fare ...
atis
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.age, demographic.admission_type FROM demographic WHERE demographic.subject_id = "93033"
mimicsql_data
CREATE TABLE table_13113 ( "Elected" text, "Assembled" text, "Dissolved" text, "1st member" text, "2nd member" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Assembled has a 1st member of william boteler?
SELECT "Assembled" FROM table_13113 WHERE "1st member" = 'william boteler'
wikisql
CREATE TABLE table_7584 ( "1900s" real, "1920s" real, "1930s" real, "1940s" real, "1950s" real, "1960s" real, "1970s" real, "1980s" real, "1990s" real, "2000s to date" real, "Total to date" real ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT COUNT("1920s") FROM table_7584 WHERE "1960s" = '0' AND "2000s to date" < '4' AND "1930s" > '3'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'metoprolol tartrate' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-4 year')
mimic_iii
CREATE TABLE table_52867 ( "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. -- Where did the home team score 15.21 (111)?
SELECT "Venue" FROM table_52867 WHERE "Home team score" = '15.21 (111)'
wikisql
CREATE TABLE table_22757733_4 ( runner_up_a VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who ended runner-up to sankar adhi?
SELECT runner_up_a FROM table_22757733_4 WHERE winner = "Sankar Adhi"
sql_create_context
CREATE TABLE table_name_35 ( december INTEGER, game VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which December has a Game of 37 and Points smaller than 47?
SELECT AVG(december) FROM table_name_35 WHERE game = 37 AND points < 47
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '44574940' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2010-10-26' AND '2011-02-03' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_name_73 ( round VARCHAR, pick__number VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds had a pick number of more than 10 and Appalachian State as a college?
SELECT COUNT(round) FROM table_name_73 WHERE pick__number > 10 AND college = "appalachian state"
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
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 = 'ORLANDO' AND date_day.day_number = 27 AND date_day.month_number = 12 AND ...
atis
CREATE TABLE table_name_74 ( venue VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Away team is melbourne, what venue do they play at?
SELECT venue FROM table_name_74 WHERE away_team = "melbourne"
sql_create_context
CREATE TABLE table_name_37 ( term_end VARCHAR, party VARCHAR, minister VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the term end of Shlomo-Yisrael Ben-Meir of the National Religious Party?
SELECT term_end FROM table_name_37 WHERE party = "national religious party" AND minister = "shlomo-yisrael ben-meir"
sql_create_context
CREATE TABLE table_12886178_4 ( points VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points does Croesyceiliog RFC have?
SELECT points FROM table_12886178_4 WHERE club = "Croesyceiliog RFC"
sql_create_context
CREATE TABLE table_name_62 ( grid INTEGER, rider VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Grid for the Rider Toni Elias with Laps more than 30?
SELECT AVG(grid) FROM table_name_62 WHERE rider = "toni elias" AND laps > 30
sql_create_context
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Ad...
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age)
nvbench
CREATE TABLE furniture ( furniture_id number, name text, num_of_component number, market_rate number ) CREATE TABLE manufacturer ( manufacturer_id number, open_year number, name text, num_of_factories number, num_of_shops number ) CREATE TABLE furniture_manufacte ( manufacturer...
SELECT t1.manufacturer_id, t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id ORDER BY t2.price_in_dollar DESC LIMIT 1
spider
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufac...
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TI...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%human...
advising
CREATE TABLE table_71185 ( "Model" text, "Launch year" real, "RAM ( MiB )" real, "ROM ( MiB )" real, "Slots" text, "WiFi" text, "Bluetooth" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the RAM (MiB) value for the X30 Mid-Range mode...
SELECT "RAM ( MiB )" FROM table_71185 WHERE "Model" = 'x30 mid-range'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT MIN(VoteTypes.Name) AS "Vote Type", Votes.VoteTypeId, COUNT(*) AS N FROM Votes LEFT JOIN VoteTypes ON Votes.VoteTypeId = VoteTypes.Id GROUP BY Votes.VoteTypeId ORDER BY Votes.VoteTypeId
sede
CREATE TABLE table_79186 ( "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. -- For which tie was Scunthorpe United the away team?
SELECT "Tie no" FROM table_79186 WHERE "Away team" = 'scunthorpe united'
wikisql
CREATE TABLE table_30909 ( "Round" real, "Date" text, "Opponent" text, "Home/Away" text, "Score (Collingwoods score is in bold)" text, "Result (includes margin)" text, "Venue" text, "Position on Ladder" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "Score (Collingwoods score is in bold)" FROM table_30909 WHERE "Date" = 'Saturday, 26 June 7:10pm'
wikisql
CREATE TABLE table_26992 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the l...
SELECT MIN("Wins") FROM table_26992 WHERE "Poles" = '10'
wikisql
CREATE TABLE table_68443 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Qual with less than 68 laps?
SELECT "Qual" FROM table_68443 WHERE "Laps" < '68'
wikisql
CREATE TABLE table_56116 ( "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 time/retired for ronnie peterson with under 75 laps and a grid under 15?
SELECT "Time/Retired" FROM table_56116 WHERE "Laps" < '75' AND "Grid" < '15' AND "Driver" = 'ronnie peterson'
wikisql
CREATE TABLE table_20669355_2 ( height__ft_ VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How tall is the contestant from Aruba?
SELECT height__ft_ FROM table_20669355_2 WHERE country = "Aruba"
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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admission_type = "ELECTIVE"
mimicsql_data
CREATE TABLE table_56667 ( "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. -- Where is the home venue of carlton that had a cr...
SELECT "Venue" FROM table_56667 WHERE "Crowd" > '12,000' AND "Home team" = 'carlton'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%INDIA%' AND Reputation >= 5000 ORDER BY Reputation DESC
sede
CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starting_year int ) CREATE TABLE club ( Club_ID int, Club_name text, Region text, Start_year int ) CREATE TABLE player ( Player_ID int, Sponsor_name text, Player_name text, Gender text, Residence text, Occupat...
SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY COUNT(Gender) DESC
nvbench
CREATE TABLE table_13671 ( "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 tournament when the score is 2-6, 4-6?
SELECT "Tournament" FROM table_13671 WHERE "Score" = '2-6, 4-6'
wikisql
CREATE TABLE table_182499_1 ( porphyria VARCHAR, substrate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many porphyria have substrate -aminolevulinic acid
SELECT COUNT(porphyria) FROM table_182499_1 WHERE substrate = "δ-Aminolevulinic acid"
sql_create_context
CREATE TABLE table_61574 ( "Name" text, "Type" text, "R.A. ( J2000 )" text, "Dec. ( J2000 )" text, "Redshift (km/ s )" text, "Apparent Magnitude" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which R.A. (J2000) has a Name of ngc 1543?
SELECT "R.A. ( J2000 )" FROM table_61574 WHERE "Name" = 'ngc 1543'
wikisql
CREATE TABLE table_1140119_5 ( date VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the Silverstone circuit driven?
SELECT date FROM table_1140119_5 WHERE circuit = "Silverstone"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype tex...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
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, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '王向卉' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2021-05-03' UNI...
css
CREATE TABLE table_17903 ( "Unit" text, "Type" text, "Net power" text, "Total power" text, "Construction start" text, "Construction finish" text, "Commercial operation" text, "Shut down" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Whe...
SELECT "Construction start" FROM table_17903 WHERE "Commercial operation" = '04.03.1987'
wikisql
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 prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "83678"
mimicsql_data
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.days_stay = "29" AND demographic.admityear >= "2121"
mimicsql_data
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE T...
SELECT Id, Text, Id AS "comment_link" FROM Comments WHERE LENGTH(Text) < 20 AND Text LIKE '%accept my answer%' OR Text LIKE '%please accept%' OR Text LIKE '%upvote please%' ORDER BY Id DESC LIMIT 200
sede
CREATE TABLE table_name_3 ( team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1st leg score when US Mbila Nzambi is team 1?
SELECT 1 AS st_leg FROM table_name_3 WHERE team_1 = "us mbila nzambi"
sql_create_context
CREATE TABLE table_14003108_1 ( highest VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many highest with team being forfar athletic
SELECT COUNT(highest) FROM table_14003108_1 WHERE team = "Forfar Athletic"
sql_create_context
CREATE TABLE table_20445 ( "Information" text, "Akimel A-al The name is Tohono Oodham for children of the river" text, "Altade\u00f1a" text, "Aprende" text, "Centennial" text, "Kyrene MS" text, "del Pueblo" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "del Pueblo" FROM table_20445 WHERE "Centennial" = '1988'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Tags ( Id number, TagName text, C...
SELECT p.CreationDate, t.TagName, p.Id AS "post_link" FROM Posts AS p JOIN Tags AS t ON ((p.PostTypeId = 4 AND t.ExcerptPostId = p.Id) OR (p.PostTypeId = 5 AND t.WikiPostId = p.Id)) WHERE p.PostTypeId IN (4, 5) AND p.Body LIKE '%http://%' AND NOT p.Body LIKE '%http://isfdb.org%' AND NOT p.Body LIKE '%http://www.isfdb.o...
sede
CREATE TABLE table_68789 ( "Institution" text, "Team" text, "City" text, "Province" text, "First season" real, "Head coach" text, "Enrollment" real, "Football stadium" text, "Capacity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT COUNT("Enrollment") FROM table_68789 WHERE "Institution" = 'mcgill university' AND "Capacity" < '25,012'
wikisql
CREATE TABLE table_name_9 ( winning_team VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team does mario andretti play pole position for?
SELECT winning_team FROM table_name_9 WHERE pole_position = "mario andretti"
sql_create_context
CREATE TABLE purchase ( branch_id VARCHAR, year VARCHAR ) CREATE TABLE branch ( branch_id VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of total pounds of purchase in year 2018 for all branches in London?
SELECT SUM(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018
sql_create_context
CREATE TABLE table_31409 ( "Rank" real, "Country/Territory" text, "Miss Earth" text, "Miss Air" real, "Miss Water" real, "Miss Fire" real, "Semifinalists" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest t...
SELECT MAX("Total") FROM table_31409
wikisql
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5969189' AND gwyjzb.IN_HOSP_DATE BETWEEN '2004-04-09' AND '2013-04-12'
css
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.itemid = "50836"
mimicsql_data
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'tobramycin fortified ophth. soln.' AND DATETIME(prescriptions.sta...
mimic_iii
CREATE TABLE table_name_10 ( floors INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of floors for the Citic Square?
SELECT AVG(floors) FROM table_name_10 WHERE name = "citic square"
sql_create_context
CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE sta...
SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY COUNT(Home_team)
nvbench
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airline ( airline_code...
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 ((flight.arrival_time <= 1830 AND flight.arrival_time >= 1730) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DETROIT' AND flight.to_...
atis
CREATE TABLE table_27771406_1 ( catches INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many catches did Clifford McWatt have?
SELECT MIN(catches) FROM table_27771406_1 WHERE player = "Clifford McWatt"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_name_63 ( winner VARCHAR, college VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the winner who attended college at Connecticut and is from North Syracuse, NY?
SELECT winner FROM table_name_63 WHERE college = "connecticut" AND hometown = "north syracuse, ny"
sql_create_context
CREATE TABLE Things ( thing_id INTEGER, organization_id INTEGER, Type_of_Thing_Code CHAR(15), service_type_code CHAR(10), service_details VARCHAR(255) ) CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(2...
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY COUNT(date_moved_in)
nvbench
CREATE TABLE table_5607 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the Final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament was played on October 1, 2006?
SELECT "Tournament" FROM table_5607 WHERE "Date" = 'october 1, 2006'
wikisql
CREATE TABLE table_name_15 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does Mikhail Kravets play?
SELECT position FROM table_name_15 WHERE player = "mikhail kravets"
sql_create_context
CREATE TABLE project_staff ( staff_id number, project_id number, role_code text, date_from time, date_to time, other_details text ) CREATE TABLE projects ( project_id number, organisation_id number, project_details text ) CREATE TABLE project_outcomes ( project_id number, o...
SELECT COUNT(*) FROM project_staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54'
spider
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Stephen Cooper%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id ...
advising
CREATE TABLE table_name_19 ( population INTEGER, code VARCHAR, area__km_2__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the population with a code more than 90902 and an area less than 1,335.47?
SELECT MIN(population) FROM table_name_19 WHERE code > 90902 AND area__km_2__ < 1 OFFSET 335.47
sql_create_context
CREATE TABLE table_10776 ( "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 week 12 result?
SELECT "Result" FROM table_10776 WHERE "Week" = '12'
wikisql
CREATE TABLE table_11465521_2 ( tv VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which channel had the game against the Minnesota Vikings?
SELECT tv FROM table_11465521_2 WHERE opponent = "Minnesota Vikings"
sql_create_context
CREATE TABLE table_name_41 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the home team from South Melbourne?
SELECT date FROM table_name_41 WHERE home_team = "south melbourne"
sql_create_context
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_...
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, 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 CITY_1.city_name = 'TORONTO' AND DAYS_1.day_name =...
atis
CREATE TABLE table_203_801 ( id number, "season" text, "division" text, "tier" text, "position" number, "cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long does this table cover in years ?
SELECT MAX("season") - MIN("season") FROM table_203_801
squall
CREATE TABLE table_203_541 ( id number, "games" text, "host city" text, "dates" text, "nations" number, "participants" number, "events" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what dates did the 1984 summer olympics take place ?
SELECT "dates" FROM table_203_541 WHERE "games" = '1984 summer olympics'
squall
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 AVG(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "GANGRENE"
mimicsql_data
CREATE TABLE table_10380 ( "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 is the total number of people that attended...
SELECT SUM("Crowd") FROM table_10380 WHERE "Venue" = 'glenferrie oval'
wikisql
CREATE TABLE table_48429 ( "Name" text, "Daytime" text, "Evening" text, "Saturday" text, "Sunday" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Daytime which has a Name of exmouth?
SELECT "Daytime" FROM table_48429 WHERE "Name" = 'exmouth'
wikisql
CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number, longitude nu...
SELECT stat_cause_descr FROM fires GROUP BY stat_cause_descr ORDER BY COUNT(*) DESC LIMIT 1
uswildfires
CREATE TABLE table_20812 ( "Official #" real, "TF1 #" real, "French title" text, "English title" text, "Air date (France)" text, "Original Beechwood Bunny Tale / Source material" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was responsible...
SELECT "Original Beechwood Bunny Tale / Source material" FROM table_20812 WHERE "English title" = 'The Monster of Blueberry Lake'
wikisql
CREATE TABLE table_204_466 ( id number, "rank" number, "bib" number, "country" text, "time" text, "penalties (p+s)" text, "deficit" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many countries were represented ?
SELECT COUNT("country") FROM table_204_466
squall
CREATE TABLE table_65094 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "TV Time" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent of the game after Week 3 with a Result of L 10 6?
SELECT "Opponent" FROM table_65094 WHERE "Week" > '3' AND "Result" = 'l 10–6'
wikisql
CREATE TABLE table_name_33 ( opponent_in_the_final VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent on the 28 july 2013 final?
SELECT opponent_in_the_final FROM table_name_33 WHERE date = "28 july 2013"
sql_create_context
CREATE TABLE table_245711_2 ( season VARCHAR, final_record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many time is the final record is 9 16 5?
SELECT COUNT(season) FROM table_245711_2 WHERE final_record = "9–16–5"
sql_create_context
CREATE TABLE table_name_62 ( podiums INTEGER, f_laps VARCHAR, season VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of podiums before 2008 with a 5th position and more than 0 f/laps?
SELECT MAX(podiums) FROM table_name_62 WHERE season < 2008 AND position = "5th" AND f_laps > 0
sql_create_context
CREATE TABLE table_name_81 ( gold INTEGER, total VARCHAR, bronze VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many gold have a bronze of 1, a rank smaller than 6, and a total less than 3?
SELECT SUM(gold) FROM table_name_81 WHERE bronze = 1 AND rank < 6 AND total < 3
sql_create_context
CREATE TABLE table_name_41 ( series VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On May 8 what series is it?
SELECT series FROM table_name_41 WHERE date = "may 8"
sql_create_context
CREATE TABLE weather ( date text, max_temperature_f number, mean_temperature_f number, min_temperature_f number, max_dew_point_f number, mean_dew_point_f number, min_dew_point_f number, max_humidity number, mean_humidity number, min_humidity number, max_sea_level_pressure_inc...
SELECT T1.id FROM trip AS T1 JOIN weather AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.zip_code HAVING AVG(T2.mean_temperature_f) > 60
spider