instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_54 ( season VARCHAR, champion VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what season did the juventus win
SELECT season FROM table_name_54 WHERE champion = "juventus"
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 SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '华婉容' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2003-05-06' AND '2013-09-20' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
css
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Na...
SELECT Votes.PostId, Votes.VoteTypeId, Votes.CreationDate, VoteTypes.Name FROM Votes, VoteTypes WHERE Votes.VoteTypeId = VoteTypes.Id LIMIT 20
sede
CREATE TABLE table_43443 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which has a Score of 6 1, 3 0 ret.?
SELECT "Surface" FROM table_43443 WHERE "Score" = '6–1, 3–0 ret.'
wikisql
CREATE TABLE table_11535 ( "Player" text, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Adam Keefe's nationality?
SELECT "Nationality" FROM table_11535 WHERE "Player" = 'adam keefe'
wikisql
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 Body_Builder_ID, People_ID FROM body_builder
nvbench
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc21.MAIN_COND_DES FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '56971731612'
css
CREATE TABLE table_58380 ( "Season" text, "Winners" text, "Score" text, "Runners-up" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Season had Dundee United as a Winner?
SELECT "Season" FROM table_58380 WHERE "Winners" = 'dundee united'
wikisql
CREATE TABLE table_name_14 ( venue VARCHAR, against VARCHAR, opposing_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Venue, when Against is less than 30, and when Opposing Team is New South Wales?
SELECT venue FROM table_name_14 WHERE against < 30 AND opposing_team = "new south wales"
sql_create_context
CREATE TABLE table_name_35 ( position VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Senyi N'Diaye's Position?
SELECT position FROM table_name_35 WHERE name = "senyi n'diaye"
sql_create_context
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time,...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'rt/left heart card cath') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95968) AND DATETIME(procedu...
mimic_iii
CREATE TABLE table_39802 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of Manufacturer has a Laps smaller than 20 and a Grid of 21
SELECT "Manufacturer" FROM table_39802 WHERE "Laps" < '20' AND "Grid" = '21'
wikisql
CREATE TABLE driver ( home_city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the home city with the most number of drivers.
SELECT home_city FROM driver GROUP BY home_city ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_86 ( rank___number_ VARCHAR, air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank for the show aired on May 19, 2009?
SELECT rank___number_ FROM table_name_86 WHERE air_date = "may 19, 2009"
sql_create_context
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGD...
(SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND j...
css
CREATE TABLE table_2879 ( "#" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production Code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode titled '...
SELECT "Director" FROM table_2879 WHERE "Title" = 'Risky Business'
wikisql
CREATE TABLE table_name_88 ( channel_tv___dt__ VARCHAR, city_of_license__market VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Channel TV is located in Baltimore?
SELECT channel_tv___dt__ FROM table_name_88 WHERE city_of_license__market = "baltimore"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT JZLX FROM jybgb WHERE BGDH = '14292593271'
css
CREATE TABLE table_3464 ( "Player" text, "Number Of Selections" real, "First Team" real, "Second Team" real, "Season MVP" real, "Final Four MVP" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who are all the players when season mvp is less than ...
SELECT "Player" FROM table_3464 WHERE "Season MVP" < '1.0' AND "Second Team" < '1.0'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergy...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-57924')) AND medication.drugname IN ('fentanyl citrate (pf) 50 mcg/ml ...
eicu
CREATE TABLE table_name_38 ( score VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score when parkgate is at home?
SELECT score FROM table_name_38 WHERE home_team = "parkgate"
sql_create_context
CREATE TABLE table_name_46 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is 2010 when 2011 is 2r and 2008 is 2r?
SELECT 2010 FROM table_name_46 WHERE 2011 = "2r" AND 2008 = "2r"
sql_create_context
CREATE TABLE table_204_496 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who finished directly after t...
SELECT "driver" FROM table_204_496 WHERE "pos" = (SELECT "pos" FROM table_204_496 WHERE "time/retired" = '+1:28.745') + 1
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 SUM(MED_AMOUT) FROM t_kc21 WHERE PERSON_ID = '36015603' AND CLINIC_TYPE = '门诊'
css
CREATE TABLE table_18949 ( "Trim" text, "Engine" text, "Displacement" text, "Power" text, "Torque" text, "Transmission" text, "Fuel Mileage (latest EPA mpg - US )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the torque with trim be...
SELECT "Torque" FROM table_18949 WHERE "Trim" = 'XE (2009)'
wikisql
CREATE TABLE zyb ( 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 AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_ORG_DEPT_NM = '18989' AND zyb.IN_HOSP_DAYS BETWEEN '2002-02-10' AND '2002-02-22' AND zyb.IN_HOSP_DATE = '后循环缺血'
css
CREATE TABLE table_38529 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result in 1995?
SELECT "Result" FROM table_38529 WHERE "Year" = '1995'
wikisql
CREATE TABLE table_44191 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text, "React" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the react when the country is sweden and the lane is higher than 6?
SELECT SUM("React") FROM table_44191 WHERE "Country" = 'sweden' AND "Lane" > '6'
wikisql
CREATE TABLE table_name_21 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Result on September 24?
SELECT result FROM table_name_21 WHERE date = "september 24"
sql_create_context
CREATE TABLE table_8837 ( "Model Number" text, "Frequency" text, "L2-Cache" text, "Front Side Bus" text, "Multiplier" text, "Voltage" text, "Socket" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Frequency has a Socket of socket 370, a...
SELECT "Frequency" FROM table_8837 WHERE "Socket" = 'socket 370' AND "Model Number" = 'c3 1.4a'
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 AVG(ROUND(Reputation, -1)) AS UserReputation, SUM(CASE WHEN ClosedDate IS NULL THEN 1 ELSE 0 END) / CAST(COUNT(Posts.Id) AS FLOAT) AS "PercentOpen" FROM Posts INNER JOIN Users ON (Users.Id = Posts.OwnerUserId) WHERE PostTypeId = 1 AND Reputation < 1000 GROUP BY ROUND(Reputation, -1) ORDER BY UserReputation
sede
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 'site://posts/comments/' + CAST(C.Id AS TEXT) + '|' + RIGHT(C.Text, LENGTH(C.Text) - 46), 'site://posts/comments/' + CAST(C.Id AS TEXT) + '|' + CAST(C.Score AS TEXT) AS "score", C.UserId AS "user_link", C.CreationDate AS "date" FROM Comments AS C WHERE C.Text LIKE 'This question appears to be off-topic because %...
sede
CREATE TABLE table_23286158_11 ( series VARCHAR, high_rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What series had high rebounds with Marcus Camby (11)?
SELECT series FROM table_23286158_11 WHERE high_rebounds = "Marcus Camby (11)"
sql_create_context
CREATE TABLE table_24725951_1 ( directed_and_produced_by VARCHAR, celebrities VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the director and producer when Nick Hewer and Saira Khan were starring.
SELECT directed_and_produced_by FROM table_24725951_1 WHERE celebrities = "Nick Hewer and Saira Khan"
sql_create_context
CREATE TABLE table_41047 ( "Place" real, "Rider" text, "Country" text, "Machine" text, "Speed" text, "Time" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when Time is 1:29.43.60?
SELECT "Country" FROM table_41047 WHERE "Time" = '1:29.43.60'
wikisql
CREATE TABLE table_5991 ( "Player" text, "Team" text, "Date" text, "Opponent" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player was on the Los Angeles Dodgers?
SELECT "Player" FROM table_5991 WHERE "Team" = 'los angeles dodgers'
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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG...
css
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'bethel island' AND location.street_name = 'bethel island rd' AND restaurant.id = location.restaurant_id
restaurants
CREATE TABLE table_873 ( "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 many...
SELECT COUNT("High assists") FROM table_873 WHERE "Record" = '15-11'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '52346319' AND t_kc22.STA_DATE BETWEEN '2002-05-20' AND '2002-10-06' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_...
css
CREATE TABLE table_15318324_1 ( r_z___arcsecond__ VARCHAR, r_y___arcsecond__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many values of r z (arcsecond) correspond with a r y (arcsecond) value of 0.247?
SELECT r_z___arcsecond__ FROM table_15318324_1 WHERE r_y___arcsecond__ = "−0.247"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Road, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE table_name_54 ( player VARCHAR, place VARCHAR, country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player has a Place of t10, a Country of united states, and a Score of 67-73=140?
SELECT player FROM table_name_54 WHERE place = "t10" AND country = "united states" AND score = 67 - 73 = 140
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'bilat bb block nec') AND STRFTIME('%y', diagnoses_icd.charttime) = '2105' GROUP BY STRFTIME('%y-%m-%d'...
mimic_iii
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC
nvbench
CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_day text ) CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owne...
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner
nvbench
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, 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.short_title = "Incision of aorta"
mimicsql_data
CREATE TABLE table_18025 ( "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. -- On what date did the game end with the result w 43-14?
SELECT "Date" FROM table_18025 WHERE "Result" = 'W 43-14'
wikisql
CREATE TABLE table_75498 ( "Administrative Panel" real, "Agricultural Panel" real, "Cultural and Educational Panel" real, "Industrial and Commercial Panel" real, "Labour Panel" real, "National University of Ireland" real, "Nominated by the Taoiseach" real, "Total" real ) -- Using valid...
SELECT AVG("Administrative Panel") FROM table_75498 WHERE "Nominated by the Taoiseach" = '0' AND "Total" < '4'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_35306 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Margin of victory of 4 strokes?
SELECT "Date" FROM table_35306 WHERE "Margin of victory" = '4 strokes'
wikisql
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Coun...
SELECT meter_700, ID FROM swimmer ORDER BY ID DESC
nvbench
CREATE TABLE table_55463 ( "Year" real, "Player" text, "Position" text, "College/Country" text, "WNBA Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Sue Bird's position?
SELECT "Position" FROM table_55463 WHERE "Player" = 'sue bird'
wikisql
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 ) CREATE TABLE allergy_type ( allergy text, allergytype text ) -- Using valid SQLite...
SELECT DISTINCT allergytype FROM allergy_type
spider
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, Exp...
SELECT COUNT(AboutMe) FROM Users WHERE NOT AboutMe LIKE ''
sede
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, t...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester...
advising
CREATE TABLE table_name_84 ( competition VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition was played at Shay Stadium?
SELECT competition FROM table_name_84 WHERE venue = "shay stadium"
sql_create_context
CREATE TABLE table_17695 ( "Year" real, "Winner" text, "Winning Hand" text, "Prize Money" text, "Entrants" real, "Runner-Up" text, "Losing Hand" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the losing hand where the winning hand w...
SELECT "Losing Hand" FROM table_17695 WHERE "Winning Hand" = '7h 7s'
wikisql
CREATE TABLE table_39798 ( "Name" text, "Status" text, "Authors" text, "Unit" text, "Location" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What unit is in Mongolia?
SELECT "Unit" FROM table_39798 WHERE "Location" = 'mongolia'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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, h...
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17944) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'osmolality, urine') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_T...
mimic_iii
CREATE TABLE table_10015132_9 ( position VARCHAR, years_in_toronto VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the total number of positions on the Toronto team in 2006-07?
SELECT COUNT(position) FROM table_10015132_9 WHERE years_in_toronto = "2006-07"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.days_stay = "27"
mimicsql_data
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '84482100' AND MED_SER_ORG_NO = '1754718' AND NOT OUT_DIAG_DIS_NM LIKE '%其他%'
css
CREATE TABLE table_203_8 ( id number, "player" text, "rec." number, "yards" number, "avg." number, "td's" number, "long" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which player got the most yards ?
SELECT "player" FROM table_203_8 ORDER BY "yards" DESC LIMIT 1
squall
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id n...
SELECT AVG(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1272 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND...
mimic_iii
CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district text, nces_id text, yr_data number, t_fed_rev number, c14 number, c25 number ) CREATE TABLE ndecoreexcel_math_grade8 ( year number, state text, all_students text, average_scale_score number ...
SELECT COUNT(*) FROM finrev_fed_17 WHERE c25 > c14
studentmathscore
CREATE TABLE Procedures ( Code INTEGER, Name VARCHAR(30), Cost REAL ) CREATE TABLE Patient ( SSN INTEGER, Name VARCHAR(30), Address VARCHAR(30), Phone VARCHAR(30), InsuranceID INTEGER, PCP INTEGER ) CREATE TABLE Prescribes ( Physician INTEGER, Patient INTEGER, Medicatio...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY Name
nvbench
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.USE_FRE, t_kc22.EACH_DOSAGE 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 = '75939834860' AND t_kc22.SOC_SRT_DIRE_CD = '124130483-r'
css
CREATE TABLE table_58788 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Raiders points" real, "Opponents" real, "Raiders first downs" real, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What...
SELECT COUNT("Opponents") FROM table_58788 WHERE "Raiders points" = '42' AND "Attendance" < '52,505'
wikisql
CREATE TABLE table_train_71 ( "id" int, "gender" string, "language" string, "intention_to_arterial_catheter" bool, "renal_disease" bool, "sepsis" bool, "allergy_to_hydroxyethyl_starch" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the ...
SELECT * FROM table_train_71 WHERE renal_disease = 1
criteria2sql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal bool...
SELECT Id AS "post_link", Title, Score FROM Posts WHERE OwnerUserId = '##id?210401##' AND PostTypeId = 1 ORDER BY Id
sede
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_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '谢晴雪' AND gwyjzb.MED_SER_ORG_NO = '1203816' AND gwyjzb.OUT_DIAG_DIS_NM LIKE '%性%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '谢晴雪' AND fgwyjzb.MED_SER_ORG_NO = '1203816' AND fgwyjzb.OUT_DIAG_DIS_NM LIKE '%性%'
css
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-140729')) AND STRFTIME('%y', treatment.treatmenttime) = '2105...
eicu
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, e...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 GROUP BY date ORDER BY date DESC
nvbench
CREATE TABLE table_name_97 ( version VARCHAR, standard_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the version of Itu g.992.3 Annex J?
SELECT version FROM table_name_97 WHERE standard_name = "itu g.992.3 annex j"
sql_create_context
CREATE TABLE Sportsinfo ( sportname VARCHAR, onscholarship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which sport has most number of students on scholarship?
SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_18305523_2 ( cover_date VARCHAR, story_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many cover dates does the story 'Devastation Derby! (part 1)' have?
SELECT COUNT(cover_date) FROM table_18305523_2 WHERE story_title = "DEVASTATION DERBY! (Part 1)"
sql_create_context
CREATE TABLE table_name_26 ( date VARCHAR, decision VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game with a decision of Niittymaki and when the Flyers had a record of 30 21 5?
SELECT date FROM table_name_26 WHERE decision = "niittymaki" AND record = "30–21–5"
sql_create_context
CREATE TABLE table_21580 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the bush% for where others # is 90
SELECT "Bush%" FROM table_21580 WHERE "Others#" = '90'
wikisql
CREATE TABLE status ( statusId INTEGER, status TEXT ) CREATE TABLE lapTimes ( raceId INTEGER, driverId INTEGER, lap INTEGER, position INTEGER, time TEXT, milliseconds INTEGER ) CREATE TABLE qualifying ( qualifyId INTEGER, raceId INTEGER, driverId INTEGER, constructorId ...
SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name
nvbench
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 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.person_info_XM = '王清妍' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2004-06-19')
css
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%ital%' ORDER BY Reputation DESC LIMIT 20
sede
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) -- Using valid SQLite, answer the following que...
SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex ORDER BY COUNT(Sex)
nvbench
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '魏梦凡' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_8138 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is...
SELECT "Record" FROM table_8138 WHERE "Location Attendance" = 'madison square garden 19,009'
wikisql
CREATE TABLE table_name_95 ( attempts VARCHAR, rank VARCHAR, net_yds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Attempts when Rank was larger than 4, and Net Yds was smaller than 1674?
SELECT COUNT(attempts) FROM table_name_95 WHERE rank > 4 AND net_yds < 1674
sql_create_context
CREATE TABLE document_types ( document_type_code text, document_description text ) CREATE TABLE research_outcomes ( outcome_code text, outcome_description text ) CREATE TABLE organisation_types ( organisation_type text, organisation_type_description text ) CREATE TABLE documents ( documen...
SELECT T2.organisation_id, T2.organisation_details FROM grants AS T1 JOIN organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_id HAVING SUM(T1.grant_amount) > 6000
spider
CREATE TABLE table_74497 ( "Pick #" real, "MLS team" text, "Player" text, "Position" text, "Affiliation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of the Colorado Rapids team?
SELECT "Position" FROM table_74497 WHERE "MLS team" = 'colorado rapids'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.Y...
css
CREATE TABLE table_45561 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Week, when Date is December 2, 2001?
SELECT SUM("Week") FROM table_45561 WHERE "Date" = 'december 2, 2001'
wikisql
CREATE TABLE code_description ( code varchar, description text ) 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 food_service ( meal_...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_cod...
atis
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
nvbench
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 OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_NM = '朱红叶' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_name_89 ( country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when Player is 'Rives McBee'?
SELECT country FROM table_name_89 WHERE player = "rives mcbee"
sql_create_context
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 first opponent faced by the sooners in ...
SELECT "opponent#" FROM table_204_617 WHERE "date" = 9 ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_13155 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the statue for an against above 22?
SELECT "Status" FROM table_13155 WHERE "Against" > '22'
wikisql
CREATE TABLE table_79360 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Born" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position did Michael Lee play?
SELECT "Pos." FROM table_79360 WHERE "Name" = 'michael lee'
wikisql
CREATE TABLE table_name_19 ( penalty VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the penalty for Jonathan Toews?
SELECT penalty FROM table_name_19 WHERE player = "jonathan toews"
sql_create_context
CREATE TABLE table_44154 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What w...
SELECT "Record" FROM table_44154 WHERE "High assists" = 'lebron james (4)'
wikisql