instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicatio...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'systemic glucocorticoid - oral' AND STRF...
eicu
CREATE TABLE table_44615 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Nuggets points" real, "Opponents" real, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Opponents have a Result of loss...
SELECT COUNT("Opponents") FROM table_44615 WHERE "Result" = 'loss' AND "Game" < '49' AND "Nuggets points" = '108'
wikisql
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 u.DisplayName, u.Reputation, u.Location, t.TagName, COUNT(*) AS num FROM Posts AS q JOIN Posts AS p ON q.AcceptedAnswerId = p.Id JOIN Users AS u ON p.OwnerUserId = u.Id JOIN PostTags AS pt ON q.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id WHERE u.DisplayName = 'Dave Alperovich' GROUP BY u.DisplayName, u.Repu...
sede
CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date text, Share_in_percent real ) CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE program ( Program_ID int, Name text, Origin text,...
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY SUM(Rating_in_percent)
nvbench
CREATE TABLE table_70113 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the power when the city of license is Beaver Creek?
SELECT "Power" FROM table_70113 WHERE "City of license" = 'beaver creek'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '44520665' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 7717.72) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '44520665' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_k...
css
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 People_ID, Weight FROM people GROUP BY Sex
nvbench
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, ...
SELECT p.Id AS "post_link", p.OwnerUserId AS "user_link", p.CreationDate FROM Posts AS p WHERE p.PostTypeId = 1 AND p.OwnerUserId IN (141525, 146126, 811, 50049, 1438, 164200, 115866, 155160, 98786, 209637, 147336, 131182, 135201, 23354, 51, 6212, 146719, 166017, 4, 2, 130213, 159928, 13, 176330, 208518, 142481, 229741...
sede
CREATE TABLE Performance ( bandmate VARCHAR, SongId VARCHAR ) CREATE TABLE Band ( firstname VARCHAR, lastname VARCHAR, id VARCHAR ) CREATE TABLE Songs ( SongId VARCHAR, Title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who performed ...
SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands"
sql_create_context
CREATE TABLE table_18869 ( "District" text, "2010 Population (000)" real, "2008 GDP (USD bn) a" text, "2008 GDP per capita (USD) a" real, "Agri culture b" text, "Mining b" text, "Manufac turing b" text, "Services & cons truction b" text, "Exports (USD mn) 2011" real, "Median mo. ...
SELECT COUNT("District") FROM table_18869 WHERE "Income poverty f" = '27.7'
wikisql
CREATE TABLE table_name_31 ( years VARCHAR, authority VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years are listed for the Tahunanui school with an authority of state?
SELECT years FROM table_name_31 WHERE authority = "state" AND name = "tahunanui school"
sql_create_context
CREATE TABLE table_24538587_11 ( socket VARCHAR, brand_name__list_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sockets associated with a brand name of Core i3-3xx0m?
SELECT socket FROM table_24538587_11 WHERE brand_name__list_ = "Core i3-3xx0M"
sql_create_context
CREATE TABLE table_71434 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Bronze medals were received by the nation that Ranked less than 5 and received more than 2 Gold medals...
SELECT AVG("Bronze") FROM table_71434 WHERE "Rank" < '5' AND "Gold" > '2' AND "Total" = '9' AND "Silver" < '4'
wikisql
CREATE TABLE table_14843 ( "Minister" text, "Party" text, "Start date" text, "End date" text, "Prime Minister" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the minister for end date of 31 july 2004
SELECT "Minister" FROM table_14843 WHERE "End date" = '31 july 2004'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 85700 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ...
mimic_iii
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Na...
WITH A AS (SELECT LAST_DATE_OF_MONTH(CreationDate) AS CreationMonth, Id, ClosedDate, CASE WHEN Body LIKE '<p>I_''%' OR Body LIKE '<p>IM %' THEN 1 END AS StartsWITHI FROM Posts WHERE PostTypeId = 1) SELECT CreationMonth, (COUNT(CASE WHEN NOT ClosedDate IS NULL AND NOT StartsWITHI IS NULL THEN 1 END) * 1.0) / (COUNT(Star...
sede
CREATE TABLE table_204_110 ( id number, "year" number, "champion" text, "city" text, "llws" text, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where were the 1962 winners from ?
SELECT "city" FROM table_204_110 WHERE "year" = 1962
squall
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND demographic.age < "62"
mimicsql_data
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "8" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_39021 ( "Station" text, "City of license" text, "Channels TV / RF" text, "First air date" text, "HAAT" text, "Facility ID" real, "Public license information" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which City of lic...
SELECT "City of license" FROM table_39021 WHERE "Channels TV / RF" = '36 (psip) 36 (uhf)'
wikisql
CREATE TABLE table_2761641_1 ( rebounds_per_game VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rebounds per game did he have at the 2003 eurobasket?
SELECT rebounds_per_game FROM table_2761641_1 WHERE tournament = "2003 EuroBasket"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "76" AND demographic.days_stay > "27"
mimicsql_data
CREATE TABLE table_31512 ( "Townland" text, "Area( acres )" real, "Barony" text, "Civil parish" text, "Poor law union" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all of the townlands that have exactly 131 acres.
SELECT "Townland" FROM table_31512 WHERE "Area( acres )" = '131'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2041" AND prescriptions.formulary_drug_cd = "CEFX1F"
mimicsql_data
CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, codeshare text ) CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata t...
SELECT COUNT(*), city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY COUNT(*) DESC
spider
CREATE TABLE table_name_3 ( pick VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which pick played the Defensive End position?
SELECT pick FROM table_name_3 WHERE position = "defensive end"
sql_create_context
CREATE TABLE degrees ( Id VARCHAR ) CREATE TABLE campuses ( id VARCHAR ) CREATE TABLE faculty ( faculty VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many faculty lines are there in the university that conferred the most number of degrees in year ...
SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.Id = t2.campus JOIN degrees AS T3 ON T1.Id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_43 ( year VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the year of the pig theme?
SELECT year FROM table_name_43 WHERE theme = "year of the pig"
sql_create_context
CREATE TABLE table_49687 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Gold, when Nation is Yugoslavia, and when Silver is greater than 0?
SELECT AVG("Gold") FROM table_49687 WHERE "Nation" = 'yugoslavia' AND "Silver" > '0'
wikisql
CREATE TABLE table_77162 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score of the Fifa World Cup 1986 Play-off Competition?
SELECT "Score" FROM table_77162 WHERE "Competition" = 'fifa world cup 1986 play-off'
wikisql
CREATE TABLE table_18030 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance when the record was 1-1?
SELECT "Attendance" FROM table_18030 WHERE "Record" = '1-1'
wikisql
CREATE TABLE table_25802 ( "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. -- List h...
SELECT "High points" FROM table_25802 WHERE "Date" = 'April 7'
wikisql
CREATE TABLE table_73753 ( "Season" real, "Winner" text, "Runner-Up" text, "Third Place" text, "Contestants" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many contestants were there when the runner-up was Monique Evans?
SELECT MAX("Contestants") FROM table_73753 WHERE "Runner-Up" = 'Monique Evans'
wikisql
CREATE TABLE table_name_53 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Away team at Mansfield Town's Home game?
SELECT away_team FROM table_name_53 WHERE home_team = "mansfield town"
sql_create_context
CREATE TABLE table_name_67 ( week INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week has a Date of december 8, 1991?
SELECT AVG(week) FROM table_name_67 WHERE date = "december 8, 1991"
sql_create_context
CREATE TABLE table_15709 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which result has a Venue of ulsan?
SELECT "Result" FROM table_15709 WHERE "Venue" = 'ulsan'
wikisql
CREATE TABLE table_name_31 ( player VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player finished at +4?
SELECT player FROM table_name_31 WHERE to_par = "+4"
sql_create_context
CREATE TABLE individuals ( individual_id number, individual_first_name text, individual_middle_name text, inidividual_phone text, individual_email text, individual_address text, individual_last_name text ) CREATE TABLE parties ( party_id number, payment_method_code text, party_p...
SELECT COUNT(*) FROM services
spider
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52598) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_39327 ( "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. -- What was the Partner on February 23, 1997?
SELECT "Partner" FROM table_39327 WHERE "Date" = 'february 23, 1997'
wikisql
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, ...
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 <= 1800 AND flight.departure_time >= 2200) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight...
atis
CREATE TABLE table_29645 ( "Rnd" real, "Circuit" text, "Sports +2.0 Winning Team" text, "Sports 2.0 Winning Team" text, "GT +2.0 Winning Team" text, "GT 2.0 Winning Team" text, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name th...
SELECT "Sports 2.0 Winning Team" FROM table_29645 WHERE "Sports +2.0 Winning Team" = 'Hap Sharp' AND "Circuit" = 'Castle Rock'
wikisql
CREATE TABLE table_13677808_1 ( rank VARCHAR, security VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has a 5.5 mark for security?
SELECT rank FROM table_13677808_1 WHERE security = "5.5"
sql_create_context
CREATE TABLE table_21672 ( "SNO" real, "College code" text, "Faculty name" text, "Designation" text, "Qualification" text, "Department" text, "Experience" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which departments have M.Phil(Maths)?
SELECT "Department" FROM table_21672 WHERE "Qualification" = 'M.Phil(Maths)'
wikisql
CREATE TABLE table_12748 ( "Nat." text, "Name" text, "Moving from" text, "Type" text, "Transfer window" text, "Ends" real, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the person with a type of transfer, ...
SELECT "Name" FROM table_12748 WHERE "Type" = 'transfer' AND "Transfer fee" = '€8m + €2m in variables'
wikisql
CREATE TABLE table_name_47 ( player VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is from flower mound, tx?
SELECT player FROM table_name_47 WHERE hometown = "flower mound, tx"
sql_create_context
CREATE TABLE organisations ( organisation_id number, organisation_type text, organisation_details text ) CREATE TABLE research_staff ( staff_id number, employer_organisation_id number, staff_details text ) CREATE TABLE projects ( project_id number, organisation_id number, project_d...
SELECT staff_details FROM research_staff ORDER BY staff_details
spider
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 OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '朱飞宇' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 1829.32)
css
CREATE TABLE table_203_59 ( id number, "country" text, "2000" number, "2001" number, "2002" number, "2003" number, "2004" number, "2005" number, "2006" number, "2007" number, "2008" number, "2009" number, "2010" number, "2011" number ) -- Using valid SQLite, ans...
SELECT "country" FROM table_203_59 WHERE "2002" = 50 AND "2003" = 13
squall
CREATE TABLE table_79131 ( "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. -- What is Country, when Total is greater than 283, and when Year(s) Won is '1989'?
SELECT "Country" FROM table_79131 WHERE "Total" > '283' AND "Year(s) won" = '1989'
wikisql
CREATE TABLE table_15632 ( "Season" text, "Games" real, "Lost" real, "Tied" text, "Points" real, "Goals for" real, "Goals against" real, "Standing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the total number of points with m...
SELECT SUM("Points") FROM table_15632 WHERE "Goals for" > '225' AND "Goals against" = '190'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Meth sus pneum d/t Staph"
mimicsql_data
CREATE TABLE table_2562572_37 ( dominant_religion__2002_ VARCHAR, settlement VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the dominant religion of srpska crnja
SELECT dominant_religion__2002_ FROM table_2562572_37 WHERE settlement = "Srpska Crnja"
sql_create_context
CREATE TABLE table_2021 ( "Fiscal year" real, "2-car sets" real, "4-car sets" real, "6-car sets" real, "8-car sets" real, "Total vehicles" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest fiscal year if total vehicles is 490?
SELECT MIN("Fiscal year") FROM table_2021 WHERE "Total vehicles" = '490'
wikisql
CREATE TABLE table_name_76 ( games INTEGER, points VARCHAR, rank VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the game average that has a rank larger than 2 with team Olympiacos and points larger than 113?
SELECT AVG(games) FROM table_name_76 WHERE rank > 2 AND team = "olympiacos" AND points > 113
sql_create_context
CREATE TABLE table_203_44 ( id number, "stage" text, "date" text, "route" text, "terrain" text, "length" text, "winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many different countries won at least one stage in the 1964 tour de fr...
SELECT COUNT(DISTINCT "winner") FROM table_203_44
squall
CREATE TABLE table_30643 ( "Team" text, "Average" text, "Points" real, "Played" real, "2003-04" text, "2004-05" text, "2005-06" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2003-2004 values are associated with an average of 1.377?
SELECT "2003-04" FROM table_30643 WHERE "Average" = '1.377'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT gwyjzb.MED_AMOUT FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '17047326007' UNION SELECT fgwyjzb.MED_AMOUT FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '17047326007'
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.name = "Thomas Jeanbaptiste"
mimicsql_data
CREATE TABLE table_14962316_9 ( copa_mercosur_1998 VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were Cruzeiro results in the Copa Mercosur in 1998
SELECT copa_mercosur_1998 FROM table_14962316_9 WHERE team = "Cruzeiro"
sql_create_context
CREATE TABLE table_39513 ( "Number" real, "Builder" text, "Type" text, "Date" text, "Works number" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the builder for number 3
SELECT "Builder" FROM table_39513 WHERE "Number" = '3'
wikisql
CREATE TABLE table_78423 ( "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. -- I want to know the home team score of the away t...
SELECT "Home team score" FROM table_78423 WHERE "Crowd" > '20,735' AND "Away team" = 'richmond'
wikisql
CREATE TABLE table_204_808 ( id number, "team" text, "no" number, "driver" text, "class" text, "chassis" text, "engine" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what team is listed above diamond racing ?
SELECT "team" FROM table_204_808 WHERE id < (SELECT MIN(id) FROM table_204_808 WHERE "team" = 'diamond racing') ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_name_19 ( opponent_number VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent in the game that was attended by 42,000 people?
SELECT opponent_number FROM table_name_19 WHERE attendance = "42,000"
sql_create_context
CREATE TABLE table_name_85 ( crowd VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Crowd has a Home team of st kilda?
SELECT crowd FROM table_name_85 WHERE home_team = "st kilda"
sql_create_context
CREATE TABLE table_24538140_2 ( match1 VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for match 1 for the team Eastern Tigers?
SELECT match1 FROM table_24538140_2 WHERE team = "Eastern Tigers"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX num...
SELECT wdmzjzjlb.ZYBMLX, wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '77838573351' UNION SELECT bdmzjzjlb.ZYBMLX, bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '77838573351'
css
CREATE TABLE table_name_80 ( team VARCHAR, driver VARCHAR, laps VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team did Scott Pruett drive for when the grid was smaller than 20 and there were 65 laps?
SELECT team FROM table_name_80 WHERE laps = 65 AND grid < 20 AND driver = "scott pruett"
sql_create_context
CREATE TABLE table_name_16 ( venue VARCHAR, status VARCHAR, against VARCHAR, opposing_teams VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue has an against over 14, an opposing team of scotland, and a status of five nations?
SELECT venue FROM table_name_16 WHERE against > 14 AND opposing_teams = "scotland" AND status = "five nations"
sql_create_context
CREATE TABLE table_name_78 ( opponent_number VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opponent had an attendance of 63,659?
SELECT opponent_number FROM table_name_78 WHERE attendance = "63,659"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
SELECT c.Id AS "Comment ID", c.CreationDate AS "Comment Date", u.Id AS "User ID", u.DisplayName AS "User Name", a.Id AS "Answer ID", q.Id AS "Question ID", q.Title AS "Question Title" FROM Posts AS a JOIN Posts AS q ON q.Id = a.ParentId JOIN Comments AS c ON c.PostId = a.Id JOIN Users AS u ON u.Id = a.OwnerUserId WHERE...
sede
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25...
SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID
nvbench
CREATE TABLE table_27539272_5 ( record VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the record for score 1-3?
SELECT record FROM table_27539272_5 WHERE score = "1-3"
sql_create_context
CREATE TABLE table_13895 ( "Time" text, "Show Name" text, "DJ's" text, "Local/Networked" text, "Ad Freq" text, "News Freq" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What show has Cameron Humphries DJ'ing?
SELECT "Show Name" FROM table_13895 WHERE "DJ's" = 'cameron humphries'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare"
mimicsql_data
CREATE TABLE table_22407 ( "Episode" text, "Garfield Episode 1" text, "U.S. Acres Episode" text, "Garfield Episode 2" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the garfield episode 2 when episode 1 is 'change of...
SELECT "Garfield Episode 2" FROM table_22407 WHERE "Garfield Episode 1" = 'Change Of Mind'
wikisql
CREATE TABLE table_name_65 ( year INTEGER, points INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year did the team receive more than 0 points?
SELECT AVG(year) FROM table_name_65 WHERE points > 0
sql_create_context
CREATE TABLE table_204_72 ( id number, "election year" number, "# of\nconstituency votes" number, "# of\nparty list votes" number, "% of\nparty list votes" number, "# of\noverall seats won" text, "+/-" number ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "# of\nparty list votes" FROM table_204_72 WHERE "election year" = 1961
squall
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 EM...
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY EMP_FNAME ORDER BY EMP_FNAME
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH"
mimicsql_data
CREATE TABLE table_name_7 ( pick__number VARCHAR, position VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the pick number for the wide receiver drafted from Michigan State?
SELECT pick__number FROM table_name_7 WHERE position = "wide receiver" AND college = "michigan state"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "BOTH EYES"
mimicsql_data
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 zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i...
css
CREATE TABLE table_41494 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Top-10, when Wins is less than 0?
SELECT AVG("Top-10") FROM table_41494 WHERE "Wins" < '0'
wikisql
CREATE TABLE table_name_28 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day did the team play the buffalo bills?
SELECT date FROM table_name_28 WHERE opponent = "buffalo bills"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucose' AND STRFTIME('%y', treatment.treatmenttime)...
eicu
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "4432"
mimicsql_data
CREATE TABLE table_train_100 ( "id" int, "systolic_blood_pressure_sbp" int, "stroke" bool, "body_weight" float, "diastolic_blood_pressure_dbp" int, "rosen_modified_hachinski_ischemic_score" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float ) -- Using valid SQLite, answer...
SELECT * FROM table_train_100 WHERE rosen_modified_hachinski_ischemic_score < 4
criteria2sql
CREATE TABLE table_name_17 ( genre VARCHAR, game_modes VARCHAR, chinese_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the genre of the Chinese title , which has a single-player game mode?
SELECT genre FROM table_name_17 WHERE game_modes = "single-player" AND chinese_title = "摸摸瓦力欧制造"
sql_create_context
CREATE TABLE table_28937 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result for walter jones (dr) 99.0% henry lee (f) 1.0%
SELECT "Result" FROM table_28937 WHERE "Candidates" = 'Walter Jones (DR) 99.0% Henry Lee (F) 1.0%'
wikisql
CREATE TABLE table_67183 ( "Poll source" text, "Dates administered" text, "Dianne Feinstein *" text, "Jerry Brown" text, "Antonio Villaraigosa*" text, "Gavin Newsom*" text, "John Garamendi*" text, "Jack O'Connell*" text, "Steve Westly*" text, "Bill Lockyer*" text ) -- Using val...
SELECT "Dates administered" FROM table_67183 WHERE "Steve Westly*" = '––' AND "Antonio Villaraigosa*" = '––' AND "Jerry Brown" = '47%'
wikisql
CREATE TABLE table_name_82 ( date VARCHAR, outcome VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date with winner outcome and opponent of noppawan lertcheewakarn jessica moore
SELECT date FROM table_name_82 WHERE outcome = "winner" AND opponent = "noppawan lertcheewakarn jessica moore"
sql_create_context
CREATE TABLE table_30591 ( "Version" text, "Release" text, "Release date" text, "End of maintenance" text, "Requirement" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When's the end of maintenance in the august 11, 2013 release date?
SELECT "End of maintenance" FROM table_30591 WHERE "Release date" = 'August 11, 2013'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(School_ID) DESC
nvbench
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) 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), ...
SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE
nvbench
CREATE TABLE table_204_205 ( id number, "class" text, "no" number, "team" text, "drivers" text, "chassis" text, "engine" text, "laps" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many teams failed to finish the race after 2 laps ...
SELECT COUNT("team") FROM table_204_205 WHERE "laps" = 2
squall
CREATE TABLE table_name_50 ( class VARCHAR, identifier VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which class has an identifier of CBUA-FM?
SELECT class FROM table_name_50 WHERE identifier = "cbua-fm"
sql_create_context
CREATE TABLE table_9351 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE SECOND LEG WITH HARO AS TEAM TWO?
SELECT "2nd leg" FROM table_9351 WHERE "Team 2" = 'haro'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT hz_info_mzjzjlb.YLJGDM 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...
css
CREATE TABLE table_name_88 ( high_points VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the high points on March 29?
SELECT high_points FROM table_name_88 WHERE date = "march 29"
sql_create_context