instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Descri...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%ahmedabad%' ORDER BY Reputation DESC LIMIT 20
sede
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 ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY COUNT(ACC_Road)
nvbench
CREATE TABLE table_23837 ( "Type" text, "Beam height (mm)" real, "Flange width (mm)" real, "Web thickness (mm)" text, "Flange thickness (mm)" text, "Weight (kg/m)" text, "Cross-section area (cm 2 )" text, "Moment of inertia in torsion (J) (cm 4 )" text ) -- Using valid SQLite, answer t...
SELECT "Cross-section area (cm 2 )" FROM table_23837 WHERE "Moment of inertia in torsion (J) (cm 4 )" = '2.54'
wikisql
CREATE TABLE table_67413 ( "2000" text, "2004" text, "2009" text, "2013" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2004 when 2013 is 3rd?
SELECT "2004" FROM table_67413 WHERE "2013" = '3rd'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'replace nephrostomy tube'))
mimic_iii
CREATE TABLE table_902 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the minimum average with highest being 2363
SELECT MIN("Average") FROM table_902 WHERE "Highest" = '2363'
wikisql
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX n...
SELECT zyjzjlb.ZYBMLX, zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '86797160083'
css
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%The Environmental History of China%' OR name LIKE '%The Environmental History of China%') AND credits = 17
advising
CREATE TABLE table_74272 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of nationalities for ryan mckie
SELECT COUNT("Nationality") FROM table_74272 WHERE "Player" = 'Ryan Mckie'
wikisql
CREATE TABLE table_name_64 ( points INTEGER, game VARCHAR, january VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points is the highest one that has a Game smaller than 43, and a January larger than 8?
SELECT MAX(points) FROM table_name_64 WHERE game < 43 AND january > 8
sql_create_context
CREATE TABLE table_name_74 ( frequency_mhz VARCHAR, city_of_license VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the frequency of Walterboro, SC?
SELECT frequency_mhz FROM table_name_74 WHERE city_of_license = "walterboro, sc"
sql_create_context
CREATE TABLE table_35223 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Label has a Region of germany, and a Format of 12' maxi?
SELECT "Label" FROM table_35223 WHERE "Region" = 'germany' AND "Format" = '12" maxi'
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 SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '柏嘉纳' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-05-08' AND '2018-09-10'
css
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 number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
SELECT wdmzjzjlb.ZYBMLX, wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '10564497940' UNION SELECT bdmzjzjlb.ZYBMLX, bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '10564497940'
css
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text...
SELECT SUM(PostTypeId) FROM Posts WHERE PostTypeId IN (1, 2) GROUP BY PostTypeId
sede
CREATE TABLE table_name_9 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the match against adri n men ndez-maceiras?
SELECT date FROM table_name_9 WHERE opponent = "adrián menéndez-maceiras"
sql_create_context
CREATE TABLE table_28365816_2 ( conference VARCHAR, tournament_winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During what conference is North Carolina listed as the tournament winner?
SELECT conference FROM table_28365816_2 WHERE tournament_winner = "North Carolina"
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number...
SELECT inputevents_cv.charttime 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 = 4368)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) = '2105-05-24' ORDER BY inputevent...
mimic_iii
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2174.0" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE table_name_35 ( competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the competition when the date is 1995-08-06?
SELECT competition FROM table_name_35 WHERE date = "1995-08-06"
sql_create_context
CREATE TABLE table_203_793 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what opponent is listed below venezuela ?
SELECT "opponent" FROM table_203_793 WHERE id = (SELECT id FROM table_203_793 WHERE "opponent" = 'venezuela') + 1
squall
CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( ...
SELECT county_name FROM county ORDER BY population LIMIT 3
spider
CREATE TABLE table_6564 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of silver medals of the team with less than 2 gold, 1 bronze, and more than 2 total med...
SELECT COUNT("Silver") FROM table_6564 WHERE "Gold" < '2' AND "Bronze" = '1' AND "Total" > '2'
wikisql
CREATE TABLE table_37652 ( "Rank" real, "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 highest rank of a nation with fewer than 0 silver medals?
SELECT MAX("Rank") FROM table_37652 WHERE "Silver" < '0'
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX 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.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ...
css
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 * FROM Posts
sede
CREATE TABLE table_79327 ( "Country" text, "Human development (2012) HDI" real, "GDP (PPP) (2012) US$ per capita" text, "Real GDP growth (2011) %" text, "Income inequality (2011) Gini" text, "Poverty (2009) HPI-1 %" real, "Extreme poverty (2011) <1.25 US$ %" text, "Literacy (2010) %" rea...
SELECT "Murder (2012) Rate per 100,000" FROM table_79327 WHERE "Peace (2012) GPI" = '1.616'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id numbe...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76637) AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2102-02'
mimic_iii
CREATE TABLE table_23274514_8 ( date VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the attendance at TD Garden 18,624?
SELECT date FROM table_23274514_8 WHERE location_attendance = "TD Garden 18,624"
sql_create_context
CREATE TABLE table_2963 ( "Name" text, "Aperture m" text, "Aper. in" text, "Mirror/type" text, "Nationality/Sponsors" text, "Site" text, "Built/Used" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which telescopes were sponsored by or origin...
SELECT "Name" FROM table_2963 WHERE "Nationality/Sponsors" = 'Belgium'
wikisql
CREATE TABLE table_name_39 ( gold INTEGER, nation VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Gold medals did Japan receive who had a Total of more than 1 medals?
SELECT SUM(gold) FROM table_name_39 WHERE nation = "japan" AND total > 1
sql_create_context
CREATE TABLE table_name_23 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the opponent on february 8, 1990?
SELECT opponent FROM table_name_23 WHERE date = "february 8, 1990"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number,...
SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '方芳芳' AND txmzjzjlb.JZKSRQ BETWEEN '2000-02-04' AND '2011-08-12' UNION SELECT COUNT(*) FROM p...
css
CREATE TABLE table_24901152_4 ( opponents VARCHAR, championship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the opponents in the Rome championship?
SELECT opponents FROM table_24901152_4 WHERE championship = "Rome"
sql_create_context
CREATE TABLE table_name_82 ( talent VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the talent of the contestant from Lexington, SC?
SELECT talent FROM table_name_82 WHERE hometown = "lexington, sc"
sql_create_context
CREATE TABLE table_203_598 ( id number, "date" text, "time" text, "opponent" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the last opponent ?
SELECT "opponent" FROM table_203_598 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_1008653_9 ( country___exonym__ VARCHAR, official_or_native_language_s___alphabet_script_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country (exonym) where the official or native language(s) (alphabet/script) is Icelandic?
SELECT country___exonym__ FROM table_1008653_9 WHERE official_or_native_language_s___alphabet_script_ = "Icelandic"
sql_create_context
CREATE TABLE table_name_53 ( lost INTEGER, matches VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average lost for matches of 6
SELECT AVG(lost) FROM table_name_53 WHERE matches = 6
sql_create_context
CREATE TABLE table_name_17 ( mark VARCHAR, athlete VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Mark has an Athlete of heike drechsler?
SELECT mark FROM table_name_17 WHERE athlete = "heike drechsler"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, value...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ...
mimic_iii
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 lab ( subject_id text, hadm_id text, ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay = "1"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
CREATE TABLE table_4540 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the largest crowd size when the away tea...
SELECT MAX("Crowd") FROM table_4540 WHERE "Away team score" = '7.11 (53)'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE diagnoses_icd ( ...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 16368) AND NOT icustays.outtime IS N...
mimic_iii
CREATE TABLE endowment ( endowment_id number, school_id number, donator_name text, amount number ) CREATE TABLE budget ( school_id number, year number, budgeted number, total_budget_percent_budgeted number, invested number, total_budget_percent_invested number, budget_invest...
SELECT county, COUNT(*), SUM(enrollment) FROM school GROUP BY county
spider
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT demographic.admittime FROM demographic WHERE demographic.name = "Jennifer Fulgham"
mimicsql_data
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 CloseAsOffTopicReasonTypes ( Id number, IsUniversal...
SELECT u.Id, u.DisplayName, u.Reputation, COUNT(*) AS "total_number_of_posts", u.Reputation / COUNT(*) AS Ratio FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId IN (1, 2) GROUP BY u.Id, u.DisplayName, u.Reputation ORDER BY u.Reputation DESC LIMIT 50
sede
CREATE TABLE table_44230 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Away team Swindon Town had a Tie no listing of Replay with what as an Attendance?
SELECT "Attendance" FROM table_44230 WHERE "Tie no" = 'replay' AND "Away team" = 'swindon town'
wikisql
CREATE TABLE table_54917 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the sum of top 5 with events less than 12 and top 25 less than 0
SELECT SUM("Top-5") FROM table_54917 WHERE "Events" < '12' AND "Top-25" < '0'
wikisql
CREATE TABLE table_61186 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the place for the score 70-72-69=211?
SELECT "Place" FROM table_61186 WHERE "Score" = '70-72-69=211'
wikisql
CREATE TABLE table_name_42 ( pba_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Richard Bachmann's PBA team?
SELECT pba_team FROM table_name_42 WHERE player = "richard bachmann"
sql_create_context
CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Payments ( Payment_ID INTEGER, S...
SELECT Date_Payment_Made, COUNT(Date_Payment_Made) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY COUNT(Date_Payment_Made) DESC
nvbench
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 meter_400, meter_100 FROM swimmer ORDER BY meter_400
nvbench
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) ...
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY enr
nvbench
CREATE TABLE table_30285 ( "English word" text, "Slovak" text, "Czech" text, "Rusyn" text, "Ukrainian" text, "Belarusian" text, "Polish" text, "Serbo-Croatian" text, "Bulgarian" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How do y...
SELECT "English word" FROM table_30285 WHERE "Ukrainian" = 'Дякую (diakuju)'
wikisql
CREATE TABLE table_25474825_1 ( description VARCHAR, license VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the description of the license for GNU GPL v2 or Ruby license?
SELECT description FROM table_25474825_1 WHERE license = "GNU GPL v2 or Ruby license"
sql_create_context
CREATE TABLE table_56444 ( "Rank" real, "Movie" text, "Year" real, "Studio(s)" text, "Opening Day Net Gross" real, "Day of Week" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the opening day of the week of Chennai Express, which had an ...
SELECT "Day of Week" FROM table_56444 WHERE "Opening Day Net Gross" > '14,76,00,000' AND "Year" = '2013' AND "Movie" = 'chennai express'
wikisql
CREATE TABLE table_63658 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Home team at the Lincoln City Away game?
SELECT "Home team" FROM table_63658 WHERE "Away team" = 'lincoln city'
wikisql
CREATE TABLE table_name_13 ( area__km²_ VARCHAR, population__2007_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Area (km ), when Population (2007) is 6,176?
SELECT COUNT(area__km²_) FROM table_name_13 WHERE population__2007_ = 6 OFFSET 176
sql_create_context
CREATE TABLE table_204_894 ( id number, "season" number, "winner" text, "score" text, "runners-up" text, "venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in what year did joe public win the trinidad and tobago league cup after losing the p...
SELECT "season" FROM table_204_894 WHERE "winner" = 'joe public'
squall
CREATE TABLE table_name_51 ( league_goals INTEGER, fa_cup_goals INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the sum of league goals when the fa cup goals is more than 0?
SELECT SUM(league_goals) FROM table_name_51 WHERE fa_cup_goals > 0
sql_create_context
CREATE TABLE table_25957 ( "Edition" text, "Round" text, "Date" text, "Against" text, "Surface" text, "Opponent" text, "Result" text, "Outcome" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the date is 7-21-2006, who was the opponent...
SELECT "Opponent" FROM table_25957 WHERE "Date" = '7-21-2006'
wikisql
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.admityear < "2170"
mimicsql_data
CREATE TABLE table_28712 ( "Rank" real, "Athlete" text, "Country" text, "Distance (metres)" text, "Points" text, "Adjusted Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the athlete for 7 rank
SELECT "Athlete" FROM table_28712 WHERE "Rank" = '7'
wikisql
CREATE TABLE table_9287 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent before October 31 with a Record of 2-3-1 after Game 5?
SELECT "Opponent" FROM table_9287 WHERE "October" < '31' AND "Game" > '5' AND "Record" = '2-3-1'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-135082')) ORDER BY lab.labresulttime LIMIT 1
eicu
CREATE TABLE table_70214 ( "Currency" text, "Code" text, "Entry ERM II" text, "Central rate" text, "Official target date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the code for Latvian Lats?
SELECT "Code" FROM table_70214 WHERE "Currency" = 'latvian lats'
wikisql
CREATE TABLE table_10015132_14 ( player VARCHAR, years_in_toronto VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played in the Toronto Raptors from 1995-96?
SELECT player FROM table_10015132_14 WHERE years_in_toronto = "1995-96"
sql_create_context
CREATE TABLE course_authors_and_tutors ( author_id number, author_tutor_atb text, login_name text, password text, personal_name text, middle_name text, family_name text, gender_mf text, address_line_1 text ) CREATE TABLE student_tests_taken ( registration_id number, date_tes...
SELECT T1.date_of_completion FROM student_course_enrolment AS T1 JOIN student_tests_taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail"
spider
CREATE TABLE table_14723 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Home Captain for 23,24,25,26 july 1992?
SELECT "Home captain" FROM table_14723 WHERE "Date" = '23,24,25,26 july 1992'
wikisql
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
atis
CREATE TABLE table_name_10 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the value in 1989 with QF in 1997 and A in 1993?
SELECT 1989 FROM table_name_10 WHERE 1997 = "qf" AND 1993 = "a"
sql_create_context
CREATE TABLE table_42812 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Mike Weir's To par?
SELECT "To par" FROM table_42812 WHERE "Player" = 'mike weir'
wikisql
CREATE TABLE table_14342210_12 ( extra_points INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the most extra points?
SELECT MAX(extra_points) FROM table_14342210_12
sql_create_context
CREATE TABLE table_name_35 ( team VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team does jan heylen race for?
SELECT team FROM table_name_35 WHERE driver = "jan heylen"
sql_create_context
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Participates_in ( stuid INTEGER...
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building DESC
nvbench
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), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), CO...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, ...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76332 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'po2') ORDER BY labevents.charttime LIMIT 1
mimic_iii
CREATE TABLE table_23018775_3 ( pos VARCHAR, total_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions have a total time of 1:30.4135?
SELECT COUNT(pos) FROM table_23018775_3 WHERE total_time = "1:30.4135"
sql_create_context
CREATE TABLE table_name_10 ( jockey VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Jockey, when Winner is Alke?
SELECT jockey FROM table_name_10 WHERE winner = "alke"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433')) AND intakeoutput.celllabel = 'urin...
eicu
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB W...
css
CREATE TABLE table_24027047_1 ( area__km²__2011 VARCHAR, administrative_division VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the area in km2 in 2011 for the Narsingdi District?
SELECT area__km²__2011 * * FROM table_24027047_1 WHERE administrative_division = "Narsingdi District"
sql_create_context
CREATE TABLE table_name_78 ( decile INTEGER, roll VARCHAR, authority VARCHAR, area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least decile for state authority and area of eketahuna with roll more than 44
SELECT MIN(decile) FROM table_name_78 WHERE authority = "state" AND area = "eketahuna" AND roll > 44
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT * 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 table_name_95 ( total INTEGER, rank VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Total, when Rank is 8, and when Bronze is less than 1?
SELECT SUM(total) FROM table_name_95 WHERE rank = "8" AND bronze < 1
sql_create_context
CREATE TABLE table_name_42 ( draws INTEGER, against VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Draws, when Against is '1547', and when Wins is greater than 3?
SELECT MIN(draws) FROM table_name_42 WHERE against = 1547 AND wins > 3
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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, ...
SELECT (SELECT t_kc24.PER_ACC_PAY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '82036681417') / (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID = '8203668141...
css
CREATE TABLE candidates ( candidate_id number, candidate_details text ) CREATE TABLE students ( student_id number, student_details text ) CREATE TABLE candidate_assessments ( candidate_id number, qualification text, assessment_date time, asessment_outcome_code text ) CREATE TABLE cour...
SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1
spider
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_35426 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of overall draft picks for Fred Nixon?
SELECT COUNT("Overall") FROM table_35426 WHERE "Player" = 'fred nixon'
wikisql
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 T2.title FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid WHERE T1.stars = 3 INTERSECT SELECT T2.title FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid WHERE T1.stars = 4
spider
CREATE TABLE appellations ( no number, appelation text, county text, state text, area text, isava text ) CREATE TABLE grapes ( id number, grape text, color text ) CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text,...
SELECT T2.name FROM appellations AS T1 JOIN wine AS T2 ON T1.appelation = T2.appelation WHERE T1.county = "Monterey" AND T2.price < 50
spider
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '魏冠宇' AND txmzjzjlb.JZKSRQ BETWEEN '2009-09-02' AND '2018-12-28' UNION SELECT COUNT(*) FROM p...
css
CREATE TABLE table_name_83 ( debut_year INTEGER, player VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the debut year for player terry fulton with games less than 51?
SELECT AVG(debut_year) FROM table_name_83 WHERE player = "terry fulton" AND games < 51
sql_create_context
CREATE TABLE table_name_84 ( venue VARCHAR, opponents VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has a Opponents of halmstad and a Score of 1-1?
SELECT venue FROM table_name_84 WHERE opponents = "halmstad" AND score = "1-1"
sql_create_context
CREATE TABLE table_name_51 ( constitutional_ticket VARCHAR, republican_ticket VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the constitutional ticken when Charles B. Sears was the republican ticket?
SELECT constitutional_ticket FROM table_name_51 WHERE republican_ticket = "charles b. sears"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airp...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CLEVELAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci...
atis
CREATE TABLE table_60324 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT SUM("Goals against") FROM table_60324 WHERE "Position" > '14' AND "Played" < '30'
wikisql
CREATE TABLE table_name_15 ( date VARCHAR, year VARCHAR, location VARCHAR, result VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the game with a loss result in the Europe/Africa Group I, Round Robin compet...
SELECT date FROM table_name_15 WHERE result = "loss" AND competition = "europe/africa group i, round robin" AND location = "murcia (esp)" AND year > 1998
sql_create_context