instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_204_945 ( id number, "episode" number, "name" text, "synopsis" text, "sent home" text, "highest seller" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the last person to be sent home ?
SELECT "sent home" FROM table_204_945 ORDER BY "episode" DESC LIMIT 1
squall
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Kathleen Wisser%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o...
advising
CREATE TABLE table_13103 ( "Result" text, "Opponent" text, "Type" text, "Rd., Time" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did Tony Oakey win against when he had type of w pts 12?
SELECT "Opponent" FROM table_13103 WHERE "Result" = 'win' AND "Type" = 'w pts 12'
wikisql
CREATE TABLE table_name_21 ( to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Bert Yancey's finishing score to par?
SELECT to_par FROM table_name_21 WHERE player = "bert yancey"
sql_create_context
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 bdmzjzjlb ( HXPLC number, HZX...
SELECT COUNT(wdmzjzjlb.ZZYSGH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '23946092' AND wdmzjzjlb.JZKSRQ BETWEEN '2002-09-18' AND '2018-10-31' UNION SELECT COUNT(bdmzjzjlb.ZZYSGH) FROM hz_info JOIN bdmzjzjlb ON hz_...
css
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Critical illness myopthy" AND prescriptions.route = "ID"
mimicsql_data
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 SHRGH, SHRXM FROM jybgb WHERE BGDH = '97022779675'
css
CREATE TABLE table_name_49 ( qual_2 VARCHAR, qual_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the qual 2 when the qual 1 is 1:16.841?
SELECT qual_2 FROM table_name_49 WHERE qual_1 = "1:16.841"
sql_create_context
CREATE TABLE table_58877 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what round did someone from North Carolina State get picked larger than 91?
SELECT COUNT("Round") FROM table_58877 WHERE "School/Club Team" = 'north carolina state' AND "Pick" > '91'
wikisql
CREATE TABLE table_26402 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people directed 'through the loo...
SELECT COUNT("Directed by") FROM table_26402 WHERE "Title" = 'Through The Looking Glass'
wikisql
CREATE TABLE table_1342426_18 ( incumbent VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the incumbent in the election of henry garland dupr (d) unopposed?
SELECT incumbent FROM table_1342426_18 WHERE candidates = "Henry Garland Dupré (D) Unopposed"
sql_create_context
CREATE TABLE table_16409745_1 ( dpi VARCHAR, dimensions__mm_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the dpi of a scanner with the mm dimensions 280 x 95 x 40?
SELECT dpi FROM table_16409745_1 WHERE dimensions__mm_ = "280 x 95 x 40"
sql_create_context
CREATE TABLE table_name_97 ( java_ee_compatibility VARCHAR, edition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Java EE compatibility of the 5.2.4 edition?
SELECT java_ee_compatibility FROM table_name_97 WHERE edition = "5.2.4"
sql_create_context
CREATE TABLE tourist_attractions ( tourist_attraction_id number, attraction_type_code text, location_id number, how_to_get_there text, name text, description text, opening_hours text, other_details text ) CREATE TABLE tourist_attraction_features ( tourist_attraction_id number, f...
SELECT name FROM tourist_attractions WHERE how_to_get_there = "bus"
spider
CREATE TABLE table_27961684_1 ( institution VARCHAR, team_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many institutes have the team name Spartans?
SELECT COUNT(institution) FROM table_27961684_1 WHERE team_name = "Spartans"
sql_create_context
CREATE TABLE table_15347 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Sydney has a Perth of no, an Adelaide of yes, and a Gold Coast of no?
SELECT "Sydney" FROM table_15347 WHERE "Perth" = 'no' AND "Adelaide" = 'yes' AND "Gold Coast" = 'no'
wikisql
CREATE TABLE table_14302582_1 ( result VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result when the team was 4-1?
SELECT result FROM table_14302582_1 WHERE record = "4-1"
sql_create_context
CREATE TABLE airport_aircraft ( id number, airport_id number, aircraft_id number ) CREATE TABLE pilot ( pilot_id number, name text, age number ) CREATE TABLE match ( round number, location text, country text, date text, fastest_qualifying text, winning_pilot text, w...
SELECT T1.aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.aircraft_id = T2.aircraft_id JOIN airport AS T3 ON T2.airport_id = T3.airport_id WHERE T3.airport_name = "London Gatwick"
spider
CREATE TABLE table_24486462_1 ( disposable_usd_growth INTEGER, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Australia's Disposable USD growth?
SELECT MAX(disposable_usd_growth) FROM table_24486462_1 WHERE country = "Australia"
sql_create_context
CREATE TABLE table_77776 ( "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. -- When the away team scored 7.11 (53) what venue d...
SELECT "Venue" FROM table_77776 WHERE "Away team score" = '7.11 (53)'
wikisql
CREATE TABLE table_7694 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest attendance for the game after week 1 against the New York Jets?
SELECT MAX("Attendance") FROM table_7694 WHERE "Week" > '1' AND "Opponent" = 'new york jets'
wikisql
CREATE TABLE table_17123 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many have been replaced where the a...
SELECT COUNT("Replaced by") FROM table_17123 WHERE "Date of appointment" = '10 December 2007' AND "Manner of departure" = 'Quit'
wikisql
CREATE TABLE table_name_16 ( young_rider_classification VARCHAR, general_classification VARCHAR, stage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the young rider classification for giuseppe saronni at stage 6
SELECT young_rider_classification FROM table_name_16 WHERE general_classification = "giuseppe saronni" AND stage = "6"
sql_create_context
CREATE TABLE table_17060277_6 ( date VARCHAR, high_assists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date did Chris Duhon (13) receive high assists?
SELECT date FROM table_17060277_6 WHERE high_assists = "Chris Duhon (13)"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC te...
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '2301260' AND mzjzjlb.JZKSRQ BETWEEN '2007-01-04' AND '2020-10-03' AND mzjzjlb.ZSEBZ > 0
css
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is minimum age for dif...
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job DESC
nvbench
CREATE TABLE table_22473 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Ho...
SELECT COUNT("ANSI code") FROM table_22473 WHERE "Latitude" = '48.247662'
wikisql
CREATE TABLE table_66935 ( "Stage" text, "Time (EEST)" text, "Name" text, "Length" text, "Winner" text, "Time" text, "Avg. spd." text, "Rally leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Name, when the Time is 8:10....
SELECT "Name" FROM table_66935 WHERE "Time" = '8:10.1'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT COUNT(*) > 0 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 = 10855)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [dias...
mimic_iii
CREATE TABLE table_11624 ( "Year" real, "Athlete" text, "Country/State" text, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At what location was the time 1:54:21?
SELECT "Location" FROM table_11624 WHERE "Time" = '1:54:21'
wikisql
CREATE TABLE table_14425454_1 ( ground VARCHAR, crowd VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What stadiums had an attendance of 8,256?
SELECT ground FROM table_14425454_1 WHERE crowd = "8,256"
sql_create_context
CREATE TABLE table_15187735_15 ( segment_d VARCHAR, episode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was segment D for episode 183?
SELECT segment_d FROM table_15187735_15 WHERE episode = 183
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 COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.IN_DIAG_DIS_NM = '白细胞异常'
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE STRFTIME('%y', labevents.charttime) >= '2104' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 5)
mimic_iii
CREATE TABLE table_42983 ( "Year" text, "GP/GS" text, "Goals" text, "Assists" text, "Total Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many assists were there when the total points was 2?
SELECT "Assists" FROM table_42983 WHERE "Total Points" = '2'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id numbe...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'epithelial cells'))
mimic_iii
CREATE TABLE table_79120 ( "Club" text, "City" text, "Stadium" text, "2007\u201308 result" text, "Capacity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What stadium has 9th in 2.hnl as the 2007-08 result?
SELECT "Stadium" FROM table_79120 WHERE "2007\u201308 result" = '9th in 2.hnl'
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 DE...
SELECT AVG(STU_GPA), MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE
nvbench
CREATE TABLE stadium ( id number, name text, capacity number, city text, country text, opening_year number ) CREATE TABLE event ( id number, name text, stadium_id number, year text ) CREATE TABLE record ( id number, result text, swimmer_id number, event_id numbe...
SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE result = 'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE result = 'Loss'
spider
CREATE TABLE table_69029 ( "Riding" text, "Candidate's Name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" real, "Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Occupation has a Rank of 5th, a Gender of M, wit...
SELECT "Occupation" FROM table_69029 WHERE "Rank" = '5th' AND "Gender" = 'm' AND "Residence" = 'orono'
wikisql
CREATE TABLE table_name_79 ( type VARCHAR, quantity VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which type has 140 made?
SELECT type FROM table_name_79 WHERE quantity = "140"
sql_create_context
CREATE TABLE table_28232 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "U.S. viewers (million)" FROM table_28232 WHERE "Directed by" = 'Dan Lerner'
wikisql
CREATE TABLE table_41270 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the rider with a grid of 36?
SELECT "Rider" FROM table_41270 WHERE "Grid" = '36'
wikisql
CREATE TABLE discount_coupons ( coupon_id number, date_issued time, coupon_amount number ) CREATE TABLE view_product_availability ( product_id number, booking_id number, status_date time, available_yn text ) CREATE TABLE payments ( payment_id number, booking_id number, customer...
SELECT product_id FROM products_booked GROUP BY product_id HAVING COUNT(*) = 3
spider
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE days ( d...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 25 AND date_day.month_number = 6 A...
atis
CREATE TABLE table_28211988_1 ( womens_singles VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people are women's singles in the season of 2000/01?
SELECT COUNT(womens_singles) FROM table_28211988_1 WHERE season = "2000/01"
sql_create_context
CREATE TABLE member ( member_id number, member_name text, party_id text, in_office text ) CREATE TABLE party_events ( event_id number, event_name text, party_id number, member_in_charge_id number ) CREATE TABLE party ( party_id number, minister text, took_office text, l...
SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_6 ( place INTEGER, artist VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest place of a song by Henri D s that has fewer than 8 points?
SELECT MAX(place) FROM table_name_6 WHERE artist = "henri dès" AND points < 8
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "74" AND prescriptions.formulary_drug_cd = "NEUT"
mimicsql_data
CREATE TABLE table_19426 ( "State/UT Code" real, "India/State/UT" text, "Literate Persons (%)" text, "Males (%)" text, "Females (%)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage of all the literate people where females are 7...
SELECT "Literate Persons (%)" FROM table_19426 WHERE "Females (%)" = '73.17'
wikisql
CREATE TABLE table_66651 ( "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. -- Which county did the player with a total of 294 represent?
SELECT "Country" FROM table_66651 WHERE "Total" = '294'
wikisql
CREATE TABLE table_73569 ( "Rank by average" real, "Place" real, "Couple" text, "Number Of Dances" real, "Total Points Earned" real, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the name of the couple if the number of dances...
SELECT "Couple" FROM table_73569 WHERE "Number Of Dances" = '6'
wikisql
CREATE TABLE table_52234 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which competition took place at Stade Fernand Fournier, Arles?
SELECT "Competition" FROM table_52234 WHERE "Venue" = 'stade fernand fournier, arles'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId n...
SELECT v.UserId, vt.Name, COUNT(*) FROM Posts AS p INNER JOIN Votes AS v ON v.PostId = p.Id INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id WHERE p.OwnerUserId = 154486 GROUP BY vt.Name, v.UserId
sede
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, ...
SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se...
advising
CREATE TABLE table_13110459_2 ( rating VARCHAR, viewers__m_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are all the rating with viewers (m) being 2.61
SELECT rating FROM table_13110459_2 WHERE viewers__m_ = "2.61"
sql_create_context
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text ) -- Using valid SQLite, answer the following questions fo...
SELECT Snatch, Total FROM body_builder
nvbench
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
SELECT DEPARTMENT_NAME, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY DEPARTMENT_NAME ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_13015539_1 ( points VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total points for the tean with 8 losses?
SELECT COUNT(points) FROM table_13015539_1 WHERE lost = 8
sql_create_context
CREATE TABLE table_203_237 ( id number, "n" number, "p" text, "nat." text, "name" text, "age" number, "moving from" text, "type" text, "transfer\nwindow" text, "ends" number, "transfer\nfee" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT COUNT("name") FROM table_203_237 WHERE "n" = 'free'
squall
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "BLACK/AFRICAN AMERICAN"
mimicsql_data
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzj...
css
CREATE TABLE table_10566855_1 ( attendance INTEGER, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the minimum attendance with score 8.16 (64) 8.12 (60)
SELECT MIN(attendance) FROM table_10566855_1 WHERE score = "8.16 (64) – 8.12 (60)"
sql_create_context
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (((flight.departure_time = 1628 AND flight.flight_number = 269) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight....
atis
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 jyjgzbb ( BGDH text, BGRQ tim...
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 bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3),...
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY acc_bal
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Primary pulmonary hypertension" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_22417 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text, "Language/Rebroadcast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When fm 97.3 is the frequency how many formats are there?
SELECT COUNT("Format") FROM table_22417 WHERE "Frequency" = 'FM 97.3'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( i...
SELECT SUM(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 = '005-18714')) AND intakeoutput.celllabel = 'enter...
eicu
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH...
css
CREATE TABLE table_63850 ( "Airline" text, "IATA" text, "ICAO" text, "Callsign" text, "Commenced operations" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Commenced operations have an Airline of valuair?
SELECT "Commenced operations" FROM table_63850 WHERE "Airline" = 'valuair'
wikisql
CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes int, year int, month varchar ) CREATE TABLE user ( uid int, user_id varchar, name varchar ) CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address...
SELECT review.text FROM review, user WHERE user.name = 'Niloofar' AND user.user_id = review.user_id
yelp
CREATE TABLE gyb ( CLINIC_ID 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, INSU_TYPE text, IN...
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '80809375' AND qtb.MED_SER_ORG_NO = '4405816' AND qtb.OUT_DIAG_DOC_NM LIKE '施%' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '80809375' AND gyb.MED_SER_ORG_NO = '4405816' AND gyb.OUT_DIAG_DOC_NM LIKE '...
css
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additio...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Selena Smith%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offe...
advising
CREATE TABLE dorm ( dorm_name VARCHAR, student_capacity VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of the dorm with the largest capacity.
SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_95 ( theme VARCHAR, issue_price VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Theme of the coin with an Issue Price of $89.95?
SELECT theme FROM table_name_95 WHERE issue_price = "$89.95"
sql_create_context
CREATE TABLE table_name_55 ( decile VARCHAR, authority VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the decile for Westminster Christian School with a state integrated authority?
SELECT decile FROM table_name_55 WHERE authority = "state integrated" AND name = "westminster christian school"
sql_create_context
CREATE TABLE table_72670 ( "Position" real, "Team" text, "Points" real, "Played" real, "Won" real, "Drawn" real, "Lost" real, "For" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the points...
SELECT "Points" FROM table_72670 WHERE "Team" = 'Paulistano'
wikisql
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed (...
SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_39 ( total INTEGER, league_cup INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the League Cup smaller than 0?
SELECT SUM(total) FROM table_name_39 WHERE league_cup < 0
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.age < "85"
mimicsql_data
CREATE TABLE table_name_79 ( matches INTEGER, name VARCHAR, seasons VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of matches of leonardo in seasons after 1?
SELECT AVG(matches) FROM table_name_79 WHERE name = "leonardo" AND seasons > 1
sql_create_context
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), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY AVG(SALARY)
nvbench
CREATE TABLE volume ( volume_id number, volume_issue text, issue_date text, weeks_on_top number, song text, artist_id number ) CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE a...
SELECT date_of_ceremony FROM music_festival WHERE category = "Best Song" AND result = "Awarded"
spider
CREATE TABLE table_56778 ( "County" text, "Name" text, "Length (miles)" real, "West or south terminus" text, "East or north terminus" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the length (miles) when the east or north terminus is ne 2 i...
SELECT COUNT("Length (miles)") FROM table_56778 WHERE "East or north terminus" = 'ne 2 in lincoln'
wikisql
CREATE TABLE table_23346303_3 ( opponent VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of opponents where the location is syracuse, ny?
SELECT COUNT(opponent) FROM table_23346303_3 WHERE location = "Syracuse, NY"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, ...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-58787')) AND vitalperiodic.respiration < 29.0 A...
eicu
CREATE TABLE table_name_93 ( top_5 INTEGER, top_10 VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the best top-5 when top-10 is 1 and there are more than 0 wins?
SELECT MAX(top_5) FROM table_name_93 WHERE top_10 = 1 AND wins > 0
sql_create_context
CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Descri...
SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code
nvbench
CREATE TABLE table_76742 ( "Location" text, "Country" text, "Type" text, "Wheels" real, "Configuration" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What average wheels has accounting as the type, with IBM Collection as the location?
SELECT AVG("Wheels") FROM table_76742 WHERE "Type" = 'accounting' AND "Location" = 'ibm collection'
wikisql
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_name_32 ( school VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which school did player Rodney Purvis belong to?
SELECT school FROM table_name_32 WHERE player = "rodney purvis"
sql_create_context
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones"
nvbench
CREATE TABLE table_47326 ( "Year" text, "Rebs" real, "Asts" real, "Stls" real, "Blks" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Blks, when Stls is 1, and when Rebs is greater than 8.6?
SELECT SUM("Blks") FROM table_47326 WHERE "Stls" = '1' AND "Rebs" > '8.6'
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 jyjgzbb.YQBH, jyjgzbb.YQMC 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.BG...
css
CREATE TABLE table_23235767_4 ( year VARCHAR, opponent_in_the_final VARCHAR, surface VARCHAR, championship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the year for clay for boston and guillermo vilas
SELECT year FROM table_23235767_4 WHERE surface = "Clay" AND championship = "Boston" AND opponent_in_the_final = "Guillermo Vilas"
sql_create_context
CREATE TABLE table_name_19 ( week INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest week that has November 30, 2003 as the date?
SELECT MIN(week) FROM table_name_19 WHERE date = "november 30, 2003"
sql_create_context
CREATE TABLE table_34378 ( "Place" real, "Nation" text, "6 Ropes" real, "4 Hoops, 2 Clubs" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of the nation with 19.025 4 hoops, 2 clubs?
SELECT "Total" FROM table_34378 WHERE "4 Hoops, 2 Clubs" = '19.025'
wikisql
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 mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND ...
css