instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_23014923_1 ( season VARCHAR, intermediate__south__winners VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year of the season if the intermediate (South) winners is Southmead Athletic?
SELECT season FROM table_23014923_1 WHERE intermediate__south__winners = "Southmead Athletic"
sql_create_context
CREATE TABLE table_42379 ( "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 1st leg has 52-70 as the agg.?
SELECT "1st leg" FROM table_42379 WHERE "Agg." = '52-70'
wikisql
CREATE TABLE table_33670 ( "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. -- ON WHAT DATE DID THE HOME TEAM SCORE 12.16 (88)?...
SELECT "Date" FROM table_33670 WHERE "Home team score" = '12.16 (88)'
wikisql
CREATE TABLE table_63732 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the player when the team is oakland raiders?
SELECT "Player" FROM table_63732 WHERE "Team" = 'oakland raiders'
wikisql
CREATE TABLE table_203_734 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what competition is lorenzo 's top position in ?
SELECT "competition" FROM table_203_734 ORDER BY "position" LIMIT 1
squall
CREATE TABLE table_26275503_2 ( kickoff VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different kickoffs happened when the oppenent was at Rhein Fire?
SELECT COUNT(kickoff) FROM table_26275503_2 WHERE opponent = "at Rhein Fire"
sql_create_context
CREATE TABLE table_61469 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Lincoln City was the away team what is the tie number?
SELECT "Tie no" FROM table_61469 WHERE "Away team" = 'lincoln city'
wikisql
CREATE TABLE table_name_86 ( points INTEGER, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the fewest points of 5 place
SELECT MIN(points) FROM table_name_86 WHERE place = 5
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate tim...
SELECT u.Id, u.DisplayName, u.Reputation, COUNT(*) AS "total_number_of_posts", CAST(u.Reputation AS FLOAT) / COUNT(*) AS Ratio FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId IN (1, 2) AND u.Reputation > 100 GROUP BY u.Id, u.DisplayName, u.Reputation ORDER BY Ratio LIMIT 1000
sede
CREATE TABLE table_name_98 ( club_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the club team for Kyle de Coste?
SELECT club_team FROM table_name_98 WHERE player = "kyle de coste"
sql_create_context
CREATE TABLE table_203_689 ( id number, "date" text, "opponent" text, "score" text, "result" text, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many games did the mercury play in june ?
SELECT COUNT(*) FROM table_203_689 WHERE "date" = 6
squall
CREATE TABLE table_2902 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the ep...
SELECT "Directed by" FROM table_2902 WHERE "Title" = 'Redemptio'
wikisql
CREATE TABLE table_59048 ( "Name" text, "Location" text, "Years as tallest" text, "Height metres / ft" text, "Floors" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Years as tallest has a Height metres / ft of 07.0 150 / 493 [b ]?
SELECT "Years as tallest" FROM table_59048 WHERE "Height metres / ft" = '07.0 150 / 493 [b ]'
wikisql
CREATE TABLE table_23975 ( "Model Type" text, "Model Designation" text, "Engine" text, "Wheelbase (mm/inch)" text, "GVW (kg/ton)" text, "Axle Ratio" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of engine does the model with model des...
SELECT "Engine" FROM table_23975 WHERE "Model Designation" = '97100'
wikisql
CREATE TABLE table_4717 ( "Round" real, "Overall" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position and school/club team of Oklahoma state has an overall less than 410 and a round s...
SELECT "Position" FROM table_4717 WHERE "Overall" < '410' AND "Round" < '5' AND "School/Club Team" = 'oklahoma state'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, ...
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5310)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT_TIME(),...
mimic_iii
CREATE TABLE table_68909 ( "Round" text, "Name" text, "Song" text, "Score" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round is a lower score than 21.5?
SELECT "Round" FROM table_68909 WHERE "Score" < '21.5'
wikisql
CREATE TABLE table_65587 ( "Actor" text, "Character" text, "Soap Opera" text, "Years" text, "Duration" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the years that have a duration of 15 years and giulia poggi as the character?
SELECT "Years" FROM table_65587 WHERE "Duration" = '15 years' AND "Character" = 'giulia poggi'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
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 = '027-136480')) AND treatment.treatmentname = 'bronchodilator - met...
eicu
CREATE TABLE table_name_34 ( decile VARCHAR, area VARCHAR, authority VARCHAR, roll VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Decile has an Authority of state, a Roll smaller than 61, and an Area of kotemaori?
SELECT decile FROM table_name_34 WHERE authority = "state" AND roll < 61 AND area = "kotemaori"
sql_create_context
CREATE TABLE table_name_28 ( year INTEGER, competition VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Year when the Competition was friendly, and a Club of everton?
SELECT AVG(year) FROM table_name_28 WHERE competition = "friendly" AND club = "everton"
sql_create_context
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '8996226' AND BGRQ BETWEEN '2010-06-14' AND '2013-12-07' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL) LIMIT 26
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "43" AND diagnoses.short_title = "Prob-head/neck/trunk NOS"
mimicsql_data
CREATE TABLE table_64004 ( "Wimmera FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total losses when there are 8 wins and less than 2 byes?
SELECT SUM("Losses") FROM table_64004 WHERE "Wins" = '8' AND "Byes" < '2'
wikisql
CREATE TABLE table_name_41 ( college VARCHAR, overall VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college had an overall smaller than 315 in round 17?
SELECT college FROM table_name_41 WHERE overall < 315 AND round = 17
sql_create_context
CREATE TABLE table_23257 ( "School" text, "Baseball stadium" text, "Softball stadium" text, "Basketball arena" text, "Capacity" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the baseball stadium for the school with the Murray Ce...
SELECT "Baseball stadium" FROM table_23257 WHERE "Basketball arena" = 'The Murray Center'
wikisql
CREATE TABLE table_name_40 ( location VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location for the buick-goodwrench open?
SELECT location FROM table_name_40 WHERE tournament = "buick-goodwrench open"
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int,...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND CITY...
atis
CREATE TABLE table_30447 ( "Episode" text, "Date Aired" text, "Timeslot" text, "Rating" text, "Nightly Rank" real, "Weekly Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rating of episode 1.04?
SELECT "Rating" FROM table_30447 WHERE "Episode" = '1.04'
wikisql
CREATE TABLE table_name_69 ( rank INTEGER, city VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average rank of the city of el paso, which has a population greater than 672,538?
SELECT AVG(rank) FROM table_name_69 WHERE city = "el paso" AND population > 672 OFFSET 538
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
SELECT T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name ORDER BY COUNT(T4.Name) DESC
nvbench
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '慢性咽炎' AND jyjgzbb.JCZBDM = '491442'
css
CREATE TABLE table_22581 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT MAX("Poles") FROM table_22581 WHERE "Year" = '2000'
wikisql
CREATE TABLE table_15726 ( "State" text, "Name" text, "Hometown" text, "Age 1" real, "Height" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which state's delegate is from Lexington, Ky and is 5'4' tall?
SELECT "State" FROM table_15726 WHERE "Height" = '5''4' AND "Hometown" = 'lexington, ky'
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, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY Team_ID
nvbench
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1054385' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-03-19' AND '2008-05-29' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1054385' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-03-19' AND '2008-05-29' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = ...
css
CREATE TABLE table_45056 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What surface did hayley ericksen play on?
SELECT "Surface" FROM table_45056 WHERE "Partner" = 'hayley ericksen'
wikisql
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT KH, KLX FROM mzjzjlb WHERE JZLSH = '89956655081'
css
CREATE TABLE table_26647 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the successor that was formally installed on...
SELECT "Successor" FROM table_26647 WHERE "Date of successors formal installation" = 'March 30, 1870'
wikisql
CREATE TABLE table_28742659_2 ( eliminated VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is listed in eliminated when the finish is 15th voted out 9th jury Member Day 46?
SELECT eliminated FROM table_28742659_2 WHERE finish = "15th voted Out 9th Jury Member Day 46"
sql_create_context
CREATE TABLE table_name_2 ( chief_judge VARCHAR, appointed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did Clinton appoint as a Chief Judge?
SELECT chief_judge FROM table_name_2 WHERE appointed_by = "clinton"
sql_create_context
CREATE TABLE table_name_24 ( title_rank VARCHAR, series VARCHAR, character VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title rank of the actor who played the character of arthur hastings during series 1-8, 13?
SELECT title_rank FROM table_name_24 WHERE series = "1-8, 13" AND character = "arthur hastings"
sql_create_context
CREATE TABLE On_Call ( Nurse INTEGER, BlockFloor INTEGER, BlockCode INTEGER, OnCallStart DATETIME, OnCallEnd DATETIME ) CREATE TABLE Physician ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), SSN INTEGER ) CREATE TABLE Undergoes ( Patient INTEGER, Procedures IN...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Physician AS T2 ON T1.Physician = T2.EmployeeID GROUP BY Name ORDER BY COUNT(Name)
nvbench
CREATE TABLE table_15313204_1 ( records VARCHAR, pct VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the record(s) for the team with a winning percentage of .464?
SELECT records FROM table_15313204_1 WHERE pct = ".464"
sql_create_context
CREATE TABLE table_18257 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the result with candidates being billy tauzin (d) unopposed
SELECT "Result" FROM table_18257 WHERE "Candidates" = 'Billy Tauzin (D) Unopposed'
wikisql
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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Syncope and collapse"
mimicsql_data
CREATE TABLE table_name_57 ( result VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the results of week 12?
SELECT result FROM table_name_57 WHERE week = 12
sql_create_context
CREATE TABLE table_name_85 ( nationality VARCHAR, position_s_ VARCHAR, season_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of the player who played guard in 2006?
SELECT nationality FROM table_name_85 WHERE position_s_ = "guard" AND season_s_ = "2006"
sql_create_context
CREATE TABLE table_10408617_5 ( tariff_code VARCHAR, bts_retail_price__regulated_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tariff codes have a bts retail price of 2.553p/min?
SELECT COUNT(tariff_code) FROM table_10408617_5 WHERE bts_retail_price__regulated_ = "2.553p/min"
sql_create_context
CREATE TABLE table_21563298_1 ( roll INTEGER, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many kids go to Brechin High School?
SELECT MAX(roll) FROM table_21563298_1 WHERE school = "Brechin High school"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutpu...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-12011')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
CREATE TABLE table_204_522 ( id number, "boat #" text, "name" text, "builder" text, "laid down" text, "launched" text, "completed" text, "fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which was scuttled earlier , ha-206 or ha-208 ...
SELECT "name" FROM table_204_522 WHERE "name" IN ('ha-206', 'ha-208') ORDER BY "launched" LIMIT 1
squall
CREATE TABLE table_name_56 ( fa_cup INTEGER, malaysia_cup VARCHAR, league VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average FA cup that has a league of 0, fahmi hatta as the player, with a Malaysia cup less than 0?
SELECT AVG(fa_cup) FROM table_name_56 WHERE league = 0 AND player = "fahmi hatta" AND malaysia_cup < 0
sql_create_context
CREATE TABLE table_name_27 ( overall VARCHAR, position VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT WAS THE OVERALL NUMBER WITH A POSITON OF DB, AND ROUND GREATER THAN 8?
SELECT COUNT(overall) FROM table_name_27 WHERE position = "db" AND round > 8
sql_create_context
CREATE TABLE table_25356350_3 ( original_air_date VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the air date of the episode written by Itamar Moses?
SELECT original_air_date FROM table_25356350_3 WHERE written_by = "Itamar Moses"
sql_create_context
CREATE TABLE table_name_54 ( top_fives INTEGER, poles VARCHAR, top_tens VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of top fives when casey mears had more than 1 poles and top tens less than 9?
SELECT SUM(top_fives) FROM table_name_54 WHERE poles > 1 AND top_tens < 9
sql_create_context
CREATE TABLE Employee ( EmployeeId integer, LastName varchar(20), FirstName varchar(20), Title varchar(30), ReportsTo integer, BirthDate datetime, HireDate datetime, Address varchar(70), City varchar(40), State varchar(40), Country varchar(40), PostalCode varchar(10), ...
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY Phone DESC
nvbench
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%yerevan%' OR LOWER(Location) LIKE '%armenia%') ORDER BY Reputation DESC
sede
CREATE TABLE table_name_20 ( city_of_license VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is City of License, when Frequency is 101.1?
SELECT city_of_license FROM table_name_20 WHERE frequency = "101.1"
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.short_title = "Pseudomonas infect NOS"
mimicsql_data
CREATE TABLE table_44009 ( "Round" real, "Pick" real, "Name" text, "Position" text, "College" text, "AAFC Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which College has a Name of hardy brown?
SELECT "College" FROM table_44009 WHERE "Name" = 'hardy brown'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE table_24285393_1 ( country_or_region VARCHAR, highest_point VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has the most height in the northwestern peak of rysy?
SELECT country_or_region FROM table_24285393_1 WHERE highest_point = "Northwestern peak of Rysy"
sql_create_context
CREATE TABLE table_11622255_1 ( tournament VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the tournament where winner is raymond floyd (1)
SELECT tournament FROM table_11622255_1 WHERE winner = "Raymond Floyd (1)"
sql_create_context
CREATE TABLE table_39131 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was Montreal the visitor?
SELECT "Date" FROM table_39131 WHERE "Visitor" = 'montreal'
wikisql
CREATE TABLE table_21789 ( "Poll Source" text, "Dates administered" text, "Democrat: John Lynch" text, "Republican: Joe Kenney" text, "Lead Margin" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most lead margin for republican joe kenney be...
SELECT MAX("Lead Margin") FROM table_21789 WHERE "Republican: Joe Kenney" = '23%'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'famotidine (pf) 20 mg/2 ml iv soln' AND DATETIME(me...
eicu
CREATE TABLE table_name_70 ( bronze INTEGER, gold VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of bronze medals for a country with less than 1 gold and 0 silver?
SELECT MIN(bronze) FROM table_name_70 WHERE gold = 1 AND silver < 0
sql_create_context
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 jybgb.BGDH FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '43179204' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO...
css
CREATE TABLE table_name_53 ( basikal VARCHAR, ikut VARCHAR, mana VARCHAR, pergi VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is basikal when mana is mano, pergi is gi and Ikut is turuk?
SELECT basikal FROM table_name_53 WHERE mana = "mano" AND pergi = "gi" AND ikut = "turuk"
sql_create_context
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 COUNT(*) FROM t_kc21 WHERE PERSON_ID = '07375083' AND CLINIC_TYPE = '住院' AND MOD(MED_AMOUT, 1) = 0
css
CREATE TABLE table_41959 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Leading scorer had a Score of 80 112?
SELECT "Leading scorer" FROM table_41959 WHERE "Score" = '80–112'
wikisql
CREATE TABLE d_icd_diagnoses ( 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 prescriptions ( row_id number, subject_id number, hadm_id number, ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month...
mimic_iii
CREATE TABLE table_18380 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which district elected incumbent Earle Cabell?
SELECT "District" FROM table_18380 WHERE "Incumbent" = 'Earle Cabell'
wikisql
CREATE TABLE table_name_66 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the Indians play a game with a record of 28-41?
SELECT date FROM table_name_66 WHERE record = "28-41"
sql_create_context
CREATE TABLE table_78380 ( "Season" text, "1st Division" text, "Relegated" text, "2nd Division" text, "Promoted" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was relegated in the 2nd division of middlesex?
SELECT "Relegated" FROM table_78380 WHERE "2nd Division" = 'middlesex'
wikisql
CREATE TABLE table_77029 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the decision of the game on January 13?
SELECT "Decision" FROM table_77029 WHERE "Date" = 'january 13'
wikisql
CREATE TABLE table_name_21 ( city VARCHAR, group VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHat kind of 2009 season has a City of panama city, and a Group of group b?
SELECT 2009 AS _season FROM table_name_21 WHERE city = "panama city" AND group = "group b"
sql_create_context
CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age...
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY COUNT(*)
nvbench
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT t.TagName, t2.TagName FROM Tags AS t, Tags AS t2 WHERE t.TagName = REPLACE(t2.TagName, '.', '') AND t.Id != t2.Id
sede
CREATE TABLE table_name_50 ( lost VARCHAR, try_bp VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell the Lost that has the Try BP of 10, and the Club of uwic rfc?
SELECT lost FROM table_name_50 WHERE try_bp = "10" AND club = "uwic rfc"
sql_create_context
CREATE TABLE table_56033 ( "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 team owns the Venue of western oval?
SELECT "Home team" FROM table_56033 WHERE "Venue" = 'western oval'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( ...
SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'sodium' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '012-4131' AND NOT patient...
eicu
CREATE TABLE table_65334 ( "Vessel" text, "Origin" text, "Type" text, "In service" real, "Unit" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type for a vessel of lublin class?
SELECT "Type" FROM table_65334 WHERE "Vessel" = 'lublin class'
wikisql
CREATE TABLE table_6815 ( "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. -- What is the hig...
SELECT MAX("Loses") FROM table_6815 WHERE "Draws" < '3' AND "Points" = '51'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-42654')) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-54 month')
eicu
CREATE TABLE table_5979 ( "Year" text, "Total matches" real, "Total W-L-H" text, "Singles W-L-H" text, "Points won" real, "Points %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Total matches is the highest one that has Points % of 70%?
SELECT MAX("Total matches") FROM table_5979 WHERE "Points %" = '70%'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE VoteTypes ( Id number, Name text...
SELECT Tags.TagName, Tags.Count FROM Tags WHERE Tags.Id IN (SELECT PostTags.TagId FROM PostTags WHERE PostTags.PostId IN (SELECT Posts.Id FROM Posts WHERE YEAR(Posts.CreationDate) = 2017)) ORDER BY (Tags.Count) DESC LIMIT 10
sede
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, ...
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_25376 ( "No." real, "Player" text, "Hometown" text, "Class" text, "Position" text, "Height" text, "Weight" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every number for the hometown of Canton, Illinois?
SELECT "No." FROM table_25376 WHERE "Hometown" = 'Canton, Illinois'
wikisql
CREATE TABLE table_74335 ( "Team" text, "Stadium" text, "Home Games" real, "Average Attendance" real, "Total Attendance" real, "Capacity Percentage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the capacity for the Denver Broncos?
SELECT "Capacity Percentage" FROM table_74335 WHERE "Team" = 'Denver Broncos'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'tobramycin - random' AND STRFTIME('%y', lab.labresulttime) >= '2103')
eicu
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 WHERE demographic.ethnicity = "ASIAN" AND demographic.admityear < "2110"
mimicsql_data
CREATE TABLE reservations ( code number, room text, checkin text, checkout text, rate number, lastname text, firstname text, adults number, kids number ) CREATE TABLE rooms ( roomid text, roomname text, beds number, bedtype text, maxoccupancy number, basepric...
SELECT T2.decor FROM reservations AS T1 JOIN rooms AS T2 ON T1.room = T2.roomid GROUP BY T2.decor ORDER BY COUNT(T2.decor) LIMIT 1
spider
CREATE TABLE table_62449 ( "Date" text, "Result" text, "Competition" text, "Venue" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the competition of the Emerging Nations Tournament and a result of Scotland 34-9 Russi...
SELECT "Date" FROM table_62449 WHERE "Competition" = 'emerging nations tournament' AND "Result" = 'scotland 34-9 russia'
wikisql
CREATE TABLE table_name_31 ( assist_pass VARCHAR, goal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Assist/pass has a Goal of 5?
SELECT assist_pass FROM table_name_31 WHERE goal = "5"
sql_create_context
CREATE TABLE table_33070 ( "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. -- Who was the away team when the home team scored ...
SELECT "Away team" FROM table_33070 WHERE "Home team score" = '9.16 (70)'
wikisql
CREATE TABLE table_name_12 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the venue of Glenferrie Oval?
SELECT date FROM table_name_12 WHERE venue = "glenferrie oval"
sql_create_context
CREATE TABLE table_57036 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the gte north classic tournament?
SELECT "Date" FROM table_57036 WHERE "Tournament" = 'gte north classic'
wikisql
CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARC...
SELECT other_details, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench