instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15666')) AND STRFTIME('%y-%m', microlab.culturetakentime) >= ...
eicu
CREATE TABLE table_name_95 ( club VARCHAR, league_division VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club has a league/division of fourth division?
SELECT club FROM table_name_95 WHERE league_division = "fourth division"
sql_create_context
CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'alameda' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_261906_2 ( institution VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What institution(s) are located in wilkes-barre, pennsylvania?
SELECT institution FROM table_261906_2 WHERE location = "Wilkes-Barre, Pennsylvania"
sql_create_context
CREATE TABLE table_54543 ( "Pick #" real, "Player" text, "Nationality" text, "Position" text, "League from" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which league has a pick number larger than 204 from Canada and LW as the position?
SELECT "League from" FROM table_54543 WHERE "Pick #" > '204' AND "Nationality" = 'canada' AND "Position" = 'lw'
wikisql
CREATE TABLE table_21015 ( "Model number" text, "sSpec number" text, "Frequency" text, "GPU frequency" text, "L2 cache" text, "I/O bus" text, "Memory" text, "Voltage" text, "TDP" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" ...
SELECT "sSpec number" FROM table_21015 WHERE "TDP" = '3.6 W' AND "Model number" = 'Atom E665C'
wikisql
CREATE TABLE table_66292 ( "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 the to par for japan
SELECT "To par" FROM table_66292 WHERE "Country" = 'japan'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON 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 jybgb.YLJGDM = jyjgzbb...
css
CREATE TABLE table_name_96 ( december INTEGER, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which December is the lowest one that has Points of 52?
SELECT MIN(december) FROM table_name_96 WHERE points = 52
sql_create_context
CREATE TABLE table_17382360_9 ( high_rebounds VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high rebounds in the game with a final score of w 140-108?
SELECT high_rebounds FROM table_17382360_9 WHERE score = "W 140-108"
sql_create_context
CREATE TABLE table_67547 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which score has a Date of august 17?
SELECT "Score" FROM table_67547 WHERE "Date" = 'august 17'
wikisql
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, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE ((flight.departure_time <= 1600 AND flight.departure_time >= 1200) AND city.city_code = airport_service.city_code AND city.city_name = 'PITTSBURGH' AND flight.from_airport = airport_service.airport_code) AND flight.airline_code = 'US'
atis
CREATE TABLE table_name_89 ( losses INTEGER, goals_for VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the highest losses when the goal was smaller than 45 and the points was smaller than 18?
SELECT MAX(losses) FROM table_name_89 WHERE goals_for < 45 AND points < 18
sql_create_context
CREATE TABLE table_name_57 ( number_of_electorates__2009_ VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of electorates (2009) for Katol?
SELECT COUNT(number_of_electorates__2009_) FROM table_name_57 WHERE name = "katol"
sql_create_context
CREATE TABLE table_name_86 ( home_team VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What home team had 2 ties?
SELECT home_team FROM table_name_86 WHERE tie_no = "2"
sql_create_context
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, ...
SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGDH = '46227016809'
css
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Student...
SELECT middle_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_name_58 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- with a record of 73-82 what was the date?
SELECT date FROM table_name_58 WHERE record = "73-82"
sql_create_context
CREATE TABLE table_80239 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points for the cooper car company after 1959?
SELECT SUM("Points") FROM table_80239 WHERE "Entrant" = 'cooper car company' AND "Year" > '1959'
wikisql
CREATE TABLE table_26754 ( "Year" real, "Tournaments played" real, "Cuts made" real, "Wins" real, "2nd" real, "3rd" real, "Top 10s" real, "Best finish" text, "Earnings ($)" real, "Money list rank" real, "Scoring average" text, "Scoring rank" real ) -- Using valid SQLite...
SELECT MIN("Money list rank") FROM table_26754
wikisql
CREATE TABLE table_23557 ( "Year" real, "Starts" real, "Wins" 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 provided above. -- st...
SELECT COUNT("Wins") FROM table_23557 WHERE "Top 10" = '2'
wikisql
CREATE TABLE table_test_31 ( "id" int, "ejection_fraction_ef" int, "macular_disease" bool, "systemic" bool, "alt" float, "iud" bool, "condom_with_spermicide" bool, "gender" string, "meropenem" bool, "non_q_wave_myocardial_infarction" bool, "hbcab" bool, "unstable_angina" ...
SELECT * FROM table_test_31 WHERE organ_failure = 1 OR (bilirubin > 4 OR alt > 3 OR ast > 3 OR serum_creatinine > 3.5)
criteria2sql
CREATE TABLE table_2024 ( "Discipline" text, "Degree/Diploma" text, "Total Seats" real, "Recognised Seats" real, "Permitted Seats" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the recognised seats for pharmacology
SELECT "Recognised Seats" FROM table_2024 WHERE "Discipline" = 'Pharmacology'
wikisql
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
SELECT start_station_name, start_station_id FROM trip
nvbench
CREATE TABLE table_name_31 ( stadium VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the stadium past 2012?
SELECT stadium FROM table_name_31 WHERE year > 2012
sql_create_context
CREATE TABLE table_name_73 ( chassis VARCHAR, engine VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What company made the chassis when Ferrari made the engine and there were 25 points?
SELECT chassis FROM table_name_73 WHERE engine = "ferrari" AND points = 25
sql_create_context
CREATE TABLE table_name_12 ( total_population VARCHAR, male INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total population with less than 789 males?
SELECT COUNT(total_population) FROM table_name_12 WHERE male < 789
sql_create_context
CREATE TABLE table_name_96 ( closure_date VARCHAR, on_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the ensemble closed that went on air in June 2003?
SELECT closure_date FROM table_name_96 WHERE on_air_date = "june 2003"
sql_create_context
CREATE TABLE table_78415 ( "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 did carlton score while away?
SELECT "Away team score" FROM table_78415 WHERE "Away team" = 'carlton'
wikisql
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT demographic.gender, demographic.admittime FROM demographic WHERE demographic.subject_id = "26285"
mimicsql_data
CREATE TABLE table_name_20 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date did Collingwood play at home?
SELECT date FROM table_name_20 WHERE home_team = "collingwood"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-53836'))
eicu
CREATE TABLE department_stores ( dept_store_id number, dept_store_chain_id number, store_name text, store_address text, store_phone text, store_email text ) CREATE TABLE addresses ( address_id number, address_details text ) CREATE TABLE customers ( customer_id number, payment_m...
SELECT order_id, customer_id FROM customer_orders WHERE order_status_code = "Cancelled" ORDER BY order_date
spider
CREATE TABLE table_7366 ( "Position" text, "Jersey #" real, "Name" text, "Height (cm)" real, "Weight (kg)" real, "Birthdate" text, "Birthplace" text, "1983\u20131984 Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position has ...
SELECT "Position" FROM table_7366 WHERE "Height (cm)" > '180' AND "Name" = 'brian lawton'
wikisql
CREATE TABLE table_name_67 ( monarch VARCHAR, heir VARCHAR, reason VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Monarch whose Heir is Robert Curthose when the Reason is that the father became king?
SELECT monarch FROM table_name_67 WHERE heir = "robert curthose" AND reason = "father became king"
sql_create_context
CREATE TABLE table_64071 ( "Province, Community" text, "Contestant" text, "Height" real, "Hometown" text, "Geographical Regions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What contestant is from santo domingo este and has height smaller than 1....
SELECT "Contestant" FROM table_64071 WHERE "Height" < '1.79' AND "Hometown" = 'santo domingo este'
wikisql
CREATE TABLE table_26283 ( "Episode" text, "Director" text, "Writer" text, "Original air date" text, "Ratings (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air date if the ratings is 1.92 million?
SELECT "Original air date" FROM table_26283 WHERE "Ratings (millions)" = '1.92'
wikisql
CREATE TABLE MediaType ( MediaTypeId integer, Name varchar(120) ) CREATE TABLE Invoice ( InvoiceId integer, CustomerId integer, InvoiceDate datetime, BillingAddress varchar(70), BillingCity varchar(40), BillingState varchar(40), BillingCountry varchar(40), BillingPostalCode varc...
SELECT T1.Title, T1.AlbumId FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 ORDER BY T1.Title
nvbench
CREATE TABLE table_3333 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the largest ...
SELECT "Largest ethnic group (2002)" FROM table_3333 WHERE "Settlement" = 'Kosančić'
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 =...
eicu
CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid int, citedpape...
SELECT DISTINCT AUTHOR_1.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Daphne Koller' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid
scholar
CREATE TABLE table_204_144 ( id number, "represent" number, "contestant" text, "age" number, "height" text, "hometown" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many contestants were below 1.75 mts ?
SELECT COUNT("contestant") FROM table_204_144 WHERE "height" < 1.75
squall
CREATE TABLE table_10477224_1 ( sepal_length VARCHAR, sepal_width VARCHAR, petal_width VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sepal lengh when sepal width is 2.9 and petal width 1.3
SELECT sepal_length FROM table_10477224_1 WHERE sepal_width = "2.9" AND petal_width = "1.3"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId ...
SELECT Id, CAST(TIME_TO_STR(CreationDate, '%d %b %Y') AS TEXT(11)) AS "Member since", DisplayName, Reputation, WebsiteUrl FROM Users WHERE Location LIKE '%Samara%' ORDER BY Reputation DESC LIMIT 100
sede
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 = 'docusate sodium (colace) cap 100 mg' AND STRFTIME('...
eicu
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Bod...
SELECT OwnerUserId AS "user_link", (SELECT COUNT(*) FROM Posts AS p WHERE p.OwnerUserId = Posts.OwnerUserId AND Score <= @ScoreThreshold AND PostTypeId = 2 AND CommunityOwnedDate IS NULL) * 100.0 / COUNT(*) AS "%_below_threshold", COUNT(*) AS "total_answers" FROM Posts WHERE PostTypeId = 2 AND CommunityOwnedDate IS NUL...
sede
CREATE TABLE table_name_37 ( france VARCHAR, _percentage_people_under_18__2005_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE FRANCE WITH PEOPLE UNDER 18 OF SUB-SAHARAN AFRICA?
SELECT france FROM table_name_37 WHERE _percentage_people_under_18__2005_ = "sub-saharan africa"
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Implant of pulsation balloon"
mimicsql_data
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1205) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemi...
mimic_iii
CREATE TABLE table_name_43 ( score VARCHAR, tie_no VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score when the Tie no is replay, and the away team is York City?
SELECT score FROM table_name_43 WHERE tie_no = "replay" AND away_team = "york city"
sql_create_context
CREATE TABLE table_20097 ( "Name" text, "Position" text, "Number" real, "School/Club Team" text, "Season" real, "Acquisition via" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the position for judy-ann ramirez
SELECT "Position" FROM table_20097 WHERE "Name" = 'judy-ann ramirez'
wikisql
CREATE TABLE table_name_8 ( total INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average total that is 1st in 2010?
SELECT AVG(total) FROM table_name_8 WHERE 2010 = "1st"
sql_create_context
CREATE TABLE table_name_68 ( gold INTEGER, silver INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has the lowest gold and 0 silver?
SELECT MIN(gold) FROM table_name_68 WHERE silver < 0
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "7" AND diagnoses.short_title = "Hx-ven thrombosis/embols"
mimicsql_data
CREATE TABLE table_name_10 ( date VARCHAR, road_team VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of Game 5 with Road Team St. Louis?
SELECT date FROM table_name_10 WHERE road_team = "st. louis" AND game = "game 5"
sql_create_context
CREATE TABLE table_name_93 ( different_holders INTEGER, country VARCHAR, giro_wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the least different holders when the country is ireland and giro wins is less than 1?
SELECT MIN(different_holders) FROM table_name_93 WHERE country = "ireland" AND giro_wins < 1
sql_create_context
CREATE TABLE table_57027 ( "Country" text, "Release Date" real, "Music Label" text, "Media" text, "Catalogue Number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release date by Editions EG in the Netherlands?
SELECT AVG("Release Date") FROM table_57027 WHERE "Music Label" = 'editions eg' AND "Country" = 'netherlands'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id...
SELECT p.Id AS "post_link", Title, p.Tags AS Tags, p.ViewCount AS "Views", p.Score AS "Score", p.AnswerCount AS "Answers", DATEDIFF(day, p.CreationDate, GETDATE()) AS "Age (days)", p.AcceptedAnswerId AS "Answer Accepted?" FROM Posts AS p WHERE p.CreationDate >= '20160501' AND (p.Tags LIKE '%<uwp>%' OR p.Tags LIKE '%<wi...
sede
CREATE TABLE table_204_681 ( id number, "2011 rank" number, "2010 rank" number, "2009 rank" number, "2008 rank" number, "2007 rank" number, "company (country)" text, "2011 arms sales (us$ m.)" number, "2010 arms sales (us$ m.)" number, "2009 arms sales (us$ m.)" number, "2008...
SELECT ABS((SELECT "2010 arms sales (us$ m.)" FROM table_204_681 WHERE "company (country)" = 'boeing') - (SELECT "2010 arms sales (us$ m.)" FROM table_204_681 WHERE "company (country)" = 'raytheon'))
squall
CREATE TABLE table_35145 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Date" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time is associated with the event that happened...
SELECT "Time" FROM table_35145 WHERE "Location" = 'tokyo, japan' AND "Round" = '3' AND "Res." = 'draw'
wikisql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jybgb JOIN jyjgzbb ON jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE jybgb.JZLSH = '81824209749' AND jyjgzbb.JCRXM LIKE '曹%'
css
CREATE TABLE driverStandings ( driverStandingsId INTEGER, raceId INTEGER, driverId INTEGER, points REAL, position INTEGER, positionText TEXT, wins INTEGER ) CREATE TABLE constructors ( constructorId INTEGER, constructorRef TEXT, name TEXT, nationality TEXT, url TEXT ) C...
SELECT location, circuitId FROM circuits WHERE country = "France" OR country = "Belgium" ORDER BY circuitId DESC
nvbench
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined b...
SELECT * FROM Posts WHERE PostTypeId = 1 ORDER BY RAND() LIMIT 5000
sede
CREATE TABLE table_77865 ( "CERCLIS ID" text, "Name" text, "County" text, "Proposed" text, "Listed" text, "Construction completed" text, "Partially deleted" text, "Deleted" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was the site...
SELECT "Listed" FROM table_77865 WHERE "County" = 'cochise'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id...
SELECT Id AS "post_link", CreationDate AS "date", Tags FROM Posts WHERE ClosedDate IS NULL AND NOT Tags LIKE '%c%' AND NOT Tags LIKE '%c++%' AND NOT Tags LIKE '%java%' AND NOT Tags LIKE '%c#%' AND NOT Tags LIKE '%javascript%' ORDER BY CreationDate LIMIT 500
sede
CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CREATE TABLE Drama_Workshop_Groups ( Workshop_Group_ID INTEGER, Address_ID I...
SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name
nvbench
CREATE TABLE table_19131921_1 ( station VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which station has the frequency of 107.3?
SELECT station FROM table_19131921_1 WHERE frequency = "107.3"
sql_create_context
CREATE TABLE table_train_189 ( "id" int, "alt" float, "hyperglycemia" bool, "liver_disease" bool, "smoking" bool, "alcohol_abuse" bool, "drug_abuse" bool, "triglyceride_tg" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT * FROM table_train_189 WHERE hyperglycemia = 1
criteria2sql
CREATE TABLE table_name_76 ( month VARCHAR, us__2013_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which month in 2013 did the U.S. use the ruby birthstone?
SELECT month FROM table_name_76 WHERE us__2013_ = "ruby"
sql_create_context
CREATE TABLE table_76880 ( "Name" text, "Built" text, "Listed" text, "Location" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year was the bridge in Lovell built?
SELECT "Built" FROM table_76880 WHERE "Location" = 'lovell'
wikisql
CREATE TABLE table_43370 ( "Season" text, "Competition" text, "Round" text, "Opponent" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent with a Round of q2, in the 2005 06 season?
SELECT "Opponent" FROM table_43370 WHERE "Round" = 'q2' AND "Season" = '2005–06'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1314915' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD
css
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, weight int, capacity int, pay_load int, cruising_speed int, range_...
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 = 'DALLAS' AND date_day.day_number = 20 AND date_day.month_number = 1 AND d...
atis
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 CHA_ITEM_LEV FROM t_kc22 WHERE MED_CLINIC_ID = '47926784262' AND SOC_SRT_DIRE_CD = '8439'
css
CREATE TABLE table_name_80 ( build_date VARCHAR, total_produced VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the build date when total produced is 2?
SELECT build_date FROM table_name_80 WHERE total_produced = 2
sql_create_context
CREATE TABLE table_37938 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position had fewer rounds than 3, and an overall of less than 48?
SELECT "Position" FROM table_37938 WHERE "Round" < '3' AND "Overall" < '48'
wikisql
CREATE TABLE table_204_524 ( id number, "season" text, "tier" number, "division" text, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many years has this team been a part of the 1s aut . pref . division ?
SELECT COUNT("season") FROM table_204_524 WHERE "division" = '1a aut. pref'
squall
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Course_Authors_and_Tutors ( author_id IN...
SELECT login_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_name_48 ( week VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which week's game was attended by 33,057 people?
SELECT week FROM table_name_48 WHERE attendance = "33,057"
sql_create_context
CREATE TABLE table_1979203_1 ( branding VARCHAR, _virtual_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the branding where the virtual is 13.1
SELECT branding FROM table_1979203_1 WHERE _virtual_ = "13.1"
sql_create_context
CREATE TABLE table_name_66 ( date VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Partner of daniella dominikovic?
SELECT date FROM table_name_66 WHERE partner = "daniella dominikovic"
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 Visits_Restaurant ( StuID INTEGER, ResID INTEGER, Time TIMESTAMP, Spent FLOAT ) CREATE TABLE Rest...
SELECT Fname, COUNT(Fname) FROM Student WHERE Age > 18 AND Major <> 600 AND Sex = 'F' GROUP BY Fname
nvbench
CREATE TABLE table_18808 ( "Rank by average" real, "Competition finish" real, "Couple" text, "Total" real, "Number of dances" real, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- tell the mean of the times competition for the 7 jigs
SELECT "Rank by average" FROM table_18808 WHERE "Number of dances" = '7'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( program_id int, name v...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'SURVMETH' AND number = 600
advising
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id ...
SELECT (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 = 15794)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURREN...
mimic_iii
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE TagSynonyms ( Id number...
SELECT * FROM Users WHERE Age BETWEEN 18 AND 60 AND DATEDIFF(day, LastAccessDate, GETDATE()) < 60 AND NOT Location IS NULL
sede
CREATE TABLE table_name_78 ( d_47 VARCHAR, d_41 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the D 47 for D 41 being r 21
SELECT d_47 FROM table_name_78 WHERE d_41 = "r 21"
sql_create_context
CREATE TABLE table_name_20 ( goals_against INTEGER, drawn INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many goals against when the draws are fewer than 3?
SELECT MAX(goals_against) FROM table_name_20 WHERE drawn < 3
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.drug = "Furosemide"
mimicsql_data
CREATE TABLE table_47848 ( "Date" text, "Venue" text, "Result" text, "Scored" real, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times did Sham Kwok Fai score in the game that was played on 22 February 2006?
SELECT SUM("Scored") FROM table_47848 WHERE "Date" = '22 february 2006'
wikisql
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), oth...
SELECT investor_id, AVG(share_count) FROM Transactions GROUP BY investor_id
nvbench
CREATE TABLE table_203_506 ( id number, "opponent" text, "played" number, "won" number, "lost" number, "drawn" number, "% won overall" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- teams where the number of games played was the same as numb...
SELECT "opponent" FROM table_203_506 WHERE "played" = "won"
squall
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair_assignment ( ...
SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name ORDER BY COUNT(*)
nvbench
CREATE TABLE table_78898 ( "Name" text, "Wins" real, "Start" text, "Duration" text, "Defeated by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins, on average, were defeated by furuichi?
SELECT AVG("Wins") FROM table_78898 WHERE "Defeated by" = 'furuichi'
wikisql
CREATE TABLE table_name_88 ( heat INTEGER, nationality VARCHAR, lane VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the least number of heats with more than 8 lanes for the Nationality of Germany?
SELECT MIN(heat) FROM table_name_88 WHERE nationality = "germany" AND lane > 8
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 (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4045580' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-07-15' AND '2011-09-29' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 7992.28) AS T
css
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the ages of all of Zach's friends who are...
SELECT T1.age FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT MAX(year) FROM personfriend WHERE name = 'Zach')
spider
CREATE TABLE table_name_98 ( driver VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What driver has grid number 18?
SELECT driver FROM table_name_98 WHERE grid = 18
sql_create_context
CREATE TABLE table_20156 ( "Kinship" text, "Proto-Austronesian" text, "Proto-Malayo-Polynesian" text, "Proto-Oceanic" text, "Proto-Polynesian" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the proto oceanic for *fafine
SELECT "Proto-Oceanic" FROM table_20156 WHERE "Proto-Polynesian" = '*fafine'
wikisql
CREATE TABLE table_34403 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has a Round larger than 6, and a Player of neil pilon?
SELECT "Position" FROM table_34403 WHERE "Round" > '6' AND "Player" = 'neil pilon'
wikisql