instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_42 ( losses VARCHAR, against VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total losses that has more than 12 wins and 1017 against?
SELECT COUNT(losses) FROM table_name_42 WHERE against = 1017 AND wins > 12
sql_create_context
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT MAX(h.t), h.pc AS "Percent of closed questions over time" FROM (SELECT q.t AS t, NTILE(100) OVER (ORDER BY q.t) AS pc FROM (SELECT ClosedDate - CreationDate AS t FROM Posts WHERE PostTypeId = 1 AND NOT ClosedDate IS NULL) AS q) AS h WHERE h.t <= '23:59:59' GROUP BY h.pc ORDER BY h.pc
sede
CREATE TABLE table_name_87 ( money___$__ VARCHAR, place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the money ($) for the t3 place and the score of 74-74-71-69=288?
SELECT money___$__ FROM table_name_87 WHERE place = "t3" AND score = 74 - 74 - 71 - 69 = 288
sql_create_context
CREATE TABLE table_24341 ( "Type of Record" text, "Attendance" real, "Date/Year" text, "Stadium" text, "Result/Games" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result/games for 54530
SELECT "Result/Games" FROM table_24341 WHERE "Attendance" = '54530'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text...
SELECT Id AS "post_link", Title, Score, Tags, Body, ViewCount, CreationDate, AnswerCount, AcceptedAnswerId, PostTypeId, ClosedDate FROM Posts AS P WHERE P.Tags LIKE '%##TagName1##%' OR P.Tags LIKE '%##TagName2##%' OR P.Tags LIKE '%##TagName3##%' OR P.Tags LIKE '%##TagName4##%' ORDER BY Score DESC LIMIT 10000
sede
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE DEPARTMENT ( DEPT_CODE var...
SELECT STU_FNAME, COUNT(STU_FNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_FNAME ORDER BY STU_FNAME DESC
nvbench
CREATE TABLE music_festival ( Date_of_ceremony VARCHAR, Volume VARCHAR ) CREATE TABLE volume ( Volume_ID VARCHAR, Weeks_on_Top INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Please show the date of ceremony of the volumes that last more than 2 weeks...
SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) 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 re...
SELECT People_ID, Height FROM people GROUP BY Sex
nvbench
CREATE TABLE table_21029 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Enrollment" real, "Joined" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number location of georgia perimeter college
SELECT COUNT("Location") FROM table_21029 WHERE "Institution" = 'Georgia Perimeter College'
wikisql
CREATE TABLE table_name_54 ( grid VARCHAR, laps VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What grid has 78 laps, and Ronnie Bremer as driver?
SELECT grid FROM table_name_54 WHERE laps = 78 AND driver = "ronnie bremer"
sql_create_context
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) -- Using valid SQLite, answer the following questions fo...
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Type, Nationality ORDER BY Nationality
nvbench
CREATE TABLE table_name_80 ( time_retired VARCHAR, constructor VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Time/Retired for the BMW Sauber, and Nick Heidfeld?
SELECT time_retired FROM table_name_80 WHERE constructor = "bmw sauber" AND driver = "nick heidfeld"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidan...
SELECT * FROM Users WHERE DownVotes > UpVotes AND UpVotes < 50 AND DownVotes > 100
sede
CREATE TABLE table_name_7 ( frequency_mhz VARCHAR, call_sign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Frequency MHz has a Call Sign of K218BE?
SELECT frequency_mhz FROM table_name_7 WHERE call_sign = "k218be"
sql_create_context
CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, damage_millions_usd number, number_deaths number ) CREATE TABLE affected_region ( region_id number, storm_id number, number_city_affected number ) CREATE TABLE region ( region_id number, r...
SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Denmark'
spider
CREATE TABLE table_31152 ( "Name/ designation" text, "Year of intro" real, "Country of origin" text, "Primary cartridge" text, "Major users" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the major users from Australia?
SELECT "Major users" FROM table_31152 WHERE "Country of origin" = 'Australia'
wikisql
CREATE TABLE table_name_4 ( attendance INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest Attendance when the Opponent was Maryland?
SELECT MIN(attendance) FROM table_name_4 WHERE opponent = "maryland"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, O...
SELECT Comments.Id, Comments.Id AS "comment_link", CreationDate FROM Comments WHERE Text LIKE '%ThreeTen%' AND UserId = 5772882 LIMIT 3
sede
CREATE TABLE table_name_51 ( points_difference VARCHAR, lost VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the difference related to 2 losses and fewer than 10 points?
SELECT points_difference FROM table_name_51 WHERE lost = 2 AND points < 10
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '010-23252'
eicu
CREATE TABLE table_name_23 ( height_metres___ft VARCHAR, town VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height in Rouen?
SELECT height_metres___ft FROM table_name_23 WHERE town = "rouen"
sql_create_context
CREATE TABLE table_12113 ( "Team" text, "Average" real, "Points" real, "Played" real, "1988-89" text, "1989-90" text, "1990-1991" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points were there when the average was 0.763 and the pl...
SELECT "Points" FROM table_12113 WHERE "Played" < '76' AND "Average" = '0.763'
wikisql
CREATE TABLE publication_keyword ( kid int, pid int ) CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE writes ( aid int, pid int ) CREATE TABLE domain_conference ( cid int, did int ) CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE T...
SELECT AUTHOR_0.name FROM author AS AUTHOR_0, author AS AUTHOR_1, cite, publication AS PUBLICATION_0, publication AS PUBLICATION_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_1.name = 'H. V. Jagadish' AND PUBLICATION_0.pid = cite.citing AND PUBLICATION_1.pid = cite.cited AND WRITES_0.aid = AUTHOR_0.aid AND WRI...
academic
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy...
css
CREATE TABLE table_name_83 ( elevator VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the elevator from crema?
SELECT elevator FROM table_name_83 WHERE nationality = "crema"
sql_create_context
CREATE TABLE table_name_20 ( bike VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What bike has 26 as the grid?
SELECT bike FROM table_name_20 WHERE grid = 26
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT demographic.days_stay, demographic.admittime FROM demographic WHERE demographic.subject_id = "99936"
mimicsql_data
CREATE TABLE table_48817 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team when Boston is the road team in game 4?
SELECT "Home Team" FROM table_48817 WHERE "Road Team" = 'boston' AND "Game" = 'game 4'
wikisql
CREATE TABLE table_name_15 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Footscray's score as the home team?
SELECT home_team AS score FROM table_name_15 WHERE home_team = "footscray"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-58884')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_T...
eicu
CREATE TABLE table_name_27 ( time VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time when the opponent is stephanie palmer?
SELECT time FROM table_name_27 WHERE opponent = "stephanie palmer"
sql_create_context
CREATE TABLE table_17788 ( "Day (see Irregularities )" text, "Sunday Day One" text, "Monday Day Two" text, "Tuesday Day Three" text, "Wednesday Day Four" text, "Thursday Day Five" text, "Friday Day Six" text, "Saturday Day Seven" text ) -- Using valid SQLite, answer the following quest...
SELECT "Saturday Day Seven" FROM table_17788 WHERE "Thursday Day Five" = 'ሐሙስ hamus'
wikisql
CREATE TABLE table_name_42 ( sio_2 INTEGER, na_2_o VARCHAR, al_2_o_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is average SiO 2, when Na 2 O is 7.53, and when Al 2 O 3 is less than 2.13?
SELECT AVG(sio_2) FROM table_name_42 WHERE na_2_o = 7.53 AND al_2_o_3 < 2.13
sql_create_context
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 COUNT(qtb.IN_DIAG_DIS_CD) FROM qtb WHERE qtb.PERSON_NM = '方成双' AND qtb.IN_HOSP_DATE BETWEEN '2011-07-30' AND '2016-01-19' UNION SELECT COUNT(gyb.IN_DIAG_DIS_CD) FROM gyb WHERE gyb.PERSON_NM = '方成双' AND gyb.IN_HOSP_DATE BETWEEN '2011-07-30' AND '2016-01-19' UNION SELECT COUNT(zyb.IN_DIAG_DIS_CD) FROM zyb WHERE zy...
css
CREATE TABLE table_203_502 ( id number, "team" text, "titles" number, "runner-up" number, "third place" number, "fourth place" number, "years participated" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what two teams only have two titles ...
SELECT "team" FROM table_203_502 WHERE "titles" = 2
squall
CREATE TABLE table_name_64 ( verb_meaning VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the verb meaning for class 4?
SELECT verb_meaning FROM table_name_64 WHERE class = "4"
sql_create_context
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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code
nvbench
CREATE TABLE table_77174 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result on october 8, 1961?
SELECT "Result" FROM table_77174 WHERE "Date" = 'october 8, 1961'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Comments ( Id number, PostId num...
SELECT Id AS "post_link", Title, Score, ViewCount, AnswerCount, Body FROM Posts WHERE (PostTypeId = 1) AND (OwnerUserId = '##userid##') ORDER BY Id
sede
CREATE TABLE table_22075 ( "Position" real, "Club" text, "Games played" real, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games...
SELECT MIN("Games played") FROM table_22075
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND lab.label = "CD4/CD8 Ratio"
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 SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, UNIVALENT FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '郎永逸' AND MED_SER_ORG_NO = '7422800') ORDER BY UNIVALENT DESC LIMIT 1
css
CREATE TABLE table_3824 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the m...
SELECT "Manner of departure" FROM table_3824 WHERE "Outgoing manager" = 'Luis Enrique'
wikisql
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 demographic.name FROM demographic WHERE demographic.subject_id = "66411"
mimicsql_data
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) 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 ) ...
SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE table_name_97 ( heat INTEGER, rank VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Heat of the 34 Rank swimmer with a Time of 49.49 or less?
SELECT AVG(heat) FROM table_name_97 WHERE rank = 34 AND time < 49.49
sql_create_context
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 Name, SUM(Revenue) FROM Manufacturers GROUP BY Name
nvbench
CREATE TABLE table_name_46 ( result VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the match against Pat Lawlor?
SELECT result FROM table_name_46 WHERE opponent = "pat lawlor"
sql_create_context
CREATE TABLE table_50 ( "Star (Pismis24-#)" text, "Spectral type" text, "Magnitude (M bol )" text, "Temperature (K)" real, "Radius (R \u2609 )" real, "Mass (M \u2609 )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If a radius is 10, what is th...
SELECT MIN("Mass (M \u2609 )") FROM table_50 WHERE "Radius (R \u2609 )" = '10'
wikisql
CREATE TABLE table_name_80 ( goals_conceded__gc_ INTEGER, draw__pe_ VARCHAR, goals_scored__gf_ VARCHAR, points__pts_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of goals conceded where more than 19 goals were scored, the...
SELECT AVG(goals_conceded__gc_) FROM table_name_80 WHERE goals_scored__gf_ > 19 AND points__pts_ = 31 AND draw__pe_ > 7
sql_create_context
CREATE TABLE table_name_3 ( venue VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has Footscray as it's Home team?
SELECT venue FROM table_name_3 WHERE home_team = "footscray"
sql_create_context
CREATE TABLE table_48559 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the least laps when the driver is rubens barrichello and the grid is less than 12?
SELECT MIN("Laps") FROM table_48559 WHERE "Driver" = 'rubens barrichello' AND "Grid" < '12'
wikisql
CREATE TABLE Has_allergy ( Allergy VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many students have cat allergies?
SELECT COUNT(*) FROM Has_allergy WHERE Allergy = "Cat"
sql_create_context
CREATE TABLE table_58967 ( "Nat." text, "Name" text, "Moving to" text, "Type" text, "Transfer window" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is moving to Triestina?
SELECT "Name" FROM table_58967 WHERE "Moving to" = 'triestina'
wikisql
CREATE TABLE table_49422 ( "Club" text, "City" text, "Stadium" text, "Capacity" real, "2007\u201308 season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which club came in 14th in Serie c1/a in the 2007-08 season?
SELECT "Club" FROM table_49422 WHERE "2007\u201308 season" = '14th in serie c1/a'
wikisql
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text ) CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) -- Using valid SQLite, answer the following questions fo...
SELECT Snatch, Total FROM body_builder
nvbench
CREATE TABLE table_name_74 ( package_version VARCHAR, carrier VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE PACKAGE VERSION WITH TELUS MOBILITY?
SELECT package_version FROM table_name_74 WHERE carrier = "telus mobility"
sql_create_context
CREATE TABLE table_32542 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which host university is based in Missoula?
SELECT "Host" FROM table_32542 WHERE "City" = 'missoula'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di...
mimic_iii
CREATE TABLE table_1908 ( "Elimination number" real, "Wrestler" text, "Entered" real, "Eliminated by" text, "Method of elimination" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the elimination number of the fighter who fo...
SELECT MIN("Elimination number") FROM table_1908 WHERE "Time" = '27:27'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 table_45648 ( "Game" real, "Date" text, "Opponent" 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. -- Wh...
SELECT "High rebounds" FROM table_45648 WHERE "Score" = '61-59'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyponatremia' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 year')) AS t1) -...
eicu
CREATE TABLE table_25154 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the opponents in the fin...
SELECT "Opponents in the final" FROM table_25154 WHERE "Score in the final" = '6–4, 7–6 2'
wikisql
CREATE TABLE table_71558 ( "D 48" text, "D 47" text, "D 46" text, "D 45" text, "D 44" text, "D 43" text, "D 42" text, "D 41" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the D45 associated with a D42 of r 22?
SELECT "D 45" FROM table_71558 WHERE "D 42" = 'r 22'
wikisql
CREATE TABLE table_67809 ( "Date" text, "Course" text, "Distance" text, "Type" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date with the distance of km (mi) at the course of roccaraso to san giorgio del sannio?
SELECT "Date" FROM table_67809 WHERE "Distance" = 'km (mi)' AND "Course" = 'roccaraso to san giorgio del sannio'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '陶清绮'
css
CREATE TABLE table_name_65 ( sales__billion_ INTEGER, headquarters VARCHAR, assets__billion_$_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average sales in billions of the company headquartered in France with more than 2,539.1 billion in a...
SELECT AVG(sales__billion_) AS $_ FROM table_name_65 WHERE headquarters = "france" AND assets__billion_$_ > 2 OFFSET 539.1
sql_create_context
CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE has_allergy ( stuid number, allergy text ) -- Using valid SQLite...
SELECT fname, lname, age FROM student WHERE sex = 'F'
spider
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 text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, X...
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '58577341155' GROUP BY jybgb.SHRGH HAVING COUNT(*) > 7
css
CREATE TABLE table_38758 ( "Couple" text, "Score" text, "Style" text, "Music" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Result of third place, and a Style of cha-cha-cha?
SELECT "Score" FROM table_38758 WHERE "Result" = 'third place' AND "Style" = 'cha-cha-cha'
wikisql
CREATE TABLE Customers_cards ( card_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all card type codes and the number of cards in each type.
SELECT card_type_code, COUNT(*) FROM Customers_cards GROUP BY card_type_code
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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 tex...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JY...
css
CREATE TABLE table_66991 ( "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. -- what is the gender of Ron Gray, ranked 5th?
SELECT "Gender" FROM table_66991 WHERE "Rank" = '5th' AND "Candidate's Name" = 'ron gray'
wikisql
CREATE TABLE Third_Party_Companies ( company_id INTEGER, company_type VARCHAR(5), company_name VARCHAR(255), company_address VARCHAR(255), other_company_details VARCHAR(255) ) CREATE TABLE Maintenance_Contracts ( maintenance_contract_id INTEGER, maintenance_contract_company_id INTEGER, ...
SELECT last_name, COUNT(last_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description, last_name ORDER BY last_name
nvbench
CREATE TABLE table_name_38 ( opponent VARCHAR, competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent is friendly and played on 15-08-2012?
SELECT opponent FROM table_name_38 WHERE competition = "friendly" AND date = "15-08-2012"
sql_create_context
CREATE TABLE table_17795 ( "Year" real, "Road Opened" text, "Road Closed" text, "Freight Carried s Tonne" real, "Super B Capacity Reached [ citation needed ]" text, "Number of Truck Loads North" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wha...
SELECT MAX("Number of Truck Loads North") FROM table_17795
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2058" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT demographic.age, demographic.language FROM demographic WHERE demographic.subject_id = "8990"
mimicsql_data
CREATE TABLE table_name_55 ( institution VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What institution is located in athens, ga, us?
SELECT institution FROM table_name_55 WHERE location = "athens, ga, us"
sql_create_context
CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4...
SELECT order_id, COUNT(*) FROM Invoices GROUP BY order_id
nvbench
CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT director FROM movie WHERE director <> "null" GROUP BY director HAVING COUNT(*) = 1
spider
CREATE TABLE table_name_13 ( to_par VARCHAR, country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the to par for Hale Irwin of the United States?
SELECT to_par FROM table_name_13 WHERE country = "united states" AND player = "hale irwin"
sql_create_context
CREATE TABLE table_1936 ( "Athlete" text, "Class" text, "Event" text, "Round 1" text, "Round 2" text, "Round 3" text, "1/8 Finals" text, "Quarterfinals" text, "Semifinals" text, "Final/ Bronze medal contest" text ) -- Using valid SQLite, answer the following questions for the t...
SELECT "Round 1" FROM table_1936 WHERE "Event" = 'Team'
wikisql
CREATE TABLE table_name_48 ( heat VARCHAR, nationality VARCHAR, lane VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many heats had 2 lanes, a rank above 75, and nationality of Madagascar?
SELECT COUNT(heat) FROM table_name_48 WHERE lane = 2 AND rank > 75 AND nationality = "madagascar"
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 jybgb ( BBCJBW text, BBDM tex...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH =...
css
CREATE TABLE products ( color_code VARCHAR ) CREATE TABLE ref_colors ( color_description VARCHAR, color_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the description of the color for most products?
SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE ReviewTaskTypes ( 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, ExpiryDat...
WITH FirstPosts AS (SELECT OwnerUserId AS SEUser, MIN(Id) AS Post FROM Posts GROUP BY OwnerUserId), UserQuestionCount AS (SELECT COUNT(Id) AS PostCount, OwnerUserId AS Id FROM Posts GROUP BY OwnerUserId) SELECT t.TagName, COUNT(Tags) AS Users, PostsPerUser = 1.0 * SUM(UserQuestionCount.PostCount) / COUNT(Tags), TotalPo...
sede
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
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 = '030-67523')) AND treatment.treatmentname = 'treatment of hyperkal...
eicu
CREATE TABLE table_403 ( "Name" text, "Position" text, "Height" text, "Weight(lbs)" real, "Born" text, "College" text, "Drafted" text, "Pro Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position when drafted is 1974,r1...
SELECT "Position" FROM table_403 WHERE "Drafted" = '1974,R11,P11'
wikisql
CREATE TABLE table_13762472_4 ( record VARCHAR, high_points VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the record with high points being dwyane wade (27) and location attendance being arco arena
SELECT record FROM table_13762472_4 WHERE high_points = "Dwyane Wade (27)" AND location_attendance = "ARCO Arena"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, fligh...
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 = 'ATLANTA' AND date_day.day_number = 22 AND date_day.month_number = 3 AND...
atis
CREATE TABLE table_11483 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which partners were runner-up in the tournament in Mons, Belg...
SELECT "Partner" FROM table_11483 WHERE "Outcome" = 'runner-up' AND "Tournament" = 'mons, belgium'
wikisql
CREATE TABLE table_name_95 ( college VARCHAR, pick VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college did the player picked larger than 130 by the New York Jets go to?
SELECT college FROM table_name_95 WHERE pick > 130 AND team = "new york jets"
sql_create_context
CREATE TABLE employee ( emp_lname VARCHAR, emp_hiredate VARCHAR, emp_num VARCHAR ) CREATE TABLE professor ( emp_num VARCHAR, prof_office VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the last name and hire date of the professor who is in o...
SELECT T1.emp_lname, T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102'
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
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 '2011-02-01' AND '2018-03-19' AND t_kc22.MED_INV_IT...
css
CREATE TABLE table_21988 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the film Milagros submitted?
SELECT "Year (Ceremony)" FROM table_21988 WHERE "Original title" = 'Milagros'
wikisql
CREATE TABLE table_name_56 ( pick INTEGER, name VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Pick has a Name of ed hickerson, and a Round smaller than 10?
SELECT SUM(pick) FROM table_name_56 WHERE name = "ed hickerson" AND round < 10
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other Staphylococcus pneumonia"
mimicsql_data
CREATE TABLE table_74761 ( "Event" text, "Time" text, "Nationality" text, "Date" text, "Meet" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where were the 2008 championships with a time of 7:56.90 held?
SELECT "Location" FROM table_74761 WHERE "Meet" = '2008 championships' AND "Time" = '7:56.90'
wikisql