instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_32 ( name VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Name has a Location of ljubljana?
SELECT name FROM table_name_32 WHERE location = "ljubljana"
sql_create_context
CREATE TABLE table_1341897_3 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many candidates represent the district of kenneth a. roberts?
SELECT COUNT(candidates) FROM table_1341897_3 WHERE incumbent = "Kenneth A. Roberts"
sql_create_context
CREATE TABLE table_12523 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a Week larger than 3, and a Game site of mil...
SELECT "Opponent" FROM table_12523 WHERE "Week" > '3' AND "Game site" = 'mile high stadium' AND "Record" = '3–3'
wikisql
CREATE TABLE Flight ( distance INTEGER, price INTEGER, origin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average distance and average price for flights from Los Angeles.
SELECT AVG(distance), AVG(price) FROM Flight WHERE origin = "Los Angeles"
sql_create_context
CREATE TABLE table_66053 ( "Year" real, "Category" text, "Film" text, "Result" text, "Lost to" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the loss to for the film Chicago?
SELECT "Lost to" FROM table_66053 WHERE "Film" = 'chicago'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
SELECT patient.age FROM patient WHERE patient.uniquepid = '007-9338' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
eicu
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.short_title = "Pressure ulcer, low back"
mimicsql_data
CREATE TABLE table_name_19 ( devices_per_channel VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Devices per channel where the Name is sata revision 3.0?
SELECT devices_per_channel FROM table_name_19 WHERE name = "sata revision 3.0"
sql_create_context
CREATE TABLE table_9279 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Date of may 20?
SELECT "Score" FROM table_9279 WHERE "Date" = 'may 20'
wikisql
CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE authors ( authid number, lname text, fname text ) -...
SELECT lname FROM authors WHERE fname = "Amal"
spider
CREATE TABLE table_name_74 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the away team's score at Western Oval?
SELECT away_team AS score FROM table_name_74 WHERE venue = "western oval"
sql_create_context
CREATE TABLE table_name_58 ( round VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of rounds for the player of Rell Tipton?
SELECT COUNT(round) FROM table_name_58 WHERE player = "rell tipton"
sql_create_context
CREATE TABLE table_79934 ( "Year" real, "Awards" text, "Categorie" text, "Movie" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result at the Berlin International Film Festival in a year greater than 1987?
SELECT "Result" FROM table_79934 WHERE "Year" > '1987' AND "Awards" = 'berlin international film festival'
wikisql
CREATE TABLE table_test_21 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "tachycardia" int, "body_weight" float, "renal_disease" bool, "anaemia" bool, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "cardiogenic_shock" bool, ...
SELECT * FROM table_test_21 WHERE renal_disease = 1 OR (gender = 'male' AND prior_creatinine > 2.5) OR (gender = 'female' AND prior_creatinine > 2)
criteria2sql
CREATE TABLE nuclear_power_plants ( id text, name text, latitude text, longitude text, country text, status text, reactortype text, reactormodel text, constructionstartat text, operationalfrom text, operationalto text, capacity text, lastupdatedat text, source tex...
SELECT country FROM nuclear_power_plants GROUP BY country ORDER BY SUM(capacity) DESC LIMIT 1
geonucleardata
CREATE TABLE table_62333 ( "Year" real, "Delegate" text, "Hometown" text, "Pageant" text, "Result" text, "Other awards" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the latest year the miss internet www pageant had a result of second ru...
SELECT MAX("Year") FROM table_62333 WHERE "Pageant" = 'miss internet www' AND "Result" = 'second runner-up'
wikisql
CREATE TABLE table_57411 ( "Year" real, "Result" text, "Award" text, "Category" text, "Film or series" text, "Character" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which film or series was nominated in the category of best fansite?
SELECT "Film or series" FROM table_57411 WHERE "Result" = 'nominated' AND "Category" = 'best fansite'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM zyjybgb JOIN jyjgzbb ON zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE zyjybgb.JZLSH = '42183982937' AND jyjgzbb.JCRXM LIKE '尤%' UNION SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM mzjybgb JOIN jyjgzbb ON mzjybgb.YLJG...
css
CREATE TABLE table_41332 ( "Rank" real, "Name" text, "Years" text, "Matches" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the sum of Matches that has the Goals of 103, and the Rank larger than 9?
SELECT SUM("Matches") FROM table_41332 WHERE "Goals" = '103' AND "Rank" > '9'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Manufacturer) DESC
nvbench
CREATE TABLE table_7348 ( "Name" text, "Years" text, "League a" text, "FA Cup" text, "League Cup" text, "Other b" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Total for 1953 1964?
SELECT "Total" FROM table_7348 WHERE "Years" = '1953–1964'
wikisql
CREATE TABLE table_name_8 ( home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was at home on april 14?
SELECT home FROM table_name_8 WHERE date = "april 14"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( r...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'heparin crrt' AND DATETIME(prescriptions.startdate, 'start of yea...
mimic_iii
CREATE TABLE table_204_379 ( id number, "year" text, "title" text, "hangul" text, "network" text, "further info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the title listed before music bank ?
SELECT "title" FROM table_204_379 WHERE id = (SELECT id FROM table_204_379 WHERE "title" = 'music bank') - 1
squall
CREATE TABLE table_17282 ( "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. -- Who ha...
SELECT "High rebounds" FROM table_17282 WHERE "Date" = 'November 4'
wikisql
CREATE TABLE table_13920 ( "Position" text, "Gymnast" text, "A Score" real, "B Score" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the average B Score that has the Position of 2nd, and the Total smaller than 15.525?
SELECT AVG("B Score") FROM table_13920 WHERE "Position" = '2nd' AND "Total" < '15.525'
wikisql
CREATE TABLE table_13480122_5 ( game VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the game with record being 29 3
SELECT game FROM table_13480122_5 WHERE record = "29–3"
sql_create_context
CREATE TABLE table_46073 ( "Religion" text, "Suriname" text, "Paramaribo" text, "Wanica" text, "Nickerie" text, "Coronie" text, "Saramacca" text, "Commewijne" text, "Marowijne" text, "Para" text, "Brokopondo" text, "Sipaliwini" text ) -- Using valid SQLite, answer the f...
SELECT "Suriname" FROM table_46073 WHERE "Brokopondo" = '16.8%'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254182') AND NOT patient.admissionweight IS NULL AND patient.unitadmittime = '2104-09-10 20:41:00') - (SELECT patient.admissionweight FROM ...
eicu
CREATE TABLE table_58198 ( "Character" text, "Portrayed by" text, "Crime" text, "First appearance" text, "Last appearance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the first appearance when Chad Williams is a portrayal?
SELECT "First appearance" FROM table_58198 WHERE "Portrayed by" = 'chad williams'
wikisql
CREATE TABLE table_57171 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the loss on may 29
SELECT "Loss" FROM table_57171 WHERE "Date" = 'may 29'
wikisql
CREATE TABLE table_name_66 ( tv_time VARCHAR, road_team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the TV time for Chicago's road game against Phoenix on June 18?
SELECT tv_time FROM table_name_66 WHERE road_team = "phoenix" AND date = "june 18"
sql_create_context
CREATE TABLE table_37108 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Played has an Against larger than 11, ...
SELECT COUNT("Played") FROM table_37108 WHERE "Against" > '11' AND "Team" = 'botafogo' AND "Position" < '2'
wikisql
CREATE TABLE table_27520 ( "June 10-11" text, "March 27-29" text, "January 15-16" text, "November 3" text, "August 21-22" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the November 3 result when the result for January 15-16 is 141?
SELECT "November 3" FROM table_27520 WHERE "January 15-16" = '141'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 TABL...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = 8116) AND icustays.outtime IS NULL) ...
mimic_iii
CREATE TABLE table_21234111_6 ( jason VARCHAR, public_vote__percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the jason for public vote being 19.20%
SELECT jason FROM table_21234111_6 WHERE public_vote__percentage = "19.20%"
sql_create_context
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 person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_58330 ( "Aircraft" text, "Origin" text, "Role" text, "Registration" text, "Number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the role of the aircraft that originates from the European Union?
SELECT "Role" FROM table_58330 WHERE "Origin" = 'european union'
wikisql
CREATE TABLE table_21380 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the community with an area of 30.75 sq. km.?
SELECT "Official Name" FROM table_21380 WHERE "Area km 2" = '30.75'
wikisql
CREATE TABLE table_73496 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every surface with a score in the final of 6 4...
SELECT "Surface" FROM table_73496 WHERE "Score in the final" = '6–4, 6–7 (1–7) , 6–7 (4–7) , 4–6'
wikisql
CREATE TABLE table_34355 ( "Season" text, "Player" text, "Position" text, "Nationality" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team did the 2003-04 winner play for?
SELECT "Team" FROM table_34355 WHERE "Season" = '2003-04'
wikisql
CREATE TABLE table_name_79 ( episode_number VARCHAR, broadcast_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the episode number of the episode broadcast on 21 September 2001?
SELECT episode_number FROM table_name_79 WHERE broadcast_date = "21 september 2001"
sql_create_context
CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes int, year int, month varchar ) CREATE TABLE category ( id int, business_id varchar, category_name varchar ) CREATE TABLE neighborhood ( id int, business_id varchar, neighborhoo...
SELECT business.name FROM business, category, review, user WHERE business.rating >= 3 AND category.business_id = business.business_id AND category.category_name = 'Bars' AND review.business_id = business.business_id AND user.name = 'Patrick' AND user.user_id = review.user_id
yelp
CREATE TABLE table_name_28 ( station VARCHAR, city_of_license VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Station has hagerstown?
SELECT station FROM table_name_28 WHERE city_of_license = "hagerstown"
sql_create_context
CREATE TABLE table_36071 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the b.c. open?
SELECT "Location" FROM table_36071 WHERE "Tournament" = 'b.c. open'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Epistaxis" AND prescriptions.route = "NG"
mimicsql_data
CREATE TABLE table_71905 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Men's double held together with Women's singl...
SELECT "Men's doubles" FROM table_71905 WHERE "Women's singles" = 'camilla martin'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "77" AND procedures.short_title = "Percu endosc gastrostomy"
mimicsql_data
CREATE TABLE table_2899 ( "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. -- How many season num...
SELECT COUNT("No. in season") FROM table_2899 WHERE "U.S. viewers (millions)" = '13.54'
wikisql
CREATE TABLE table_42610 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Condition has a Bleeding time of unaffected and a P...
SELECT "Condition" FROM table_42610 WHERE "Bleeding time" = 'unaffected' AND "Prothrombin time" = 'prolonged'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Badges ( Id number, UserId number, Name t...
WITH ViewsByTag AS (SELECT pt.TagId, p.ViewCount, ROW_NUMBER() OVER (PARTITION BY pt.TagId ORDER BY p.ViewCount DESC) AS "rank" FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id) SELECT RANK() OVER (ORDER BY vt.ViewCount DESC) AS "rank", t.TagName, vt.ViewCount FROM ViewsByTag AS vt INNER JOIN Tags AS t ON ...
sede
CREATE TABLE table_31657 ( "Year" real, "Division" text, "League" text, "Reg. Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Rampage's result in the playoffs in the year that their regular s...
SELECT "Playoffs" FROM table_31657 WHERE "Reg. Season" = '4th, central'
wikisql
CREATE TABLE table_name_79 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did South Melbourne play as the Away team?
SELECT date FROM table_name_79 WHERE away_team = "south melbourne"
sql_create_context
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Open reduc-int fix femur"
mimicsql_data
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 zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '许涵映' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2012-07-16')
css
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE fare ( fare_id int, from_airport va...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 26 AND date_day.month_number = ...
atis
CREATE TABLE table_1137718_2 ( fastest_lap VARCHAR, grand_prix VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the fastest lap at the Mexican Grand Prix?
SELECT fastest_lap FROM table_1137718_2 WHERE grand_prix = "Mexican grand_prix"
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX 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.JZZDBM = 'X60.562' AND jyjgzbb.JCZBMC = '抗凝血酶III'
css
CREATE TABLE table_name_46 ( best_score INTEGER, worst_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the best average score with a bad score of 15?
SELECT AVG(best_score) FROM table_name_46 WHERE worst_score = 15
sql_create_context
CREATE TABLE table_31629 ( "Species" text, "Lived when ( mya )" text, "Lived where" text, "Fossil record" text, "Discovery / publication of name" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the discovery/publicatio of name for h.heidelber...
SELECT "Discovery / publication of name" FROM table_31629 WHERE "Species" = 'h.heidelbergensis'
wikisql
CREATE TABLE table_12505 ( "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 total average has 1988 has the year (s) won?
SELECT AVG("Total") FROM table_12505 WHERE "Year(s) won" = '1988'
wikisql
CREATE TABLE table_23308178_7 ( score VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the results for all games which involved the detroit red wings.
SELECT score FROM table_23308178_7 WHERE opponent = "Detroit Red Wings"
sql_create_context
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, meter_300 text, meter_400 text, meter_500 text, meter_600 text, ...
SELECT meter_300, ID FROM swimmer
nvbench
CREATE TABLE table_10848177_1 ( singers VARCHAR, lyricist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For which singers was Alangudi Somu the lyricist?
SELECT singers FROM table_10848177_1 WHERE lyricist = "Alangudi Somu"
sql_create_context
CREATE TABLE table_11698 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the constructor for jo bonnier of 6 rounds?
SELECT "Constructor" FROM table_11698 WHERE "Entrant" = 'jo bonnier' AND "Rounds" = '6'
wikisql
CREATE TABLE table_name_96 ( player VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player had a score of 70?
SELECT player FROM table_name_96 WHERE score = 70
sql_create_context
CREATE TABLE table_name_91 ( modulation VARCHAR, power VARCHAR, channel VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On channel 32, when the power is 32 kW horizontal, what is the modulation?
SELECT modulation FROM table_name_91 WHERE power = "32 kw horizontal" AND channel = 32
sql_create_context
CREATE TABLE table_10031 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Record, when Score is 104-99?
SELECT "Record" FROM table_10031 WHERE "Score" = '104-99'
wikisql
CREATE TABLE table_77053 ( "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 with 88.5 fm Frequency
SELECT "Power" FROM table_77053 WHERE "Frequency" = '88.5 fm'
wikisql
CREATE TABLE table_name_19 ( opponent VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent, when Attendance is 58,836?
SELECT opponent FROM table_name_19 WHERE attendance = "58,836"
sql_create_context
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
SELECT County, COUNT(County) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation GROUP BY County ORDER BY COUNT(County)
nvbench
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 School_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season
nvbench
CREATE TABLE table_31744 ( "Nomination" text, "Actor's Name" text, "Film Name" text, "Director" text, "Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the actor from russia for anastasiya slutskaya
SELECT "Actor's Name" FROM table_31744 WHERE "Film Name" = 'anastasiya slutskaya' AND "Country" = 'russia'
wikisql
CREATE TABLE table_79938 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which region is identified as 38xa-3 in the catalog?
SELECT "Region" FROM table_79938 WHERE "Catalog" = '38xa-3'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inpute...
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 = 'drug detoxification') AND STRFTIME('%y', procedures_...
mimic_iii
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 SUM(QTY), SUM(AMOUNT) FROM t_kc22 WHERE SOC_SRT_DIRE_CD = '083550229' AND STA_DATE BETWEEN '2000-06-05' AND '2011-09-11'
css
CREATE TABLE table_26314 ( "Administrative District" text, "DS Divisions" real, "GN Divisions" real, "Total Area (km 2 )" real, "Land Area (km 2 )" real, "Sri Lankan Tamil" real, "Sri Lankan Moors" real, "Sinhalese" real, "Indian Tamil" real, "Other" real, "Total" real, "...
SELECT COUNT("Other") FROM table_26314 WHERE "GN Divisions" = '95'
wikisql
CREATE TABLE table_51793 ( "Year" text, "Team" text, "Comp" text, "Long" text, "Rate" text, "RAtt" text, "RYds" text, "RAvg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the long in 1994?
SELECT "Long" FROM table_51793 WHERE "Year" = '1994'
wikisql
CREATE TABLE table_7151 ( "Event" text, "2006\u201307" text, "2007\u201308" text, "2008\u201309" text, "2009\u201310" text, "2010\u201311" text, "2011\u201312" text, "2012\u201313" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which eve...
SELECT "Event" FROM table_7151 WHERE "2010\u201311" = 'dnp'
wikisql
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, AVG(Height) FROM people GROUP BY Sex ORDER BY AVG(Height) DESC
nvbench
CREATE TABLE table_name_80 ( band VARCHAR, female VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What band performed when Samantha Mumba presented?
SELECT band FROM table_name_80 WHERE female = "samantha mumba"
sql_create_context
CREATE TABLE table_30225 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Directed by" FROM table_30225 WHERE "Production code" = '6AKY11'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2182" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, U...
SELECT t.TagName, COUNT(1) AS total FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName IN ('rsa', 'ecdsa', 'ed25519', 'dsa') AND p.CreationDate >= '1/1/2019' GROUP BY t.TagName ORDER BY total DESC
sede
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-115938')) AND DATETIME(treatment.treatmenttime) <= DATETIME(C...
eicu
CREATE TABLE table_name_67 ( rank INTEGER, date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the rank for February 11, 2012 with less than 18,735 in attendance?
SELECT AVG(rank) FROM table_name_67 WHERE date = "february 11, 2012" AND attendance < 18 OFFSET 735
sql_create_context
CREATE TABLE table_204_510 ( id number, "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 nation is next after porto on team 2
SELECT "team 2" FROM table_204_510 WHERE id = (SELECT id FROM table_204_510 WHERE "team 2" = 'porto') + 1
squall
CREATE TABLE table_name_5 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the value in 2009 when 2005 was A for the Australian Open?
SELECT 2009 FROM table_name_5 WHERE 2005 = "a" AND tournament = "australian open"
sql_create_context
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.KH, wdmzjzjlb.KLX FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '17934842650' UNION SELECT bdmzjzjlb.KH, bdmzjzjlb.KLX FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '17934842650'
css
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '07653980' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-01-04' AND '2003-06-25' GROUP BY t_kc21.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE T...
SELECT Id, age FROM Users WHERE Id IN (SELECT OwnerUserId FROM Posts WHERE PostTypeId = 1 AND NOT OwnerUserId IS NULL) ORDER BY Id
sede
CREATE TABLE table_76725 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the report at State Sports Centre?
SELECT "Report" FROM table_76725 WHERE "Venue" = 'state sports centre'
wikisql
CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255)...
SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_ID
nvbench
CREATE TABLE photos ( camera_lens_id VARCHAR ) CREATE TABLE camera_lens ( name VARCHAR, id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos....
SELECT T1.name, COUNT(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id = T2.camera_lens_id GROUP BY T1.id ORDER BY COUNT(*)
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight, food_service WHERE (((date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight...
atis
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int,...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'GREEKMOD' AND number = 503
advising
CREATE TABLE table_36838 ( "Surname" text, "First" text, "D.O.B." text, "Bats" text, "Throws" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has a DOB of 13 may 1987?
SELECT "Position" FROM table_36838 WHERE "D.O.B." = '13 may 1987'
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY"
mimicsql_data
CREATE TABLE table_name_38 ( opponent VARCHAR, rules VARCHAR, round VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a Round of 3, a Time of n/a, and a Rules of n/a?
SELECT opponent FROM table_name_38 WHERE round = "3" AND time = "n/a" AND rules = "n/a"
sql_create_context