instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 mzjzjlb.JZZDBM, mzjzjlb.JZZDSM 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 = '韩嘉容'
css
CREATE TABLE aircraft ( aircraft_id number, aircraft text, description text, max_gross_weight text, total_disk_area text, max_disk_loading text ) CREATE TABLE airport ( airport_id number, airport_name text, total_passengers number, %_change_2007 text, international_passenger...
SELECT name FROM pilot WHERE age >= 25
spider
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
SELECT PostType = pt.Name, TotalPosts = COUNT(*), TotalViews = SUM(ViewCount) FROM Posts AS p JOIN PostTypes AS pt ON p.PostTypeId = pt.Id WHERE OwnerUserId = @user AND CreationDate > @startDate GROUP BY pt.Name
sede
CREATE TABLE greatermanchestercrime ( crimeid text, crimets time, location text, lsoa text, type text, outcome text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many crimes are still 'Under investigation' to date?
SELECT COUNT(*) FROM greatermanchestercrime WHERE outcome LIKE "%Under investigation%"
greatermanchestercrime
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) 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 swimme...
SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality
nvbench
CREATE TABLE station ( name VARCHAR, station_id VARCHAR ) CREATE TABLE train_station ( station_id VARCHAR, train_id VARCHAR ) CREATE TABLE train ( train_id VARCHAR, Name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of t...
SELECT T2.Name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = "Ananthapuri Express" INTERSECT SELECT T2.Name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train...
sql_create_context
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.diagnosis = "STEMI"
mimicsql_data
CREATE TABLE table_5509 ( "RBIs" real, "Player" text, "Team" text, "Date" text, "Opponent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player is associated with the date May 10, 1999?
SELECT "Player" FROM table_5509 WHERE "Date" = 'may 10, 1999'
wikisql
CREATE TABLE table_18274425_1 ( no_in_season VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes had a viewership of 2.65 million?
SELECT COUNT(no_in_season) FROM table_18274425_1 WHERE us_viewers__millions_ = "2.65"
sql_create_context
CREATE TABLE table_name_72 ( team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2nd leg for the team 2 Milano?
SELECT 2 AS nd_leg FROM table_name_72 WHERE team_2 = "milano"
sql_create_context
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 treatment ( treatmentid...
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'valvular stenosis' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-3 year'))
eicu
CREATE TABLE table_38945 ( "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 average attendance for the game that was after week 4 and on November 14, 1954?
SELECT AVG("Attendance") FROM table_38945 WHERE "Week" > '4' AND "Date" = 'november 14, 1954'
wikisql
CREATE TABLE table_72561 ( "Rank" text, "Common of" text, "Population" real, "Area (km 2 )" text, "Density (inhabitants/km 2 )" text, "Altitude (mslm)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the density of the common with an area...
SELECT "Density (inhabitants/km 2 )" FROM table_72561 WHERE "Area (km 2 )" = '20.4'
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 demographic.age, demographic.diagnosis FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_name_87 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the date for 6 3, 6 2
SELECT date FROM table_name_87 WHERE score = "6–3, 6–2"
sql_create_context
CREATE TABLE table_name_87 ( score VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game that had an attendance of 32,036?
SELECT score FROM table_name_87 WHERE attendance = "32,036"
sql_create_context
CREATE TABLE table_name_66 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team's score at glenferrie oval?
SELECT home_team AS score FROM table_name_66 WHERE venue = "glenferrie oval"
sql_create_context
CREATE TABLE table_43121 ( "Team" text, "Country" text, "Home" text, "Skip" text, "Third" text, "Second" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the lead on the Europe team that has a Liudmila Privivkova as the ski...
SELECT "Lead" FROM table_43121 WHERE "Team" = 'europe' AND "Skip" = 'liudmila privivkova'
wikisql
CREATE TABLE table_name_72 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the Spurs' record was 43-13?
SELECT score FROM table_name_72 WHERE record = "43-13"
sql_create_context
CREATE TABLE table_42613 ( "Name" text, "Novelty" text, "Status" text, "Authors" text, "Unit" text, "Location" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status where the notes are possible jr synonym of sapeorn...
SELECT "Status" FROM table_42613 WHERE "Notes" = 'possible jr synonym of sapeornis'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmoun...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", DisplayName, WebsiteUrl, Reputation FROM Users AS u INNER JOIN Comments AS c ON c.UserId = u.Id INNER JOIN Posts AS p ON p.Id = c.PostId INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE (UPPER(Tag...
sede
CREATE TABLE table_7067 ( "Date" text, "Opponent" text, "Location" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance when the opponent was virginia?
SELECT SUM("Attendance") FROM table_7067 WHERE "Opponent" = 'virginia'
wikisql
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 instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN cou...
advising
CREATE TABLE table_27906667_2 ( legs_lost VARCHAR, high_checkout VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many legs were lost when the high checkout was 101?
SELECT COUNT(legs_lost) FROM table_27906667_2 WHERE high_checkout = 101
sql_create_context
CREATE TABLE table_name_96 ( score VARCHAR, opponent VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for the game against Malacca at the Klfa Stadium, Cheras?
SELECT score FROM table_name_96 WHERE opponent = "malacca" AND venue = "klfa stadium, cheras"
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 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 '2013-12-16' AND '2014-11-24' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_name_31 ( high_points VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the High points with a Game that is 56?
SELECT high_points FROM table_name_31 WHERE game = 56
sql_create_context
CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE faculty ( campus number, year number, faculty number ) CREATE TABLE ...
SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees LIMIT 1
spider
CREATE TABLE table_name_92 ( bronze INTEGER, silver VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest bronze number when silver is 0, and the total is smaller than 1?
SELECT MAX(bronze) FROM table_name_92 WHERE silver = 0 AND total < 1
sql_create_context
CREATE TABLE table_203_370 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the first marathon juma ikangaa won ?
SELECT "competition" FROM table_203_370 WHERE "position" = 1 ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_8054 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Falcons points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the opponents with a record of 3-0?
SELECT "Opponents" FROM table_8054 WHERE "Record" = '3-0'
wikisql
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 t_kc21.MAIN_COND_DES FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '12288488200'
css
CREATE TABLE table_name_85 ( notes VARCHAR, kit_supplier VARCHAR, shirt_printing VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the notes for the shirt that says +1 in the kit supplied by Rapido?
SELECT notes FROM table_name_85 WHERE kit_supplier = "rapido" AND shirt_printing = "名品+1"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, pat...
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-1746' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)
eicu
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, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) DESC
nvbench
CREATE TABLE fgwyjzb ( 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 JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '59190525' AND t_kc22.STA_DATE BETWEEN '2003-08-11' AND '2014-07-07' AND gwyjzb.MED_SER_ORG_NO = '2322054' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CL...
css
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline...
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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1....
atis
CREATE TABLE table_name_66 ( tie_no INTEGER, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the tie no when the attendance is 126?
SELECT AVG(tie_no) FROM table_name_66 WHERE attendance = 126
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "Vitamin B12"
mimicsql_data
CREATE TABLE table_60945 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the place of the player with 140,000 and a 68-68-75-68=279 score?
SELECT "Place" FROM table_60945 WHERE "Money ( \u00a3 )" = '140,000' AND "Score" = '68-68-75-68=279'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(SALARY)
nvbench
CREATE TABLE table_8787 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much money does player ben crenshaw, who has a t4 place, have?
SELECT "Money ( $ )" FROM table_8787 WHERE "Place" = 't4' AND "Player" = 'ben crenshaw'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, lan...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
mimic_iii
CREATE TABLE neighborhood ( id int, business_id varchar, neighborhood_name varchar ) CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes int, year int...
SELECT COUNT(DISTINCT (business.name)) FROM business, category WHERE business.city = 'Madison' AND category.business_id = business.business_id AND category.category_name = 'escape games'
yelp
CREATE TABLE table_name_88 ( score VARCHAR, year VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Year is before 2007, and when Tournament is 'Sydney'?
SELECT score FROM table_name_88 WHERE year < 2007 AND tournament = "sydney"
sql_create_context
CREATE TABLE table_28742 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many 'series' were in the 12...
SELECT COUNT("Series") FROM table_28742 WHERE "Position" = '12th'
wikisql
CREATE TABLE table_71255 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the venue when the competition was friendly, with a Result of 2 3?
SELECT "Venue" FROM table_71255 WHERE "Competition" = 'friendly' AND "Result" = '2–3'
wikisql
CREATE TABLE table_22884 ( "Performer" text, "Performances" real, "Category" text, "First performance" text, "Last performance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the last performance of leon varkas category:articles with hcards
SELECT "Last performance" FROM table_22884 WHERE "Performer" = 'Leon Varkas Category:Articles with hCards'
wikisql
CREATE TABLE table_name_1 ( total INTEGER, country VARCHAR, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is United States total in the year(s) won of 2000 , 2005 , 2006?
SELECT MIN(total) FROM table_name_1 WHERE country = "united states" AND year_s__won = "2000 , 2005 , 2006"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, ...
SELECT (SELECT CAST(COUNT(*) AS FLOAT) FROM Posts WHERE Body LIKE '%imgur%') / (SELECT CAST(COUNT(*) AS FLOAT) FROM Posts) * 100 AS "percentage_of_posts_mentioning_imgur"
sede
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2180" AND diagnoses.icd9_code = "3671"
mimicsql_data
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND procedures.short_title = "Coronar arteriogr-1 cath"
mimicsql_data
CREATE TABLE table_name_16 ( game VARCHAR, road_team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Game on April 13 with Road Team St. Louis?
SELECT game FROM table_name_16 WHERE road_team = "st. louis" AND date = "april 13"
sql_create_context
CREATE TABLE table_name_94 ( gold INTEGER, rank VARCHAR, total VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many gold did Gabon have when they were ranked no higher than 17, and less than 7 in total?
SELECT SUM(gold) FROM table_name_94 WHERE total < 7 AND nation = "gabon" AND rank < 17
sql_create_context
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Perinat GI sys dis NEC" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDa...
WITH tagBadge AS (SELECT Name, COUNT(Id) AS badge_count FROM Badges GROUP BY Name), metrics AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(Tags.Id) DESC) AS rank, TagName, COUNT(Tags.Id) AS UpVotes, badge_count FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId ...
sede
CREATE TABLE table_204_129 ( id number, "place" number, "team" text, "titles" number, "runners-up" number, "winning years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the total number of runers up titles awarded ?
SELECT SUM("runners-up") FROM table_204_129
squall
CREATE TABLE table_14861 ( "Round" text, "Track" text, "Race 1" text, "Race 2" text, "Race 3" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Race 2 has a Race 1 of dnf, a Race 3 of dnf, and the Track Winton?
SELECT "Race 2" FROM table_14861 WHERE "Race 1" = 'dnf' AND "Race 3" = 'dnf' AND "Track" = 'winton'
wikisql
CREATE TABLE table_55475 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average rank for players with under 26 events and less than 2 wins?
SELECT AVG("Rank") FROM table_55475 WHERE "Events" < '26' AND "Wins" < '2'
wikisql
CREATE TABLE table_name_97 ( score VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of game 36?
SELECT score FROM table_name_97 WHERE game = 36
sql_create_context
CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TAB...
SELECT SUM(hoursperweek), SUM(gamesplayed) FROM sportsinfo AS T1 JOIN student AS T2 ON T1.stuid = T2.stuid WHERE T2.age < 20
spider
CREATE TABLE table_name_6 ( time_retired VARCHAR, laps VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Time/Retired with over 56 laps and a grid of 5?
SELECT time_retired FROM table_name_6 WHERE laps > 56 AND grid = 5
sql_create_context
CREATE TABLE table_name_72 ( school VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school did delray brooks go to?
SELECT school FROM table_name_72 WHERE player = "delray brooks"
sql_create_context
CREATE TABLE table_name_6 ( production_code INTEGER, written_by VARCHAR, season__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest production code when the writer was brian egeston after season 5?
SELECT MAX(production_code) FROM table_name_6 WHERE written_by = "brian egeston" AND season__number > 5
sql_create_context
CREATE TABLE table_80243 ( "Representative" text, "Title" text, "Presentation of Credentials" text, "Termination of Mission" text, "Appointed by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which representative was the Ambassador Extraordinary an...
SELECT "Representative" FROM table_80243 WHERE "Title" = 'ambassador extraordinary and plenipotentiary' AND "Termination of Mission" = 'september 20, 1996'
wikisql
CREATE TABLE table_8502 ( "Date" text, "Time" text, "Home" text, "Guest" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was the time 14:30, the result 0:1, and the home team fc chiasso (chl)?
SELECT "Date" FROM table_8502 WHERE "Time" = '14:30' AND "Result" = '0:1' AND "Home" = 'fc chiasso (chl)'
wikisql
CREATE TABLE table_name_97 ( years VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the years for the 250 model?
SELECT years FROM table_name_97 WHERE model = "250"
sql_create_context
CREATE TABLE table_203_211 ( id number, "pos." number, "time" text, "athlete" text, "country" text, "venue" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many countries have at least one athlete who ranks in the top 25 ?
SELECT COUNT(DISTINCT "country") FROM table_203_211
squall
CREATE TABLE table_name_5 ( date VARCHAR, away VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date with an Away that is broadview hawks?
SELECT date FROM table_name_5 WHERE away = "broadview hawks"
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTyp...
SELECT cu.Id AS "user_link", cu.answers_count, cu.total_score, cu.avg_score FROM (SELECT vu.Id, vu.answers_count, vu.total_score, vu.avg_score, ROW_NUMBER() OVER (PARTITION BY answers_count ORDER BY avg_score DESC) AS rank FROM (SELECT u.Id, COUNT(1) AS answers_count, SUM(a.Score) AS total_score, SUM(a.Score) * 1.0 / C...
sede
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insuranc...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE table_58046 ( "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 away team score at the Windy Hill ve...
SELECT "Away team score" FROM table_58046 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE table_29084 ( "Round #" text, "Home Team" text, "Win/Loss" text, "Score" text, "Opposition" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opposition when the score is 37 - 28?
SELECT "Opposition" FROM table_29084 WHERE "Score" = '37 - 28'
wikisql
CREATE TABLE table_19206 ( "Elementary Schools" text, "Mascot" text, "Address" text, "Principal (2013-2014)" text, "Assistant Principal (2013-2014)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which elementary schools list Cort Monroe as the prin...
SELECT "Elementary Schools" FROM table_19206 WHERE "Principal (2013-2014)" = 'Cort Monroe'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.long_title = "Acute posthemorrhagic anemia"
mimicsql_data
CREATE TABLE table_3631 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Production code" FROM table_3631 WHERE "U.S. viewers (million)" = '11.76'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.diagnosis = "INFECTED RIGHT THIGH GRAFT"
mimicsql_data
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description v...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN program_course WHERE ((course.number < 400 + 100 AND course.number >= 400) OR (course.number < 500 + 100 AND course.number >= 500)) AND course.department = 'POLSCI' AND program_course.workload = (SELECT MIN(PRO...
advising
CREATE TABLE table_44031 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Tie no when the Home team was Ramsgate?
SELECT "Tie no" FROM table_44031 WHERE "Home team" = 'ramsgate'
wikisql
CREATE TABLE table_68019 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Adelaide has an Auckland of yes, a Melbourne of yes, a Perth of yes, an...
SELECT "Adelaide" FROM table_68019 WHERE "Auckland" = 'yes' AND "Melbourne" = 'yes' AND "Perth" = 'yes' AND "Sydney" = 'cancelled'
wikisql
CREATE TABLE table_name_58 ( weight VARCHAR, height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the weight of the player with a height of 2.00m?
SELECT weight FROM table_name_58 WHERE height = "2.00"
sql_create_context
CREATE TABLE table_4210 ( "Player" text, "Starts" real, "Cuts made" real, "Best finish" text, "Money list rank" text, "Earnings ($)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many ranks on the money list had a best finish of t10?
SELECT COUNT("Money list rank") FROM table_4210 WHERE "Best finish" = 'T10'
wikisql
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_8 ( high_rebounds VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is High Rebounds, when Date is 'March 12'?
SELECT high_rebounds FROM table_name_8 WHERE date = "march 12"
sql_create_context
CREATE TABLE table_22573 ( "Episode #" real, "Air date" text, "Team 1" text, "Players left after Round 1" text, "Team 2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air date that had the wykeham wonderers as team 1?
SELECT "Air date" FROM table_22573 WHERE "Team 1" = 'Wykeham Wonderers'
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 jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info 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 person_info_hz_info.KH = hz_info.KH AND pers...
css
CREATE TABLE table_train_215 ( "id" int, "hemoglobin_a1c_hba1c" float, "hgba1c" float, "estimated_glomerular_filtration_rate_egfr" int, "kidney_disease" bool, "body_mass_index_bmi" float, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT * FROM table_train_215 WHERE kidney_disease = 1 OR estimated_glomerular_filtration_rate_egfr < 45
criteria2sql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( r...
SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatine kinase, mb isoenzyme') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND DATETIME(labevents.charttime, 'start of year') = DATET...
mimic_iii
CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_44331 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the grid when the rider is mika kallio?
SELECT MAX("Grid") FROM table_44331 WHERE "Rider" = 'mika kallio'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, ...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code A...
atis
CREATE TABLE table_27654988_1 ( opponent VARCHAR, competition VARCHAR, scorers VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent in the Women's Cup 0 0 where Branc o Couto 0 is the scorer?
SELECT opponent FROM table_27654988_1 WHERE competition = "Women's Cup 0 0" AND scorers = "Brancão Couto 0"
sql_create_context
CREATE TABLE table_59702 ( "Place" real, "Nation" text, "All Around" real, "Final" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average final with an all around larger than 19.4 and total more than 39.9?
SELECT AVG("Final") FROM table_59702 WHERE "All Around" > '19.4' AND "Total" > '39.9'
wikisql
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "MRSA septicemia" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Self Pay" AND procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi"
mimicsql_data
CREATE TABLE table_name_20 ( week INTEGER, date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the weeks that games occured on october 21, 1974 and less than 50,623 fans attended?
SELECT SUM(week) FROM table_name_20 WHERE date = "october 21, 1974" AND attendance < 50 OFFSET 623
sql_create_context
CREATE TABLE table_name_86 ( rank INTEGER, goals VARCHAR, matches VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mean rank number when goals are 230 and there are more than 535?
SELECT AVG(rank) FROM table_name_86 WHERE goals = 230 AND matches > 535
sql_create_context
CREATE TABLE table_72501 ( "Shirt No" real, "Nationality" text, "Player" text, "Birth Date" text, "Height" real, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How tall is Maksim Botin?
SELECT "Height" FROM table_72501 WHERE "Player" = 'Maksim Botin'
wikisql
CREATE TABLE table_24291 ( "Episode number" real, "Total episodes" real, "Title" text, "Original UK broadcast by" text, "Original UK airdate" text, "DVD reference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is episode is 'Bouncy Ball'?
SELECT MIN("Total episodes") FROM table_24291 WHERE "Title" = 'Bouncy Ball'
wikisql