instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_24990183_7 ( name VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the rank is 17, what are the names?
SELECT name FROM table_24990183_7 WHERE rank = 17
sql_create_context
CREATE TABLE table_name_51 ( reservation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1979 number for Standing Rock Indian Reservation when the 1989 is less than 54.9?
SELECT SUM(1979) FROM table_name_51 WHERE reservation = "standing rock indian reservation" AND 1989 < 54.9
sql_create_context
CREATE TABLE table_49308 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent, when Attendance is 58,836?
SELECT "Opponent" FROM table_49308 WHERE "Attendance" = '58,836'
wikisql
CREATE TABLE table_41893 ( "Name" text, "Level" real, "Digits" real, "Average size (square miles)" text, "Number of HUs (approximate)" real, "Example name" text, "Example code (HUC)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the...
SELECT AVG("Example code (HUC)") FROM table_41893 WHERE "Example name" = 'lower snake' AND "Digits" = '6' AND "Level" < '3'
wikisql
CREATE TABLE table_29572 ( "Name/Name of Act" text, "Age(s)" text, "Genre" text, "Act" text, "Hometown" text, "Qtr. Final (Week)" real, "Semi Final (Week)" text, "Position Reached" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is t...
SELECT MIN("Qtr. Final (Week)") FROM table_29572 WHERE "Name/Name of Act" = 'Austin Anderson'
wikisql
CREATE TABLE table_30696 ( "Reservoir" text, "Basin" text, "Location" text, "Type" text, "Height (m)" text, "Length along the top (m)" text, "Drainage basin (km\u00b2)" text, "Reservoir surface (ha)" text, "Volume (hm\u00b3)" text ) -- Using valid SQLite, answer the following quest...
SELECT "Volume (hm\u00b3)" FROM table_30696 WHERE "Reservoir" = 'Tanes'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "23" AND prescriptions.formulary_drug_cd = "ACYC400"
mimicsql_data
CREATE TABLE table_23576 ( "Story #" real, "Target #" text, "Title" text, "Author" text, "Reader" text, "Format" text, "Company" text, "Release Date" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the title of th...
SELECT "Title" FROM table_23576 WHERE "Story #" = '91'
wikisql
CREATE TABLE table_name_9 ( class VARCHAR, erp_w VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What class is ERP W of 800?
SELECT class FROM table_name_9 WHERE erp_w = 800
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'smoking cessation counseling given')
eicu
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "2254"
mimicsql_data
CREATE TABLE station ( id number, network_name text, services text, local_authority text ) CREATE TABLE route ( train_id number, station_id number ) CREATE TABLE weekly_weather ( station_id number, day_of_week text, high_temperature number, low_temperature number, precipita...
SELECT MAX(t1.low_temperature), AVG(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id WHERE t2.network_name = "Amersham"
spider
CREATE TABLE table_name_20 ( event VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which event was held at Manly Beach?
SELECT event FROM table_name_20 WHERE location = "manly beach"
sql_create_context
CREATE TABLE table_43959 ( "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. -- Who was the home team against the Bolton Wanderers?
SELECT "Home team" FROM table_43959 WHERE "Away team" = 'bolton wanderers'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
SELECT P.OwnerUserId, P.Title, P.Tags, P.ViewCount, P.Score, P.AnswerCount, P.CreationDate FROM Posts AS P WHERE (P.Tags LIKE '%android-testing%') OR (P.Tags LIKE '%robotium%') OR (P.Tags LIKE '%androidviewclient%') OR (P.Tags LIKE '%monkeyrunner%') OR (P.Tags LIKE '%android-espresso%') OR (P.Tags LIKE '%android-emulat...
sede
CREATE TABLE table_51600 ( "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. -- Tell me the away team score for away team of sou...
SELECT "Away team score" FROM table_51600 WHERE "Away team" = 'south melbourne'
wikisql
CREATE TABLE table_55306 ( "Year" real, "Animal" text, "Artist" text, "Finish" text, "Mintage" real, "Issue Price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the downy woodpecker coin created?
SELECT SUM("Year") FROM table_55306 WHERE "Animal" = 'downy woodpecker'
wikisql
CREATE TABLE table_28269 ( "Model" text, "Launch" text, "Code name" text, "Transistors (million)" real, "Die size (mm 2 )" real, "Bus interface" text, "Memory ( MB )" text, "SM count" real, "Core config 1,3" text, "Core ( MHz )" real, "Shader ( MHz )" real, "Memory ( MHz ...
SELECT "Model" FROM table_28269 WHERE "Launch" = 'September 3, 2010'
wikisql
CREATE TABLE table_name_65 ( opponent VARCHAR, save VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent has a save of smith (22)?
SELECT opponent FROM table_name_65 WHERE save = "smith (22)"
sql_create_context
CREATE TABLE table_name_71 ( win_draw_lose VARCHAR, venue VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the home game against Derby County?
SELECT win_draw_lose FROM table_name_71 WHERE venue = "home" AND team = "derby county"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time,...
SELECT AVG(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 = 16472)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
mimic_iii
CREATE TABLE table_43812 ( "Club" text, "League goals" text, "FA Cup goals" text, "League Cup goals" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Total has a Club of darlington, and a League goals of 13, and a League Cup goals ...
SELECT SUM("Total") FROM table_43812 WHERE "Club" = 'darlington' AND "League goals" = '13' AND "League Cup goals" = '1'
wikisql
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Po...
SELECT DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%germany%' OR Location LIKE '%Germany%' OR Location LIKE N'%DE%' OR Location LIKE N'%de%' OR Location LIKE N'%deutschland%' ORDER BY Reputation DESC LIMIT 3000
sede
CREATE TABLE table_train_103 ( "id" int, "systolic_blood_pressure_sbp" int, "epilepsy" bool, "diastolic_blood_pressure_dbp" int, "heart_rate" int, "seizure_disorder" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT * FROM table_train_103 WHERE age >= 65
criteria2sql
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'N83.862' AND jyjgzbb.JCZBDM = '258272'
css
CREATE TABLE table_name_4 ( location VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Location has a Frequency of 102.5 fm?
SELECT location FROM table_name_4 WHERE frequency = "102.5 fm"
sql_create_context
CREATE TABLE table_name_89 ( crowd INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest crowd for victoria park?
SELECT MIN(crowd) FROM table_name_89 WHERE venue = "victoria park"
sql_create_context
CREATE TABLE table_73846 ( "Season no." real, "Series no." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What episode number in the seaso...
SELECT MAX("Season no.") FROM table_73846 WHERE "Title" = 'Stray'
wikisql
CREATE TABLE table_439 ( "Overall Pick #" real, "AFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position for the pick number 17?
SELECT "Position" FROM table_439 WHERE "Overall Pick #" = '17'
wikisql
CREATE TABLE table_15621965_18 ( no INTEGER, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT WAS THE NUMBER OF THE ONLY FORWARD-CENTER TO MAKE THE ROSTER?
SELECT MIN(no) FROM table_15621965_18 WHERE position = "Forward-Center"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb...
css
CREATE TABLE table_77295 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the class position of the team that was in the 4th position?...
SELECT "Class Pos." FROM table_77295 WHERE "Pos." = '4th'
wikisql
CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255...
SELECT customer_last_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id
nvbench
CREATE TABLE table_2446333_2 ( date VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for eastern creek raceway
SELECT date FROM table_2446333_2 WHERE circuit = "Eastern Creek Raceway"
sql_create_context
CREATE TABLE table_26850 ( "Governorate" text, "Kurdistan Democratic Party" real, "Patriotic Union of Kurdistan" real, "Total Kurdistan List" real, "Total Governorate Seats" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least total kurdist...
SELECT MIN("Total Kurdistan List") FROM table_26850
wikisql
CREATE TABLE table_name_40 ( week INTEGER, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest week that shows a record of 8 5?
SELECT MIN(week) FROM table_name_40 WHERE record = "8–5"
sql_create_context
CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.icd9_code = "56210"
mimicsql_data
CREATE TABLE table_45278 ( "Series Number" real, "Number of Episodes" real, "Original Air Date" real, "DVD Region 2 release date" text, "DVD Region 1 release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many series originally aired befor...
SELECT COUNT("Series Number") FROM table_45278 WHERE "Original Air Date" < '1999' AND "Number of Episodes" > '7' AND "DVD Region 1 release date" = '16 april 2013'
wikisql
CREATE TABLE table_name_68 ( away VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What away is there for the q3 round?
SELECT away FROM table_name_68 WHERE round = "q3"
sql_create_context
CREATE TABLE table_203_652 ( id number, "goal" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many competitions had a score of 1-0 at most...
SELECT COUNT(*) FROM table_203_652 WHERE "score" = '1-0'
squall
CREATE TABLE table_66695 ( "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 total number of Silver for the Nation with more than 1 Bronze and a Rank less th...
SELECT COUNT("Silver") FROM table_66695 WHERE "Bronze" > '1' AND "Rank" < '5'
wikisql
CREATE TABLE table_204_617 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the sooners opponent after usc ?
SELECT "opponent#" FROM table_204_617 WHERE "date" > (SELECT "date" FROM table_204_617 WHERE "opponent#" = 'usc') ORDER BY "date" LIMIT 1
squall
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE cost ( row_id number...
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 = 'oxycodone (sustained release)' AND DATETIME(prescriptions.startda...
mimic_iii
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_co...
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 (((flight.stops = 0) AND date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AN...
atis
CREATE TABLE table_29902 ( "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. -- How ma...
SELECT COUNT("Date") FROM table_29902 WHERE "High rebounds" = 'Marcus Camby (18)'
wikisql
CREATE TABLE table_29469 ( "Team" text, "Head coach" text, "Team captain" text, "Kit maker" text, "Shirt sponsor" text, "Past Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What sponsor has the head coach Samad Marfavi?
SELECT "Shirt sponsor" FROM table_29469 WHERE "Head coach" = 'Samad Marfavi'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT demographic.dob, demographic.diagnosis FROM demographic WHERE demographic.name = "Brian Brock"
mimicsql_data
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Student_Tests_Taken ( registration_id IN...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" GROUP BY date_of_enrolment ORDER BY date_of_enrolment DESC
nvbench
CREATE TABLE table_61636 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent at the Honda Center on March...
SELECT "Opponent" FROM table_61636 WHERE "Arena" = 'honda center' AND "Date" = 'march 29'
wikisql
CREATE TABLE table_2850912_10 ( nhl_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team drafted Ron Annear?
SELECT nhl_team FROM table_2850912_10 WHERE player = "Ron Annear"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.MED_DIRE_CD, t_kc22.MED_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '65393641940' AND t_kc22.SOC_SRT_DIRE_CD = '307316-q'
css
CREATE TABLE table_name_13 ( wins VARCHAR, season VARCHAR, podiums VARCHAR, races VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins has a podiums greater than 1 and 9 as the races with a season after 1984?
SELECT COUNT(wins) FROM table_name_13 WHERE podiums > 1 AND races = 9 AND season > 1984
sql_create_context
CREATE TABLE table_204_244 ( id number, "year" number, "album" text, "peak\nus" number, "peak\nus\nholiday" number, "certifications\n(sales threshold)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many album entries are there ?
SELECT COUNT("album") FROM table_204_244
squall
CREATE TABLE table_22713 ( "Rank" real, "Peak" text, "Country" text, "Island" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest value for col(m) when prominence(m)...
SELECT MAX("Col (m)") FROM table_22713 WHERE "Prominence (m)" = '3755'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-203413')) AND intakeoutput.celllabel = 'outp...
eicu
CREATE TABLE table_282413_3 ( ethnic_group VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times is the ethnic group other: total?
SELECT COUNT(2001 AS __percentage) FROM table_282413_3 WHERE ethnic_group = "Other: Total"
sql_create_context
CREATE TABLE table_50184 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is bobby jones (a)?
SELECT "Place" FROM table_50184 WHERE "Player" = 'bobby jones (a)'
wikisql
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_amenity ( dormid...
SELECT LName, COUNT(LName) FROM Student WHERE Age < (SELECT AVG(Age) FROM Student) GROUP BY LName ORDER BY LName DESC
nvbench
CREATE TABLE table_name_89 ( goals VARCHAR, assists VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Goals, when Assists is greater than 28, and when Player is Steve Walker?
SELECT goals FROM table_name_89 WHERE assists > 28 AND player = "steve walker"
sql_create_context
CREATE TABLE table_name_70 ( byes INTEGER, ballarat_fl VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Byes that has Ballarat FL of Sunbury against more than 1167?
SELECT AVG(byes) FROM table_name_70 WHERE ballarat_fl = "sunbury" AND against > 1167
sql_create_context
CREATE TABLE table_2249029_1 ( gdp_world_rank VARCHAR, asian_rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the gdp world rank for asian rank being 20
SELECT gdp_world_rank FROM table_2249029_1 WHERE asian_rank = 20
sql_create_context
CREATE TABLE table_29160596_1 ( top_mc VARCHAR, appearances VARCHAR, year_inducted VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all the MCs with 5 appearances who were inducted in 2007?
SELECT top_mc FROM table_29160596_1 WHERE appearances = 5 AND year_inducted = 2007
sql_create_context
CREATE TABLE table_204_361 ( id number, "tie no" number, "home team" text, "score" text, "away team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what comes after fiskeby if
SELECT "home team" FROM table_204_361 WHERE id = (SELECT id FROM table_204_361 WHERE "home team" = 'fiskeby if') + 1
squall
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, su...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 FROM d_...
mimic_iii
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '方雅珺' AND MED_SER_ORG_NO = '4446242' AND IN_HOSP_DATE BETWEEN '2003-04-08' AND '2011-10-21')
css
CREATE TABLE table_name_47 ( country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For what country does the golfer play who has a score of 72-65=137?
SELECT country FROM table_name_47 WHERE score = 72 - 65 = 137
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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 mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '06038186' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2020-12-13')
css
CREATE TABLE table_name_35 ( year VARCHAR, runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the runner-up Jane Geddes?
SELECT year FROM table_name_35 WHERE runner_up = "jane geddes"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '98736904' AND t_kc22.STA_DATE BETWEEN '2007-01-26' AND '2015-08-06' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_45309 ( "Date" text, "Ship" text, "Type" text, "Nationality" text, "Tonnage GRT" real, "Fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the nationality when the ship is willerby?
SELECT "Nationality" FROM table_45309 WHERE "Ship" = 'willerby'
wikisql
CREATE TABLE table_60037 ( "Letter" text, "American" text, "British" text, "Australian" text, "Examples" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the examples for the Australian ?
SELECT "Examples" FROM table_60037 WHERE "Australian" = 'æ'
wikisql
CREATE TABLE table_57891 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date with a Leading scorer with maurice williams (25), and a Score with...
SELECT "Date" FROM table_57891 WHERE "Leading scorer" = 'maurice williams (25)' AND "Score" = '102–105'
wikisql
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '凤英发' AND NOT ...
css
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52395')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
CREATE TABLE table_name_81 ( capacity INTEGER, position_in_2004 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the highest capacity for a position of 5 in 2004?
SELECT MAX(capacity) FROM table_name_81 WHERE position_in_2004 = "5"
sql_create_context
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
CREATE TABLE table_51428 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NBA draft for ohio state?
SELECT "NBA Draft" FROM table_51428 WHERE "College" = 'ohio state'
wikisql
CREATE TABLE table_203_206 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what country won the same number of bronze as great britain , yet...
SELECT "nation" FROM table_203_206 WHERE "nation" <> 'great britain' AND "bronze" = (SELECT "bronze" FROM table_203_206 WHERE "nation" = 'great britain') AND "gold" = 0
squall
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6353786' AND gwyjzb.OUT_DIAG_DIS_NM = '胆囊炎' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6353786' AND fgwyjzb.OUT_DIAG_...
css
CREATE TABLE txmzjzjlb ( 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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-96048' AND NOT patient.hospitaldischargetime IS NULL ORDER...
eicu
CREATE TABLE table_1342013_37 ( incumbent VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the incumbent for pennsylvania 15
SELECT incumbent FROM table_1342013_37 WHERE district = "Pennsylvania 15"
sql_create_context
CREATE TABLE table_55019 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At what Venue was the Home team score 17.19 (121...
SELECT "Venue" FROM table_55019 WHERE "Home team score" = '17.19 (121)'
wikisql
CREATE TABLE table_2402864_1 ( playoffs VARCHAR, open_cup VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the playoff result where the league did not qualify in the Open Cup in 1998?
SELECT playoffs FROM table_2402864_1 WHERE open_cup = "Did not qualify" AND year = 1998
sql_create_context
CREATE TABLE table_name_83 ( driver VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the driver in 1964?
SELECT driver FROM table_name_83 WHERE year = "1964"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(gwyjzb.PERSON_ID) FROM gwyjzb WHERE gwyjzb.IN_DIAG_DIS_NM = '癫痫' UNION SELECT COUNT(fgwyjzb.PERSON_ID) FROM fgwyjzb WHERE fgwyjzb.IN_DIAG_DIS_NM = '癫痫'
css
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 ftxmzjzjlb ( HXPLC number, HZ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'S24.591' AND jyjgzbb.JCZBDM = '673489' UNION SELECT jyjgzbb.CKZFWX...
css
CREATE TABLE table_203_274 ( id number, "church name" text, "address" text, "community" text, "school" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which is the first church located in los angeles ?
SELECT "church name" FROM table_203_274 WHERE "community" = 'los angeles' ORDER BY id LIMIT 1
squall
CREATE TABLE table_8511 ( "Rank" real, "Team" text, "Round1" real, "Round2" real, "Round3" real, "Round4" real, "Round5" real, "Total Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the lowest round2 when round5 is 71 and ...
SELECT MIN("Round2") FROM table_8511 WHERE "Round5" = '71' AND "Round4" > '64'
wikisql
CREATE TABLE table_66129 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "TV Time" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance for the game against miami dolphins?
SELECT "Attendance" FROM table_66129 WHERE "Opponent" = 'miami dolphins'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.MED_ORG_DEPT_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '91661477964' UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.MED_ORG_DEPT_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '91661477964'
css
CREATE TABLE table_17360840_6 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game on December 11?
SELECT score FROM table_17360840_6 WHERE date = "December 11"
sql_create_context
CREATE TABLE table_name_10 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date they played against fitzroy?
SELECT date FROM table_name_10 WHERE away_team = "fitzroy"
sql_create_context
CREATE TABLE table_40447 ( "Draw" real, "Artist" text, "Song" text, "Result" text, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the place of the song 'Never Change'?
SELECT SUM("Place") FROM table_40447 WHERE "Song" = 'never change'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID ...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC
nvbench
CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) ...
SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE Headquarters <> 'USA' GROUP BY Main_Industry ORDER BY Main_Industry
nvbench
CREATE TABLE table_64035 ( "Draw" real, "Artist" text, "Song" text, "Percentage" text, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What song placed higher than#4?
SELECT "Song" FROM table_64035 WHERE "Place" > '4'
wikisql
CREATE TABLE table_name_95 ( founded VARCHAR, suburb VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the Beaudesert suburb club founded
SELECT founded FROM table_name_95 WHERE suburb = "beaudesert"
sql_create_context
CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_description VARCHAR(80) ) CREATE TABLE Detention ( detention_id INTEGER, detention_type_code VARCHAR(10), teacher_id INTEGER, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_s...
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench