instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_142573_1 ( clock_rate__mhz_ INTEGER, designation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least clock rate mhz when designation is rimm 4200
SELECT MIN(clock_rate__mhz_) FROM table_142573_1 WHERE designation = "RIMM 4200"
sql_create_context
CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) -- Using valid SQLite, answer the following questions for the ...
SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE table_7113 ( "Year" real, "Conventional plans" text, "HMOs" text, "PPOs" text, "POS plans" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which conventional plan has a POS plan of 21%?
SELECT "Conventional plans" FROM table_7113 WHERE "POS plans" = '21%'
wikisql
CREATE TABLE table_4028 ( "Province" text, "First LLCR" real, "Appearances" real, "Championships" real, "Runner Up" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Ontario's first LLCR?
SELECT "First LLCR" FROM table_4028 WHERE "Province" = 'Ontario'
wikisql
CREATE TABLE table_62022 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent on Week 11?
SELECT "Opponent" FROM table_62022 WHERE "Week" = '11'
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 WHERE demographic.diagnosis = "HYPOXIA" AND demographic.age < "54"
mimicsql_data
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.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_37391 ( "Surname" text, "First" text, "D.O.B." text, "Bats" text, "Throws" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is mr. ryan's DOB?
SELECT "D.O.B." FROM table_37391 WHERE "Surname" = 'ryan'
wikisql
CREATE TABLE table_name_86 ( opponent VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team was the opponent when there were 27,321 in attendance?
SELECT opponent FROM table_name_86 WHERE attendance = "27,321"
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '沈文乐' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2004-10-30' AND '2012-03-27' AND t_kc22.MED_INV_IT...
css
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id numbe...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'papain-urea ointment' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TAB...
SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'MKE' AND city.city_code = airport_service.city_code AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code
atis
CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) -- Using valid SQLite...
SELECT advisor FROM student WHERE stuid = 1004
spider
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 = "ASIAN" AND demographic.age < "48"
mimicsql_data
CREATE TABLE table_60568 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had a finish of t20?
SELECT "Player" FROM table_60568 WHERE "Finish" = 't20'
wikisql
CREATE TABLE table_22555 ( "Nation" text, "Rider" text, "Horse" text, "Cross Country Penalties" text, "Total Penalties" text, "Total Team Penalties" text, "Team Rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many penalties are ther...
SELECT COUNT("Total Penalties") FROM table_22555 WHERE "Rider" = 'Eric Vigeanel'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NA...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_name_51 ( record VARCHAR, finish VARCHAR, year VARCHAR, manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the record when the year is after 1992, manager is tom kotchman and finish is 2nd?
SELECT record FROM table_name_51 WHERE year > 1992 AND manager = "tom kotchman" AND finish = "2nd"
sql_create_context
CREATE TABLE table_28985631_1 ( month_name VARCHAR, numbered_month VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many month names are there for the tenth numbered month?
SELECT COUNT(month_name) FROM table_28985631_1 WHERE numbered_month = "Tenth"
sql_create_context
CREATE TABLE table_59420 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for Nick Faldo?
SELECT "Score" FROM table_59420 WHERE "Player" = 'nick faldo'
wikisql
CREATE TABLE table_33458 ( "Year" real, "Drivers" text, "Wins" real, "Points" text, "D.C." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 2011, how many wins did Michael Meadows have?
SELECT SUM("Wins") FROM table_33458 WHERE "Year" = '2011' AND "Drivers" = 'michael meadows'
wikisql
CREATE TABLE Parts ( part_id INTEGER, part_name VARCHAR(255), chargeable_yn VARCHAR(1), chargeable_amount VARCHAR(20), other_part_details VARCHAR(255) ) CREATE TABLE Engineer_Skills ( engineer_id INTEGER, skill_id INTEGER ) CREATE TABLE Maintenance_Engineers ( engineer_id INTEGER, ...
SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name
nvbench
CREATE TABLE table_name_5 ( run_3 INTEGER, run_1 VARCHAR, run_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the run 3 of the athlete with a run 1 more than 53.75 and a run 2 less than 52.91?
SELECT SUM(run_3) FROM table_name_5 WHERE run_1 > 53.75 AND run_2 < 52.91
sql_create_context
CREATE TABLE table_1566852_8 ( pictorials VARCHAR, cover_model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the pictorals from issues when lindsey roeper was the cover model.
SELECT pictorials FROM table_1566852_8 WHERE cover_model = "Lindsey Roeper"
sql_create_context
CREATE TABLE table_74220 ( "Episode Number" text, "Episode Name" text, "Airdate" text, "Viewers (millions)" text, "Rank(Timeslot)" text, "Rank 18\u201349 (Night)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total rank on airdate m...
SELECT COUNT("Rank(Timeslot)") FROM table_74220 WHERE "Airdate" = 'March 30, 2011'
wikisql
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For d...
SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title GROUP BY title ORDER BY year
nvbench
CREATE TABLE table_name_48 ( second VARCHAR, alternate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the second for the curling team which has alternate Margarita Fomina?
SELECT second FROM table_name_48 WHERE alternate = "margarita fomina"
sql_create_context
CREATE TABLE table_40801 ( "Free" text, "Free polite" text, "Genitive 1" text, "Genitive 2" text, "Genitive 3" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Genitive 1 has a Genitive 3 of *n(i)-ia?
SELECT "Genitive 1" FROM table_40801 WHERE "Genitive 3" = '*n(i)-ia'
wikisql
CREATE TABLE table_1360 ( "N\u00b0" real, "Television service" text, "Country" text, "Language" text, "Content" text, "DAR" text, "HDTV" text, "PPV" text, "Package/Option" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Do the Sky Cal...
SELECT "PPV" FROM table_1360 WHERE "Television service" = 'Sky Calcio 5'
wikisql
CREATE TABLE table_2226817_9 ( directed_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes have the production code 8.04
SELECT COUNT(directed_by) FROM table_2226817_9 WHERE production_code = "8.04"
sql_create_context
CREATE TABLE table_204_718 ( id number, "date" text, "opponent" text, "time" text, "score" text, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what school is scheduled to play first ?
SELECT "opponent" FROM table_204_718 ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_1457 ( "Institution" text, "Location" text, "Nickname" text, "Enrollment" real, "Established" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school location had an enrollment of 12400?
SELECT "Location" FROM table_1457 WHERE "Enrollment" = '12400'
wikisql
CREATE TABLE table_80098 ( "Week" real, "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. -- Who was the opponent when the Seattle Seahawks had a record of ...
SELECT "Opponent" FROM table_80098 WHERE "Record" = '0-1'
wikisql
CREATE TABLE table_train_246 ( "id" int, "allergy_to_dapagliflozin" bool, "allergy_to_exenatide" bool, "estimated_glomerular_filtration_rate_egfr" int, "fasting_c_peptide" float, "urine_albumin_to_creatinine_ratio_uacr" int, "fasting_triglyceride" int, "NOUSE" float ) -- Using valid SQ...
SELECT * FROM table_train_246 WHERE urine_albumin_to_creatinine_ratio_uacr >= 300
criteria2sql
CREATE TABLE table_38717 ( "Date" text, "Opponent" text, "Result" text, "Score" text, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the opponent was Detroit Pistons?
SELECT "Score" FROM table_38717 WHERE "Opponent" = 'detroit pistons'
wikisql
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_las...
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings
nvbench
CREATE TABLE table_name_42 ( player VARCHAR, year_s__won VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Player, when Year(s) Won is before 1961, and when To Par is 6?
SELECT player FROM table_name_42 WHERE year_s__won < 1961 AND to_par = 6
sql_create_context
CREATE TABLE table_name_69 ( time VARCHAR, ground VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Time, when Ground is Waverley Park, and when Away Team is Footscray?
SELECT time FROM table_name_69 WHERE ground = "waverley park" AND away_team = "footscray"
sql_create_context
CREATE TABLE table_75023 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Opponent of @ braves, and a Loss of pelfrey (2 5) had what score?
SELECT "Score" FROM table_75023 WHERE "Opponent" = '@ braves' AND "Loss" = 'pelfrey (2–5)'
wikisql
CREATE TABLE station ( LOCATION VARCHAR, number_of_platforms INTEGER, total_passengers INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all locations and the total number of platforms and passengers for all train stations in each location.
SELECT LOCATION, SUM(number_of_platforms), SUM(total_passengers) FROM station GROUP BY LOCATION
sql_create_context
CREATE TABLE table_36736 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the low silver total associated with under 1 total?
SELECT MIN("Silver") FROM table_36736 WHERE "Total" < '1'
wikisql
CREATE TABLE table_31421 ( "Official name" text, "INE code" real, "Name in Spanish" text, "Name in Basque" text, "Population (2007)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the INE code of the municipality whose official name is Beran...
SELECT MAX("INE code") FROM table_31421 WHERE "Official name" = 'Berantevilla'
wikisql
CREATE TABLE table_42183 ( "Round" real, "Pick" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average round the position of RB was drafted?
SELECT AVG("Round") FROM table_42183 WHERE "Position" = 'rb'
wikisql
CREATE TABLE table_name_8 ( july VARCHAR, february VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is in July where February is linda forsythe?
SELECT july FROM table_name_8 WHERE february = "linda forsythe"
sql_create_context
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 COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.JZKSMC = '新生儿外科' AND zzmzjzjlb.JZKSRQ BETWEEN '2008-02-20' AND '2017-03-13' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZKSMC = '新生儿外科' AND fzzmzjzjlb.JZKSRQ BETWEEN '2008-02-20' AND '2017-03-13'
css
CREATE TABLE table_59960 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue has Scotland as the opposing teams?
SELECT "Venue" FROM table_59960 WHERE "Opposing Teams" = 'scotland'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-58884' AND NOT patient.hospitaldischargetime IS NULL ORDER BY p...
eicu
CREATE TABLE table_57326 ( "Week" real, "Date" text, "Opponent" text, "Home/Away Game" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the away game in week 8?
SELECT "Date" FROM table_57326 WHERE "Home/Away Game" = 'away' AND "Week" = '8'
wikisql
CREATE TABLE table_name_2 ( socialist_ticket VARCHAR, republican_ticket VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the Socialist ticket with a Republican ticket of john a. may?
SELECT socialist_ticket FROM table_name_2 WHERE republican_ticket = "john a. may"
sql_create_context
CREATE TABLE table_name_97 ( capacity INTEGER, location VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest capacity in Aslantepe in 2002-2005?
SELECT MAX(capacity) FROM table_name_97 WHERE location = "aslantepe" AND year = "2002-2005"
sql_create_context
CREATE TABLE table_27715173_6 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many records are there for the game on november 24?
SELECT COUNT(record) FROM table_27715173_6 WHERE date = "November 24"
sql_create_context
CREATE TABLE table_name_33 ( total_deaths VARCHAR, total_casualties VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many deaths were there when the total casualties were 6?
SELECT total_deaths FROM table_name_33 WHERE total_casualties = "6"
sql_create_context
CREATE TABLE table_15187735_10 ( episode VARCHAR, segment_a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of episodes for s fire extinguisher
SELECT COUNT(episode) FROM table_15187735_10 WHERE segment_a = "s Fire Extinguisher"
sql_create_context
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.JCZBJGDL, jyjgzbb.JCZBJGDW 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 ...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.admityear >= "2120"
mimicsql_data
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 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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TI...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE player_award ( year VARCHAR ) CREATE TABLE player ( name_first VARCHAR, name_last VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the players' first name and last name who won award both in 1960 and in 1961.
SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1960 INTERSECT SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1961
sql_create_context
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 T1.Price, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required t...
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 = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI...
atis
CREATE TABLE table_62109 ( "Mission" text, "Resident Country" text, "Local Location" text, "Local Mission" text, "Non-Resident Head of Mission" text, "Local Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Local Location, when Re...
SELECT "Local Location" FROM table_62109 WHERE "Resident Country" = 'belgium' AND "Mission" = 'poland'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
SELECT num.TagName AS Tag, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(DISTINCT OwnerUserId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate < '2014-05-01' AND Posts.CreationDate > '2014-04-01' GROUP BY TagName) AS rat...
sede
CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff time ) CREATE TABLE addresses ( address_id number, line_1_number_building text, ci...
SELECT AVG(price) FROM lessons AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
spider
CREATE TABLE table_61485 ( "Clubs" text, "Seasons at this level" text, "Settlements" text, "Season joined league" text, "Position in 1959\u20131960" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which season did the vora settlements join the lea...
SELECT "Season joined league" FROM table_61485 WHERE "Settlements" = 'évora'
wikisql
CREATE TABLE table_name_9 ( county VARCHAR, area__sq_mi_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which is the total number in the 2010 Census in Oconee County where the area in square miles was less than 674?
SELECT SUM(2010 AS _census_population) FROM table_name_9 WHERE county = "oconee county" AND area__sq_mi_ < 674
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '82923898' AND MED_SER_ORG_NO = '7620449' AND NOT IN_DIAG_DIS_NM LIKE '%震颤麻痹%'
css
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.admission_type = "ELECTIVE" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, ...
SELECT a.Id AS "post_id", a.OwnerDisplayName FROM Posts AS a WHERE a.OwnerUserId IS NULL ORDER BY a.CreationDate
sede
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_...
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_42300 ( "Office" text, "Democratic ticket" text, "Republican ticket" text, "American Labor ticket" text, "Socialist ticket" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the Republican ticket with a Socialist ticket of edna...
SELECT "Republican ticket" FROM table_42300 WHERE "Socialist ticket" = 'edna mitchell blue'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT Id AS "post_link", OwnerUserId AS "user_link", ViewCount FROM Posts WHERE PostTypeId = 1 ORDER BY ViewCount DESC LIMIT 20
sede
CREATE TABLE table_name_63 ( against VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Against has a Date of 30/05/1981?
SELECT COUNT(against) FROM table_name_63 WHERE date = "30/05/1981"
sql_create_context
CREATE TABLE table_name_16 ( year VARCHAR, town VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the structure in greensboro, north carolina considered tallest?
SELECT year FROM table_name_16 WHERE town = "greensboro, north carolina"
sql_create_context
CREATE TABLE table_10477224_1 ( species VARCHAR, sepal_width VARCHAR, sepal_length VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of species with sepal width of 3.4 and sepal length of 5.4
SELECT COUNT(species) FROM table_10477224_1 WHERE sepal_width = "3.4" AND sepal_length = "5.4"
sql_create_context
CREATE TABLE table_name_16 ( format VARCHAR, region VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Format of the release in Greece?
SELECT format FROM table_name_16 WHERE region = "greece"
sql_create_context
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '郑乐山' AND gwyjzb.MED_SER_ORG_NO = '6652553' AND gwyjzb.IN_HOSP_DATE BETWEEN '2011-02-09' AND '2012-12-03' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHER...
css
CREATE TABLE table_43905 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Crowd" real, "Box Score" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game where the adel...
SELECT "Score" FROM table_43905 WHERE "Home team" = 'adelaide 36ers'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.icd9_code = "42833"
mimicsql_data
CREATE TABLE table_39047 ( "Unit" text, "Russian" text, "Translation" text, "Ratio" text, "Cubic inches (exact)" text, "Metric value" text, "Imperial" text, "US Customary" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Russia...
SELECT "Russian" FROM table_39047 WHERE "US Customary" = '4.16 fl. oz.'
wikisql
CREATE TABLE table_203_234 ( id number, "description" text, "total" number, "poland" number, "baltic states(resettled in poland during war)" number, "resettled in poland during war(from ussr and romania)" number, "sudetendeutsch" number, "se europe\n(hungary, romania, yugoslavia & slovak...
SELECT (SELECT "poland" FROM table_203_234 WHERE "description" = 'suicides') - (SELECT "sudetendeutsch" FROM table_203_234 WHERE "description" = 'suicides')
squall
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 USE_FRE, EACH_DOSAGE FROM t_kc22 WHERE MED_CLINIC_ID = '37357466652' AND SOC_SRT_DIRE_NM = '盐酸托莫西汀胶囊'
css
CREATE TABLE table_name_16 ( opponent VARCHAR, round VARCHAR, rules VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a Round of 4, and a Rules of thai boxing?
SELECT opponent FROM table_name_16 WHERE round = "4" AND rules = "thai boxing"
sql_create_context
CREATE TABLE table_203_598 ( id number, "date" text, "time" text, "opponent" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games had attendance of over 50,000 ?
SELECT COUNT(*) FROM table_203_598 WHERE "attendance" > 50000
squall
CREATE TABLE table_name_57 ( status VARCHAR, floors VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status of the building with more than 28 floor and a year of 2013?
SELECT status FROM table_name_57 WHERE floors > 28 AND year = 2013
sql_create_context
CREATE TABLE table_18132 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the candidates in the district first elected in 1998 whose inc...
SELECT "Candidates" FROM table_18132 WHERE "First elected" = '1998' AND "Incumbent" = 'Paul Ryan'
wikisql
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, ...
SELECT name, distance FROM aircraft
nvbench
CREATE TABLE table_33035 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game did Jets have an attendance of 78,722?
SELECT "Game site" FROM table_33035 WHERE "Attendance" = '78,722'
wikisql
CREATE TABLE table_63052 ( "Rank" real, "Lane" real, "Athlete" text, "Country" text, "Time" real, "React" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest react of the athlete from the United States who has a lane less than 4?
SELECT MIN("React") FROM table_63052 WHERE "Country" = 'united states' AND "Lane" < '4'
wikisql
CREATE TABLE diagnoses ( 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear < "2190"
mimicsql_data
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC
nvbench
CREATE TABLE table_37463 ( "Week" real, "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. -- What is the attendance that has fedex field as the game site wi...
SELECT "Attendance" FROM table_37463 WHERE "Game site" = 'fedex field' AND "Week" = '3'
wikisql
CREATE TABLE table_name_96 ( rowers VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the rowers with the time of 5:54.57?
SELECT rowers FROM table_name_96 WHERE time = "5:54.57"
sql_create_context
CREATE TABLE table_name_53 ( album_title VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Album title has a Title of ?
SELECT album_title FROM table_name_53 WHERE title = "滑板"
sql_create_context
CREATE TABLE table_name_95 ( wins VARCHAR, division VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Western Division of Wins with a 4th Finish?
SELECT wins FROM table_name_95 WHERE division = "western" AND finish = "4th"
sql_create_context
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Chronic kidney disease, Stage IV (severe)" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_78420 ( "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 was the highest crowd in Victoria Park?
SELECT MAX("Crowd") FROM table_78420 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE table_20801 ( "Institution" text, "Location" text, "Nickname" text, "Enrollment" real, "Established" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Nickname of the school established in 1773
SELECT "Nickname" FROM table_20801 WHERE "Established" = '1773'
wikisql
CREATE TABLE table_name_11 ( dialcode VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Dialcode has a location of Edmonton?
SELECT dialcode FROM table_name_11 WHERE location = "edmonton"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-54278') AND NOT patient.admissionheight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2103-02' ORDER BY patient.unitadmittime DESC LIMIT...
eicu