instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'che...
mimic_iii
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, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours...
advising
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY MAX(Revenue) DESC
nvbench
CREATE TABLE table_49196 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the game with the boston br...
SELECT SUM("Game") FROM table_49196 WHERE "Opponent" = 'boston bruins'
wikisql
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 '2010-05-21' AND '2019-08-03' AND t_kc22.SELF_PAY_PRO < 0.48
css
CREATE TABLE table_name_91 ( record VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Record that has the Team of minnesota?
SELECT record FROM table_name_91 WHERE team = "minnesota"
sql_create_context
CREATE TABLE table_5441 ( "Driver" text, "Seasons" text, "Entries" real, "3rd places" real, "Percentage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many entries have 3rd places greater than 19, and alain prost as the driver?
SELECT COUNT("Entries") FROM table_5441 WHERE "3rd places" > '19' AND "Driver" = 'alain prost'
wikisql
CREATE TABLE table_name_17 ( opponent_in_the_final VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was played against in the final on November 14, 1994?
SELECT opponent_in_the_final FROM table_name_17 WHERE date = "november 14, 1994"
sql_create_context
CREATE TABLE table_name_98 ( player VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has a date of 12-02-2003?
SELECT player FROM table_name_98 WHERE date = "12-02-2003"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Coimbatore%' OR UPPER(Location) LIKE '%coimbatore%' OR Location LIKE '%Coimbatore%' AND Reputation >= 1000 ORDER BY Reputation DESC
sede
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 WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.discharge_location = "SNF"
mimicsql_data
CREATE TABLE table_name_85 ( attendance VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Attendance of the game against the Los Angeles Raiders?
SELECT attendance FROM table_name_85 WHERE opponent = "los angeles raiders"
sql_create_context
CREATE TABLE table_5821 ( "Placing" real, "Team" text, "Players" text, "Seeding" text, "Playoffs W-L" text, "Matches W-L" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Players of judith wiesner and alex antonitsch had what match w-l?
SELECT "Matches W-L" FROM table_5821 WHERE "Players" = 'judith wiesner and alex antonitsch'
wikisql
CREATE TABLE table_29163303_4 ( championship VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many championships were there where the score was 4 6, 7 6 (7 5) , [5 10]?
SELECT COUNT(championship) FROM table_29163303_4 WHERE score = "4–6, 7–6 (7–5) , [5–10]"
sql_create_context
CREATE TABLE table_16384596_4 ( directed_by VARCHAR, broadcast_order VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode for s02 e08?
SELECT directed_by FROM table_16384596_4 WHERE broadcast_order = "S02 E08"
sql_create_context
CREATE TABLE table_33366 ( "Outcome" text, "Date" text, "Tournament" text, "Partner" text, "Opponents in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date has the tom gullikson butch walts final, and who was the runner-up?
SELECT "Date" FROM table_33366 WHERE "Outcome" = 'runner-up' AND "Opponents in the final" = 'tom gullikson butch walts'
wikisql
CREATE TABLE table_15261_1 ( voltage_range__v_ VARCHAR, clock_multiplier VARCHAR, part_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the voltage range (v) if the clock multiplier is 3x or 2x mode and part number is a80486dx4wb-100?
SELECT COUNT(voltage_range__v_) FROM table_15261_1 WHERE clock_multiplier = "3X or 2X mode" AND part_number = "A80486DX4WB-100"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl...
css
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) -- Using valid SQLite, answer the following questions ...
SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY COUNT(Country) DESC
nvbench
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VAR...
SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code
nvbench
CREATE TABLE table_name_53 ( group_c VARCHAR, group_b VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the group C region with Illinois as group B?
SELECT group_c FROM table_name_53 WHERE group_b = "illinois"
sql_create_context
CREATE TABLE table_34017 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What average week has shea stadium as the game site, and 1979-12-09 as the date?
SELECT AVG("Week") FROM table_34017 WHERE "Game site" = 'shea stadium' AND "Date" = '1979-12-09'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, ...
SELECT MAX(value) FROM (SELECT CAST(COUNT(v.Id) AS FLOAT) / p.ViewCount AS value FROM Votes AS v, Posts AS p WHERE v.VoteTypeId IN (2, 3) AND p.Id = v.PostId AND p.PostTypeId = 1 AND p.ViewCount >= 1 GROUP BY p.ViewCount, p.Id) AS t
sede
CREATE TABLE train ( train_id number, name text, time text, service text ) CREATE TABLE train_station ( train_id number, station_id number ) CREATE TABLE station ( station_id number, name text, annual_entry_exit number, annual_interchanges number, total_passengers number, ...
SELECT COUNT(*) FROM station
spider
CREATE TABLE table_4347 ( "Year" real, "Award" text, "Title of work" text, "Medium" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the title of work for year more than 2009
SELECT "Title of work" FROM table_4347 WHERE "Year" > '2009'
wikisql
CREATE TABLE table_42710 ( "Season" text, "League" text, "Games" real, "Lost" real, "Tied" real, "Points" real, "Winning %" real, "Goals for" real, "Goals against" real, "Standing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT COUNT("Lost") FROM table_42710 WHERE "Tied" < '5' AND "Goals for" > '330'
wikisql
CREATE TABLE table_65464 ( "Model" text, "Years" text, "Type/code" text, "Power@rpm" text, "Torque@rpm" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Type/code has a Torque@rpm of n m (lb ft) @1900 3500? Question 1
SELECT "Type/code" FROM table_65464 WHERE "Torque@rpm" = 'n·m (lb·ft) @1900–3500'
wikisql
CREATE TABLE table_20855 ( "Year" real, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race time" text, "Average speed (mph)" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT "Miles (km)" FROM table_20855 WHERE "Date" = 'June 7'
wikisql
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) ...
SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY state DESC
nvbench
CREATE TABLE table_name_3 ( finalist VARCHAR, semifinalists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which finalist has Semifinalists of andre agassi (1) lleyton hewitt (14)?
SELECT finalist FROM table_name_3 WHERE semifinalists = "andre agassi (1) lleyton hewitt (14)"
sql_create_context
CREATE TABLE table_7709 ( "Draw" real, "Artist" text, "Song" text, "Televote" real, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Artist Justinas Lapatinskas with a draw of greater than 9 got what as the highest televote?
SELECT MAX("Televote") FROM table_7709 WHERE "Artist" = 'justinas lapatinskas' AND "Draw" > '9'
wikisql
CREATE TABLE elimination ( elimination_id text, wrestler_id text, team text, eliminated_by text, elimination_move text, time text ) CREATE TABLE wrestler ( wrestler_id number, name text, reign text, days_held text, location text, event text ) -- Using valid SQLite, ans...
SELECT name FROM wrestler WHERE NOT wrestler_id IN (SELECT wrestler_id FROM elimination)
spider
CREATE TABLE acceptance ( submission_id number, workshop_id number, result text ) CREATE TABLE submission ( submission_id number, scores number, author text, college text ) CREATE TABLE workshop ( workshop_id number, date text, venue text, name text ) -- Using valid SQLit...
SELECT college FROM submission GROUP BY college ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, AVG(Price) FROM Products GROUP BY Name ORDER BY AVG(Price)
nvbench
CREATE TABLE table_24287 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 'i feel good' is the title and joe sachs is the writer how ...
SELECT COUNT("Series #") FROM table_24287 WHERE "Written by" = 'Joe Sachs' AND "Title" = 'I Feel Good'
wikisql
CREATE TABLE table_74372 ( "Rank" real, "Rider" text, "Mon 30 May" text, "Tues 31 May" text, "Wed 1 June" text, "Thurs 2 June" text, "Fri 3 June" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Fri 3 June time for the rider with a...
SELECT "Fri 3 June" FROM table_74372 WHERE "Wed 1 June" = '18'' 22.66 123.182mph'
wikisql
CREATE TABLE table_53301 ( "D 50 O" text, "D 49 \u221a" text, "D 48 \u221a" text, "D 47 \u221a" text, "D 46 \u221a" text, "D 45 \u221a" text, "D 44 \u221a" text, "D 43 \u221a" text, "D 42 \u221a" text, "D 41 \u221a" text ) -- Using valid SQLite, answer the following questions f...
SELECT "D 43 \u221a" FROM table_53301 WHERE "D 46 \u221a" = 'd 26'
wikisql
CREATE TABLE table_30675 ( "Couple" text, "Style" text, "Music" text, "Trine Dehli Cleve" real, "Tor Fl\u00f8ysvik" real, "Karianne Gulliksen" real, "Christer Tornell" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many...
SELECT COUNT("Couple") FROM table_30675 WHERE "Music" = ' I Wonder Why "— Curtis Stigers'
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 demographic.days_stay, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "18351"
mimicsql_data
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road
nvbench
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergy...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu...
eicu
CREATE TABLE table_name_79 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on 10 November 2006?
SELECT score FROM table_name_79 WHERE date = "10 november 2006"
sql_create_context
CREATE TABLE table_49577 ( "Date" text, "Place" text, "Race winners" text, "GP winner" text, "Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the GP winner with a place of genk, with race winners ben adriaenssen / ben van den bogaart?...
SELECT "GP winner" FROM table_49577 WHERE "Place" = 'genk' AND "Race winners" = 'ben adriaenssen / ben van den bogaart'
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 TagName FROM Tags
sede
CREATE TABLE table_9464 ( "Rank" real, "Airport" text, "Location" text, "IATA" text, "1985\u201386" real, "1990\u201391" real, "1995\u201396" real, "2000\u201301" real, "2005\u201306" real, "2007\u201308" real, "2009\u201310" real, "2010-11" real ) -- Using valid SQLite...
SELECT "Airport" FROM table_9464 WHERE "1985\u201386" = '407'
wikisql
CREATE TABLE table_204_911 ( id number, "album / name" text, "artist(s)" text, "label" text, "role/credit" text, "date" text, "chart#" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the next artist after artist enomoto atsuko ?
SELECT "artist(s)" FROM table_204_911 WHERE "date" > (SELECT "date" FROM table_204_911 WHERE "artist(s)" = 'enomoto atsuko') ORDER BY "date" LIMIT 1
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'levaquin')) AND STRFTIME('%y', cost.chargetime...
eicu
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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '彭丽泽' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-05-05' AND '2011-10-16' GROUP BY gwyjzb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '彭...
css
CREATE TABLE table_name_31 ( translated_title VARCHAR, norwegian_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Translated Title of Steinulven?
SELECT translated_title FROM table_name_31 WHERE norwegian_title = "steinulven"
sql_create_context
CREATE TABLE table_16278673_1 ( municipality VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the municpality for 57 populaton
SELECT municipality FROM table_16278673_1 WHERE population = "57"
sql_create_context
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Course_Authors_and_...
SELECT password, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_204_869 ( id number, "species" text, "country of origin" text, "total released" number, "first release" text, "last release" text, "areas of release" text, "areas established" text, "pasture type" text ) -- Using valid SQLite, answer the following questions for t...
SELECT "species" FROM table_204_869 WHERE "species" IN ('bubas bison', 'copris hispanus linnaeus') ORDER BY "total released" DESC LIMIT 1
squall
CREATE TABLE table_name_35 ( election INTEGER, municipality VARCHAR, inhabitants VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Election has a Municipality of laives, and Inhabitants smaller than 17,197?
SELECT AVG(election) FROM table_name_35 WHERE municipality = "laives" AND inhabitants < 17 OFFSET 197
sql_create_context
CREATE TABLE table_7203 ( "Rank" text, "Name" text, "Height m / ft" text, "Floors" real, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of floors that have years under 2008 and were named Guinness Tower?
SELECT COUNT("Floors") FROM table_7203 WHERE "Year" < '2008' AND "Name" = 'guinness tower'
wikisql
CREATE TABLE table_name_74 ( to_par VARCHAR, money___£__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par for the player with winnings of 49,500?
SELECT to_par FROM table_name_74 WHERE money___£__ = "49,500"
sql_create_context
CREATE TABLE table_name_84 ( cuts_made INTEGER, events INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the lowest cuts made that have events less than 4?
SELECT MIN(cuts_made) FROM table_name_84 WHERE events < 4
sql_create_context
CREATE TABLE table_19526911_1 ( arena__capacity_ VARCHAR, head_coach VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the arena capacity of the arena in the town whose head coach is Roberto Serniotti?
SELECT arena__capacity_ FROM table_19526911_1 WHERE head_coach = "Roberto Serniotti"
sql_create_context
CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE volume ( Volume_ID int, V...
SELECT Category, COUNT(*) FROM music_festival GROUP BY Category ORDER BY COUNT(*)
nvbench
CREATE TABLE table_23249053_8 ( score VARCHAR, game INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score when the game is bigger than 29.0?
SELECT score FROM table_23249053_8 WHERE game > 29.0
sql_create_context
CREATE TABLE table_47601 ( "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. -- Who was the home team when Manchester City was the away team?
SELECT "Home team" FROM table_47601 WHERE "Away team" = 'manchester city'
wikisql
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE EM...
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY SUM(CRS_CREDIT)
nvbench
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT BBDM, BBMC, BBZT FROM jybgb WHERE BGDH = '63924236375'
css
CREATE TABLE days ( days_code varchar, day_name varchar ) 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 text, departur...
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.flight_number = 352 AND flight.to_airport ...
atis
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Fall NOS"
mimicsql_data
CREATE TABLE table_60233 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest First Elected, when Results is 'Re-elected', and when Incumbent is 'Lincoln...
SELECT MIN("First elected") FROM table_60233 WHERE "Results" = 're-elected' AND "Incumbent" = 'lincoln davis'
wikisql
CREATE TABLE table_21853 ( "Episode" real, "Original title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Duration" text, "Viewership" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the first airdate with a ...
SELECT "Original airdate" FROM table_21853 WHERE "Viewership" = '4.77 million'
wikisql
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B...
css
CREATE TABLE table_18373863_2 ( player VARCHAR, fcsl_team VARCHAR, years_played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 2006 is the year played and winter park is the fcsl team who is the player?
SELECT player FROM table_18373863_2 WHERE fcsl_team = "Winter Park" AND years_played = "2006"
sql_create_context
CREATE TABLE table_62580 ( "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 player has t3 as the place, with england united states as the country?
SELECT "Player" FROM table_62580 WHERE "Place" = 't3' AND "Country" = 'england united states'
wikisql
CREATE TABLE table_15115 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result for opponent of chicago bears
SELECT "Result" FROM table_15115 WHERE "Opponent" = 'chicago bears'
wikisql
CREATE TABLE table_48194 ( "Test flight" text, "Date" text, "Speed" text, "Altitude" text, "Crew" text, "Duration" text, "Comment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What it Duration, when Test Flight is Free Flight #3?
SELECT "Duration" FROM table_48194 WHERE "Test flight" = 'free flight #3'
wikisql
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_fli...
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOST...
atis
CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE budget ( School_id int, Year int, Budgeted int, total_budget_percent_budgeted real, Invested int, total_budget_percent_invested real, Budget_invested_percent text ) CREAT...
SELECT County, SUM(Enrollment) FROM School GROUP BY County
nvbench
CREATE TABLE table_37267 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was a friendly game held that had a score of 2:3?
SELECT "Date" FROM table_37267 WHERE "Type of game" = 'friendly' AND "Results\u00b9" = '2:3'
wikisql
CREATE TABLE table_27003223_4 ( democratic VARCHAR, registered_voters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the percentage of democratic voters in which the registered voters is 67.8%?
SELECT democratic FROM table_27003223_4 WHERE registered_voters = "67.8%"
sql_create_context
CREATE TABLE table_34504 ( "Volume" text, "Discs" real, "Episodes" real, "Region 1 release" text, "Region 2 release" text, "Region 4 release" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What discs has a region 1 release date of January 22, 20...
SELECT "Discs" FROM table_34504 WHERE "Region 1 release" = 'january 22, 2008'
wikisql
CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE...
SELECT rank FROM faculty GROUP BY rank ORDER BY COUNT(*) LIMIT 1
spider
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, nationality text, age text ) CREATE TABLE party_host ( party_id number, host_id number, is...
SELECT party_theme, location FROM party
spider
CREATE TABLE table_55440 ( "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 average amount of spectators when Es...
SELECT AVG("Crowd") FROM table_55440 WHERE "Home team" = 'essendon'
wikisql
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 jybgb ( BBCJBW text, BBDM tex...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '马...
css
CREATE TABLE table_61384 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank with a higher than 2 total, 21 gold and more than 12 bronze?
SELECT AVG("Rank") FROM table_61384 WHERE "Total" > '2' AND "Gold" = '21' AND "Bronze" > '12'
wikisql
CREATE TABLE table_60754 ( "Date" text, "Time" text, "Competition" text, "Opponent" text, "Ground" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition is at 23:00 cet?
SELECT "Competition" FROM table_60754 WHERE "Time" = '23:00 cet'
wikisql
CREATE TABLE table_name_90 ( event VARCHAR, opponent VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which event had the opponent of shinya aoki and was at 4:56?
SELECT event FROM table_name_90 WHERE opponent = "shinya aoki" AND time = "4:56"
sql_create_context
CREATE TABLE table_22067 ( "Position" real, "Club" text, "Games played" real, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the hi...
SELECT MAX("Games played") FROM table_22067
wikisql
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transa...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE transaction_type_code = "SALE" ORDER BY date_of_transaction DESC
nvbench
CREATE TABLE table_43466 ( "Index" text, "Name" text, "Song" text, "Group Song" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Song's Index?
SELECT "Index" FROM table_43466 WHERE "Song" = '会呼吸的痛'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( ...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FRO...
mimic_iii
CREATE TABLE table_20010140_9 ( record VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record after game 20?
SELECT record FROM table_20010140_9 WHERE game = 20
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 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 WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND demographic.dob_year < "2041"
mimicsql_data
CREATE TABLE table_46124 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What w...
SELECT "Score" FROM table_46124 WHERE "Date" = 'november 1'
wikisql
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 = "Government" AND procedures.long_title = "Initial insertion of dual-chamber device"
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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE"
mimicsql_data
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "1" AND prescriptions.drug = "Aspirin EC"
mimicsql_data
CREATE TABLE table_28326 ( "Episode #" real, "Series #" real, "Title" text, "Director" text, "Writer" text, "Original airdate" text, "Viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the episode that ...
SELECT "Title" FROM table_28326 WHERE "Viewers (in millions)" = '8.51'
wikisql
CREATE TABLE table_name_86 ( method VARCHAR, event VARCHAR, round VARCHAR, res VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which method had a 3 rounds, result in a loss and the Juiz de Fora - fight 1 event?
SELECT method FROM table_name_86 WHERE round = "3" AND res = "loss" AND event = "juiz de fora - fight 1"
sql_create_context
CREATE TABLE table_name_45 ( elevation__m_ INTEGER, prominence__m_ INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Elevation (m) has a Prominence (m) larger than 1,754?
SELECT SUM(elevation__m_) FROM table_name_45 WHERE prominence__m_ > 1 OFFSET 754
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '杨...
css
CREATE TABLE table_74177 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who ha...
SELECT "High assists" FROM table_74177 WHERE "Date" = 'October 7'
wikisql
CREATE TABLE table_25155 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the partner count when t...
SELECT COUNT("Partner") FROM table_25155 WHERE "Opponents in the final" = 'Forget Leconte'
wikisql