instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_67 ( year_built INTEGER, parish___prestegjeld__ VARCHAR, location_of_the_church VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year Built has a Parish (Prestegjeld) of bremanger parish, and a Location of the Church of breman...
SELECT AVG(year_built) FROM table_name_67 WHERE parish___prestegjeld__ = "bremanger parish" AND location_of_the_church = "bremanger"
sql_create_context
CREATE TABLE table_8040 ( "Year started" real, "Number of cars" real, "Current car" text, "Car #" real, "Website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT WAS THE LOWEST CAR # WITH SON-E-WA, AND 2012 START YEAR?
SELECT MIN("Car #") FROM table_8040 WHERE "Current car" = 'son-e-wa' AND "Year started" < '2012'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
SELECT * FROM Tags AS t WHERE t.TagName = 'php'
sede
CREATE TABLE table_1569625_1 ( margin_of_victory VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the margin of victory when tournament is algarve open de portugal
SELECT margin_of_victory FROM table_1569625_1 WHERE tournament = "Algarve Open de Portugal"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text,...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-11591')) AND vitalperiodic.heartrate < 88.0 AND NOT vitalperiodi...
eicu
CREATE TABLE table_name_11 ( date VARCHAR, visitor VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the game where the vistor team was the Knicks and more than 18,165 were in attendance?
SELECT date FROM table_name_11 WHERE visitor = "knicks" AND attendance > 18 OFFSET 165
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Hypopotassemia"
mimicsql_data
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 t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-12985') AND treatment.treatme...
eicu
CREATE TABLE table_48971 ( "Player" text, "Country" text, "Year(s) won" text, "Total" text, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the tom watson is playing for the United States and the To par is under 14, what's the total?
SELECT "Total" FROM table_48971 WHERE "Country" = 'united states' AND "To par" < '14' AND "Player" = 'tom watson'
wikisql
CREATE TABLE table_14450 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For Pontyb...
SELECT "Played" FROM table_14450 WHERE "Try bonus" = '2' AND "Club" = 'pontyberem rfc'
wikisql
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 COUNT(*) AS Count, MAX(s.CreationDate), v.UserId AS "user_link", uu.Reputation AS MainUserReputation, s.OwnerUserId AS "user_link", su.Reputation AS SuggesterReputation, su.CreationDate AS SuggesterCreationDate FROM SuggestedEditVotes AS v INNER JOIN SuggestedEdits AS s ON s.Id = v.SuggestedEditId INNER JOIN Pos...
sede
CREATE TABLE table_7238 ( "Name" text, "Japanese" text, "Population ( 2012 )" real, "Date of designation" text, "Region" text, "Prefecture" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What region has the symbol ?
SELECT "Region" FROM table_7238 WHERE "Japanese" = '八尾'
wikisql
CREATE TABLE table_6870 ( "Institution" text, "Location" text, "Affiliation" text, "Enrollment" real, "Mascot" text, "Colors" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Public Institution is in Black River Falls?
SELECT "Institution" FROM table_6870 WHERE "Affiliation" = 'public' AND "Location" = 'black river falls'
wikisql
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2137" AND diagnoses.short_title = "Hyp kid NOS w cr kid V"
mimicsql_data
CREATE TABLE table_23681 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who won mixed doubles when zhou mi won womens singles
SELECT "Mixed doubles" FROM table_23681 WHERE "Womens singles" = 'Zhou Mi'
wikisql
CREATE TABLE table_22815568_2 ( market_income_per_capita VARCHAR, poverty_rate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the market income per capita of the county with the 9.4% poverty rate?
SELECT market_income_per_capita FROM table_22815568_2 WHERE poverty_rate = "9.4%"
sql_create_context
CREATE TABLE table_2930244_3 ( number_of_hurricanes INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest overall number of hurricanes?
SELECT MIN(number_of_hurricanes) FROM table_2930244_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 demographic.admittime, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Jane Dillard"
mimicsql_data
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number...
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 = 4401)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperatur...
mimic_iii
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 prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Avapro"
mimicsql_data
CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CR...
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week
nvbench
CREATE TABLE table_15070 ( "Tournament" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the 2011 performance for the US open?
SELECT "2011" FROM table_15070 WHERE "Tournament" = 'us open'
wikisql
CREATE TABLE table_36980 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round of the player with a pick number lower than 34?
SELECT MAX("Round") FROM table_36980 WHERE "Pick #" > '34'
wikisql
CREATE TABLE table_name_67 ( valid_poll VARCHAR, seats VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of valid poll with seats more than 4 and candidates more than 9
SELECT COUNT(valid_poll) FROM table_name_67 WHERE seats > 4 AND candidates > 9
sql_create_context
CREATE TABLE table_65529 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Silver has a Total of 11, and a Gold smaller than 8?
SELECT MIN("Silver") FROM table_65529 WHERE "Total" = '11' AND "Gold" < '8'
wikisql
CREATE TABLE table_63394 ( "Year" real, "Competition Description" text, "Location" text, "Apparatus" text, "Rank-Final" real, "Score-Final" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year is the first one that has an Apparatus of uneve...
SELECT MIN("Year") FROM table_63394 WHERE "Apparatus" = 'uneven bars' AND "Rank-Final" < '3'
wikisql
CREATE TABLE table_18503 ( "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 was the final result for Craig Hosmer?
SELECT "Result" FROM table_18503 WHERE "Incumbent" = 'Craig Hosmer'
wikisql
CREATE TABLE table_37596 ( "Date" text, "Event" text, "Circuit" text, "Driver" text, "Race" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Driver has a Date of 16th september 1951, and a Race of dns?
SELECT "Driver" FROM table_37596 WHERE "Date" = '16th september 1951' AND "Race" = 'dns'
wikisql
CREATE TABLE table_31718 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the owner of the branding gx94?
SELECT "Owner" FROM table_31718 WHERE "Branding" = 'gx94'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '07451583' AND gwyjzb.MED_SER_ORG_NO = '6810321' AND gwyjzb.OUT_DIAG_DOC_NM LIKE '钱%' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '07451583' AND fgwyjzb.MED_SER_ORG_NO = '6...
css
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.SHSJ FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '奚...
css
CREATE TABLE table_20520 ( "Member State" text, "Population in millions" text, "Population % of EU" text, "Area km 2" real, "Area % of EU" text, "Pop. density People/km 2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the population densit...
SELECT "Pop. density People/km 2" FROM table_20520 WHERE "Population % of EU" = '1.1%' AND "Member State" = 'Slovakia'
wikisql
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, ...
atis
CREATE TABLE table_38691 ( "Career Card" text, "Starting career/salary" text, "2nd career/salary" text, "3rd career/salary" text, "4th career/salary" text, "5th career/salary" text, "6th career/salary" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "6th career/salary" FROM table_38691 WHERE "2nd career/salary" = 'substitute teacher ($20,000)'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, ...
SELECT * FROM Users WHERE Location = 'Tehran'
sede
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, De...
SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, Users.Id AS "user_link", COUNT(*) AS UpVotes, Reputation AS TotalReputation FROM Users INNER JOIN Tags ON Tags.TagName = '##TagName##' INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes...
sede
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city...
atis
CREATE TABLE table_48706 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game has a Home Team of san francisco, and a Date of april 22?
SELECT "Game" FROM table_48706 WHERE "Home Team" = 'san francisco' AND "Date" = 'april 22'
wikisql
CREATE TABLE table_52930 ( "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. -- When did the home team score 19.17 (131)?
SELECT "Date" FROM table_52930 WHERE "Home team score" = '19.17 (131)'
wikisql
CREATE TABLE table_48029 ( "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. -- What was the score when the away team was brighton & hove albion?
SELECT "Score" FROM table_48029 WHERE "Away team" = 'brighton & hove albion'
wikisql
CREATE TABLE table_name_64 ( new_conference VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which new conference is located in Greentown?
SELECT new_conference FROM table_name_64 WHERE location = "greentown"
sql_create_context
CREATE TABLE table_56390 ( "Product" text, "2004" text, "2003" text, "2002" text, "2001" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the amount of grain in 2001?
SELECT "2001" FROM table_56390 WHERE "Product" = 'grain'
wikisql
CREATE TABLE table_203_573 ( id number, "name" text, "rank - 2000" number, "number" number, "country of origin" text, "england - 2001" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which name had the highest number ?
SELECT "name" FROM table_203_573 ORDER BY "number" DESC LIMIT 1
squall
CREATE TABLE table_name_9 ( read_by VARCHAR, un__abridged VARCHAR, author VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who read the unabridged book written by Gary Paulsen?
SELECT read_by FROM table_name_9 WHERE un__abridged = "unabridged" AND author = "gary paulsen"
sql_create_context
CREATE TABLE table_19744915_22 ( total VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different total points does the couple ranked at number 5 have?
SELECT COUNT(total) FROM table_19744915_22 WHERE rank = 5
sql_create_context
CREATE TABLE book ( book_id number, title text, issues number, writer text ) CREATE TABLE publication ( publication_id number, book_id number, publisher text, publication_date text, price number ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT title FROM book WHERE NOT book_id IN (SELECT book_id FROM publication)
spider
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, t...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Stephanie Bolz%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of...
advising
CREATE TABLE table_name_96 ( location VARCHAR, opponent VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the Lightning play the NY Rangers at 7:00 pm?
SELECT location FROM table_name_96 WHERE opponent = "ny rangers" AND time = "7:00 pm"
sql_create_context
CREATE TABLE Fault_Log_Parts ( fault_log_entry_id INTEGER, part_fault_id INTEGER, fault_status VARCHAR(10) ) CREATE TABLE Maintenance_Engineers ( engineer_id INTEGER, company_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), other_details VARCHAR(255) ) CREATE TABLE Assets ( ...
SELECT COUNT(*), T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id = T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id
nvbench
CREATE TABLE table_name_24 ( played VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many matches have Rhymney RFC played?
SELECT played FROM table_name_24 WHERE club = "rhymney rfc"
sql_create_context
CREATE TABLE table_name_48 ( country VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE COUNTRY WITH NAME OF KANU?
SELECT country FROM table_name_48 WHERE name = "kanu"
sql_create_context
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transa...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type
nvbench
CREATE TABLE table_75436 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which December has a Record of 4-3-6?
SELECT "December" FROM table_75436 WHERE "Record" = '4-3-6'
wikisql
CREATE TABLE table_name_69 ( name VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What bridge is in Mcville?
SELECT name FROM table_name_69 WHERE location = "mcville"
sql_create_context
CREATE TABLE table_name_2 ( gold_coast VARCHAR, auckland VARCHAR, melbourne VARCHAR, adelaide VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- yes or no for the gold coast with yes for melbourne, yes for adelaide, yes for auckland?
SELECT gold_coast FROM table_name_2 WHERE melbourne = "yes" AND adelaide = "yes" AND auckland = "yes"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id num...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.subject_id = "53707"
mimicsql_data
CREATE TABLE table_204_561 ( id number, "fence" number, "name" text, "jockey" text, "age" number, "handicap (st-lb)" text, "starting price" text, "fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which horse was older , brown diamond...
SELECT "name" FROM table_204_561 WHERE "name" IN ('brown diamond', 'flamecap') ORDER BY "age" DESC LIMIT 1
squall
CREATE TABLE table_204_296 ( id number, "rank" number, "athlete" text, "qual" number, "final" number, "total" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which athlete has the most total ?
SELECT "athlete" FROM table_204_296 ORDER BY "total" DESC LIMIT 1
squall
CREATE TABLE table_22893781_6 ( score VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for madison square garden 18,828
SELECT score FROM table_22893781_6 WHERE location_attendance = "Madison Square Garden 18,828"
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ...
SELECT Posts.Id, Posts.Id AS "post_link", PostTypes.Name AS "type", Posts.Score, Posts.CreationDate, Posts.Tags FROM Posts JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Body LIKE '%<img%.https://archive.org/details/imageshack.us-20130319-043120%' AND Score >= 10 LIMIT 1000
sede
CREATE TABLE table_1817879_2 ( length__miles_ VARCHAR, endpoints VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lenth (miles) of endpoints westlake/macarthur park to wilshire/western?
SELECT length__miles_ FROM table_1817879_2 WHERE endpoints = "Westlake/MacArthur Park to Wilshire/Western"
sql_create_context
CREATE TABLE table_31396 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the epi...
SELECT "Written by" FROM table_31396 WHERE "U.S. viewers (million)" = '2.97'
wikisql
CREATE TABLE table_train_280 ( "id" int, "fpg" float, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "renal_disease" bool, "hba1c" float, "body_mass_index_bmi" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- subjects ...
SELECT * FROM table_train_280 WHERE fpg >= 6 AND fpg <= 11 AND hemoglobin_a1c_hba1c < 10
criteria2sql
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Fluconazole"
mimicsql_data
CREATE TABLE table_197638_6 ( player VARCHAR, us_open VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the US Open in 1937?
SELECT player FROM table_197638_6 WHERE us_open = 1937
sql_create_context
CREATE TABLE table_20782 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the kickoff time on mond...
SELECT "Kickoff" FROM table_20782 WHERE "Date" = 'Monday, May 13'
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2123" AND lab.label = "NonSquamous Epithelial Cell"
mimicsql_data
CREATE TABLE table_25321 ( "Game" text, "Date" text, "Champion" text, "Score" text, "Runner Up" text, "Stadium" text, "City" text, "Ted Morris Memorial Trophy (Game MVP)" text, "Bruce Coulter Award" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "Bruce Coulter Award" FROM table_25321 WHERE "Ted Morris Memorial Trophy (Game MVP)" = 'Forrest Kennerd'
wikisql
CREATE TABLE table_62404 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par for Fred Couples when the score is 68-66=134?
SELECT "To par" FROM table_62404 WHERE "Score" = '68-66=134' AND "Player" = 'fred couples'
wikisql
CREATE TABLE table_name_25 ( northumberland_senior_benevolent_bowl VARCHAR, northumberland_minor_cup VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the Northumberland Senior Benevolent Bowl, when the Northumberland Minor Cup was won by Whitley Bay 'a...
SELECT northumberland_senior_benevolent_bowl FROM table_name_25 WHERE northumberland_minor_cup = "whitley bay 'a'"
sql_create_context
CREATE TABLE table_204_177 ( id number, "player" text, "years played" text, "total w-l" text, "singles w-l" text, "doubles w-l" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who played for the most years ?
SELECT "player" FROM table_204_177 ORDER BY "years played" DESC LIMIT 1
squall
CREATE TABLE table_46998 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Points" FROM table_46998 WHERE "Drawn" = '1' AND "Lost" = '5'
wikisql
CREATE TABLE table_48458 ( "Year" text, "Date" text, "Circuit" text, "Winning driver" text, "Winning constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which circuit did Peter Whitehead win?
SELECT "Circuit" FROM table_48458 WHERE "Winning driver" = 'peter whitehead'
wikisql
CREATE TABLE table_18871 ( "District" text, "2010 Population (000)" real, "2008 GDP (USD bn) a" text, "2008 GDP per capita (USD) a" real, "Agri culture b" text, "Mining b" text, "Manufac turing b" text, "Services & cons truction b" text, "Exports (USD mn) 2011" real, "Median mo. ...
SELECT "Income poverty f" FROM table_18871 WHERE "District" = 'San Juan'
wikisql
CREATE TABLE table_name_52 ( model VARCHAR, cpu_speed VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which model has a CPU speed of 133mhz?
SELECT model FROM table_name_52 WHERE cpu_speed = "133mhz"
sql_create_context
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( ...
SELECT County_name, Population FROM county
nvbench
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 city, COUNT(*) FROM station GROUP BY city ORDER BY city
nvbench
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 COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.ZZYSGH = '21581460' AND wdmzjzjlb.JZKSRQ BETWEEN '2002-10-01' AND '2016-07-05' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.ZZYSGH = '21581460' AND bdmzjzjlb.JZKSRQ BETWEEN '2002-10-01' AND '2016-07-05'
css
CREATE TABLE table_name_82 ( points INTEGER, game INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points was before game 14?
SELECT SUM(points) FROM table_name_82 WHERE game < 14
sql_create_context
CREATE TABLE table_name_69 ( pole_position VARCHAR, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had Pole position for the French Grand Prix?
SELECT pole_position FROM table_name_69 WHERE race = "french grand prix"
sql_create_context
CREATE TABLE table_name_15 ( category VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the category for 2013
SELECT category FROM table_name_15 WHERE year = "2013"
sql_create_context
CREATE TABLE table_78890 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT MIN("Drawn") FROM table_78890 WHERE "Lost" = '13'
wikisql
CREATE TABLE table_46818 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who scored 74-70-67=211 and placed t5?
SELECT "Player" FROM table_46818 WHERE "Place" = 't5' AND "Score" = '74-70-67=211'
wikisql
CREATE TABLE table_name_60 ( total INTEGER, to_par VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the average Total that has the To par smaller than 10, and the Country of south korea?
SELECT AVG(total) FROM table_name_60 WHERE to_par < 10 AND country = "south korea"
sql_create_context
CREATE TABLE table_name_77 ( rider_status VARCHAR, team_country VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rider status for the 1971 netherlands team?
SELECT rider_status FROM table_name_77 WHERE team_country = "netherlands" AND year = 1971
sql_create_context
CREATE TABLE table_name_36 ( stage INTEGER, finish VARCHAR, year VARCHAR, leader_at_the_summit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest stage number for a year later than 1948, leader at the summit was group, and finish was ...
SELECT MAX(stage) FROM table_name_36 WHERE year > 1948 AND leader_at_the_summit = "group" AND finish = "bagnères-de-bigorre"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHE...
css
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDat...
SELECT Id AS "user_link", Reputation, Reputation * 1.0 / C.Cnt AS "rep_per_post" FROM Users AS U INNER JOIN (SELECT OwnerUserId, Cnt = COUNT(*) FROM Posts GROUP BY OwnerUserId HAVING COUNT(*) >= '##MinNumberOfPosts##') AS C ON U.Id = C.OwnerUserId ORDER BY 'rep_per_post' DESC
sede
CREATE TABLE order_items ( order_item_id number, order_id number, product_id number ) CREATE TABLE customer_addresses ( customer_id number, address_id number, date_from time, date_to time ) CREATE TABLE staff ( staff_id number, staff_gender text, staff_name text ) CREATE TABLE...
SELECT product_id FROM order_items GROUP BY product_id HAVING COUNT(*) > 3 UNION SELECT product_id FROM product_suppliers GROUP BY product_id HAVING SUM(total_amount_purchased) > 80000
spider
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_...
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i...
advising
CREATE TABLE table_44706 ( "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 away team that scored 63-69?
SELECT "Away team" FROM table_44706 WHERE "Score" = '63-69'
wikisql
CREATE TABLE Premises ( premise_id INTEGER, premises_type VARCHAR(15), premise_details VARCHAR(255) ) CREATE TABLE Mailshot_Campaigns ( mailshot_id INTEGER, product_category VARCHAR(15), mailshot_name VARCHAR(80), mailshot_start_date DATETIME, mailshot_end_date DATETIME ) CREATE TABLE ...
SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code ORDER BY outcome_code DESC
nvbench
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.FLX_MED_ORG_ID FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '06309706061' UNION SELECT fgwyjzb.FLX_MED_ORG_ID FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '06309706061'
css
CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) -- Using valid SQLite, answer the ...
SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY COUNT(DISTINCT T1.Workshop_ID)
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Hemodialysis"
mimicsql_data
CREATE TABLE table_name_43 ( winner VARCHAR, year VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winning team before 1956 on October 21?
SELECT winner FROM table_name_43 WHERE year < 1956 AND date = "october 21"
sql_create_context
CREATE TABLE table_5402 ( "Score" real, "Opposition" text, "Venue" text, "City" text, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score is the lowest one that has a Year of 1868?
SELECT MIN("Score") FROM table_5402 WHERE "Year" = '1868'
wikisql
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '4469722' AND qtb.IN_HOSP_DATE BETWEEN '2006-11-15' AND '2007-07-28' AND qtb.PERSON_NM LIKE '卫%' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '4469722' AND gyb.IN_HOSP_DATE BETWEEN '2006-11-15' AND '2007-07-28' AND gyb.PERSON_NM LIKE '卫%' UNION SELECT * FROM zyb WHERE ...
css
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 jybgb.BBDM, jybgb.BBMC, jybgb.BBZT FROM jybgb WHERE jybgb.BGDH = '14182284037'
css