instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT CASE WHEN q.Body LIKE '%<code>%' THEN 'yes' ELSE 'no' END AS IncludesCode, COUNT(*) AS Count FROM Posts AS q WHERE q.PostTypeId = 1 AND q.ViewCount > 10 AND (q.Score < 0 OR NOT q.ClosedDate IS NULL) AND q.AnswerCount > 0 AND q.CreationDate > (SELECT MAX(CreationDate) FROM Posts) - 30 AND NOT EXISTS(SELECT 1 FROM...
sede
CREATE TABLE table_9822 ( "Division" text, "1999" real, "2000" real, "2001" real, "2002" real, "2003" real, "2004" real, "2005" real, "2006" real, "2007" real, "2008" real, "2009" real, "2010" real, "2011" real ) -- Using valid SQLite, answer the following quest...
SELECT MAX("2004") FROM table_9822 WHERE "2009" > '26.1'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, ...
SELECT SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.PERSON_ID = '13645898' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-12-19' AND '2004-09-26'
css
CREATE TABLE table_13259 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT MAX("Pop. (2010)") FROM table_13259 WHERE "GEO ID" = '3802763220' AND "Longitude" > '-98.936777'
wikisql
CREATE TABLE table_name_73 ( pick INTEGER, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest pick number where the overall pick number was 38?
SELECT MIN(pick) FROM table_name_73 WHERE overall = 38
sql_create_context
CREATE TABLE table_8989 ( "Side" text, "Group" text, "Inscription" text, "Official history" text, "Identification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the inscription where Virgil is listed as the identification?
SELECT "Inscription" FROM table_8989 WHERE "Identification" = 'virgil'
wikisql
CREATE TABLE table_6794 ( "Episode" text, "VII Season" text, "VIII Season" text, "XII Season" text, "XIII Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Episode, when XII Season is 4 118 160 (26 september 2010)?
SELECT "Episode" FROM table_6794 WHERE "XII Season" = '4 118 160 (26 september 2010)'
wikisql
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 prescription...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admission_location = "PHYS REFERRAL/NORMAL DELI"
mimicsql_data
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '45075534' AND t_kc22.STA_DATE BETWEEN '2007-07-19' AND '2020-07-13' AND t_kc22.SELF_PAY_PRO < 0.3
css
CREATE TABLE table_28891101_3 ( postal_code INTEGER, administrative_capital VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the postal code when the administrative capital in Bori?
SELECT MAX(postal_code) FROM table_28891101_3 WHERE administrative_capital = "Bori"
sql_create_context
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_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT department, name, number FROM course WHERE credits = 3 AND department = 'DANCE' AND number < 100 + 100 AND number >= 100
advising
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, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE table_10855 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won th...
SELECT "Winning driver" FROM table_10855 WHERE "Date" = '24 august'
wikisql
CREATE TABLE table_53184 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest lap for Luigi Piotti with more than 13 grid and a time/retired engine?
SELECT MAX("Laps") FROM table_53184 WHERE "Grid" > '13' AND "Time/Retired" = 'engine' AND "Driver" = 'luigi piotti'
wikisql
CREATE TABLE procedures ( 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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.insurance = "Private"
mimicsql_data
CREATE TABLE table_68572 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Murupara has a roll greater than 296 for what years?
SELECT "Years" FROM table_68572 WHERE "Roll" > '296' AND "Area" = 'murupara'
wikisql
CREATE TABLE table_72951 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was Mike McIntyre elected?
SELECT COUNT("Results") FROM table_72951 WHERE "Incumbent" = 'Mike McIntyre'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_stop ( flight_id int, stop_n...
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS V...
atis
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.gender = "M" AND demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI"
mimicsql_data
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number,...
WITH UserTagScore AS (SELECT A.OwnerUserId AS UserId, PostTags.TagId, SUM(A.Score) AS Score FROM Posts AS Q, Posts AS A, PostTags WHERE A.ParentId = Q.Id AND Q.Id = PostTags.PostId GROUP BY A.OwnerUserId, PostTags.TagId HAVING SUM(A.Score) > 0), UserNo AS (SELECT COUNT(*) AS UserNo FROM Users), UserTagRank AS (SELECT U...
sede
CREATE TABLE table_name_55 ( byes INTEGER, hampden_fl VARCHAR, wins VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the most byes of Terang-Mortlake when they had more than 11 wins and more than 1118 against?
SELECT MAX(byes) FROM table_name_55 WHERE wins > 11 AND against > 1118 AND hampden_fl = "terang-mortlake"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.days_stay > "6"
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "412" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( tran...
SELECT date_of_transaction, AVG(share_count) FROM Transactions
nvbench
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_f...
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, state AS STATE_0, state AS STATE_1 WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLOTTE' AND date_day.day_number =...
atis
CREATE TABLE table_name_46 ( date VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the Result l 38-14?
SELECT date FROM table_name_46 WHERE result = "l 38-14"
sql_create_context
CREATE TABLE table_204_893 ( id number, "rank" number, "name" text, "nationality" text, "time" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the first name ranked ?
SELECT "name" FROM table_204_893 WHERE id = 1
squall
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.gender = "F" AND prescriptions.drug = "Theophylline SR"
mimicsql_data
CREATE TABLE table_47110 ( "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. -- What is th...
SELECT "Try bonus" FROM table_47110 WHERE "Points against" = '492'
wikisql
CREATE TABLE table_18481 ( "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 result for the politician first elected in 1942?
SELECT "Result" FROM table_18481 WHERE "First elected" = '1942'
wikisql
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE table_name_29 ( crowd INTEGER, venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lowest Crowd of hisense arena on 8 february?
SELECT MIN(crowd) FROM table_name_29 WHERE venue = "hisense arena" AND date = "8 february"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND demographic.admityear < "2178"
mimicsql_data
CREATE TABLE table_46378 ( "Date" text, "Opponents" text, "H / A" text, "Result F \u2013 A" text, "Attendance" real, "League position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is league position when manchester played against luton to...
SELECT "League position" FROM table_46378 WHERE "Attendance" > '41,288' AND "Opponents" = 'luton town'
wikisql
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, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
SELECT zyjybgb.BGJGDM, zyjybgb.BGJGMC FROM zyjybgb WHERE zyjybgb.BGDH = '52728389558' UNION SELECT mzjybgb.BGJGDM, mzjybgb.BGJGMC FROM mzjybgb WHERE mzjybgb.BGDH = '52728389558'
css
CREATE TABLE table_57444 ( "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 is the home score with Away team score of 1...
SELECT "Home team score" FROM table_57444 WHERE "Away team score" = '11.11 (77)'
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 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Lymphocytes, Percent"
mimicsql_data
CREATE TABLE table_name_64 ( date VARCHAR, final_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Final Score of 31-7 happen?
SELECT date FROM table_name_64 WHERE final_score = "31-7"
sql_create_context
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, ...
SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party DESC
nvbench
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jy...
css
CREATE TABLE table_27755603_8 ( location_attendance VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the location attendance for austin daye , tracy mcgrady , tayshaun prince (20)
SELECT location_attendance FROM table_27755603_8 WHERE high_points = "Austin Daye , Tracy McGrady , Tayshaun Prince (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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'P75.635' AND jyjgzbb.JCZBDM = '...
css
CREATE TABLE table_name_11 ( tournament VARCHAR, runner_s__up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For which tournament was Anthony Wall the runner-up?
SELECT tournament FROM table_name_11 WHERE runner_s__up = "anthony wall"
sql_create_context
CREATE TABLE table_46135 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent of the game with a Result of w 13 0?
SELECT "Opponent" FROM table_46135 WHERE "Result" = 'w 13–0'
wikisql
CREATE TABLE table_2203760_4 ( domestic_box_office VARCHAR, film VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the domestic box office for 'House on Haunted Hill'?
SELECT domestic_box_office FROM table_2203760_4 WHERE film = "House on Haunted Hill"
sql_create_context
CREATE TABLE table_55458 ( "Tournament" text, "1993" text, "1994" text, "1995" text, "1996" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value for the Wimbledon tournament in 1996?
SELECT "1996" FROM table_55458 WHERE "Tournament" = 'wimbledon'
wikisql
CREATE TABLE table_27528 ( "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. -- How many solar eclipse on June 10-11, while November 3 is 153?
SELECT "June 10-11" FROM table_27528 WHERE "November 3" = '153'
wikisql
CREATE TABLE table_28884858_1 ( average_attendance VARCHAR, capacity_percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many average attendance has a capacity percentage of 96.5%
SELECT COUNT(average_attendance) FROM table_28884858_1 WHERE capacity_percentage = "96.5%"
sql_create_context
CREATE TABLE table_name_61 ( rank INTEGER, athlete VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum rank of Solomon Bayoh when his time was smaller than 22.16?
SELECT SUM(rank) FROM table_name_61 WHERE athlete = "solomon bayoh" AND time < 22.16
sql_create_context
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) -- Using valid SQLite, answer the following questions fo...
SELECT Type, COUNT(Type) FROM ship GROUP BY Type
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.admityear < "2177" AND procedures.long_title = "Implant of pulsation balloon"
mimicsql_data
CREATE TABLE table_name_11 ( election VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 2nd Party, when Election is '1885'?
SELECT 2 AS nd_party FROM table_name_11 WHERE election = "1885"
sql_create_context
CREATE TABLE table_name_43 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance on 21 August 2004?
SELECT SUM(attendance) FROM table_name_43 WHERE date = "21 august 2004"
sql_create_context
CREATE TABLE table_name_48 ( overall INTEGER, school_club_team VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest overall rank of any Tennessee State player drafted before round 10?
SELECT MIN(overall) FROM table_name_48 WHERE school_club_team = "tennessee state" AND round < 10
sql_create_context
CREATE TABLE table_name_17 ( draws INTEGER, position VARCHAR, scored VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Out of the teams that have scored lower than 25 points, have a total of points less than 20, and a position larger tha...
SELECT MIN(draws) FROM table_name_17 WHERE scored < 25 AND points = 20 AND position > 8
sql_create_context
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND CITY_2.ci...
atis
CREATE TABLE table_name_67 ( area__km_2__ INTEGER, name VARCHAR, population__2011_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the area (in km2) for theewaterskloof, whose population in 2011 was less than 108,790?
SELECT SUM(area__km_2__) FROM table_name_67 WHERE name = "theewaterskloof" AND population__2011_ < 108 OFFSET 790
sql_create_context
CREATE TABLE table_name_22 ( result VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result when home was fc luzern (asl)?
SELECT result FROM table_name_22 WHERE home = "fc luzern (asl)"
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 USE_FRE, EACH_DOSAGE FROM t_kc22 WHERE MED_CLINIC_ID = '47484689413' AND SOC_SRT_DIRE_NM = '多潘立酮片'
css
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT SBBM, YQBH, YQMC FROM jyjgzbb WHERE JYZBLSH = '46721684467'
css
CREATE TABLE table_66958 ( "D 48" text, "D 47" text, "D 46" text, "D 45" text, "D 44" text, "D 43" text, "D 42" text, "D 41" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the D 47 when it has D 48 of d 29
SELECT "D 47" FROM table_66958 WHERE "D 48" = 'd 29'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'post neurointerventional procedure - embolization'...
eicu
CREATE TABLE table_17339 ( "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 assists" FROM table_17339 WHERE "Location Attendance" = 'Toyota Center 18,370'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId n...
SELECT DATEPART(hour, Posts.CreationDate) AS "daytime", COUNT(Posts.Id) AS "numanswers" FROM Posts INNER JOIN PostTags ON Posts.ParentId = PostTags.PostId WHERE PostTags.TagId = 17 AND Posts.PostTypeId = 2 AND Posts.CreationDate > DATEADD(year, -1, GETDATE()) GROUP BY DATEPART(hour, Posts.CreationDate)
sede
CREATE TABLE table_1850282_5 ( tobago VARCHAR, species VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- are in tobago species liophis cobellus cobellus?
SELECT tobago FROM table_1850282_5 WHERE species = "Liophis cobellus cobellus"
sql_create_context
CREATE TABLE table_28658 ( "Name / designation" text, "Year of introduction" text, "Country of origin" text, "Primary cartridge" text, "primary user" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different years was the name/designation ce...
SELECT COUNT("Year of introduction") FROM table_28658 WHERE "Name / designation" = 'CETME'
wikisql
CREATE TABLE staff_department_assignments ( job_title_code VARCHAR, staff_id VARCHAR, date_assigned_to VARCHAR ) CREATE TABLE staff ( staff_name VARCHAR, staff_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name and job title of t...
SELECT T1.staff_name, T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1
sql_create_context
CREATE TABLE table_48676 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the rider who had less than 30 laps, ended in an accident with a car manufactured by yamaha on a gr...
SELECT "Rider" FROM table_48676 WHERE "Laps" < '30' AND "Manufacturer" = 'yamaha' AND "Time" = 'accident' AND "Grid" > '3'
wikisql
CREATE TABLE table_10408617_5 ( approx_premium VARCHAR, tariff_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the premium associated with tariff code g9?
SELECT approx_premium FROM table_10408617_5 WHERE tariff_code = "g9"
sql_create_context
CREATE TABLE table_35175 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did Alex Tagliani get for Qual 1?
SELECT "Qual 1" FROM table_35175 WHERE "Name" = 'alex tagliani'
wikisql
CREATE TABLE table_46098 ( "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_46098 WHERE "Points for" = 'points for'
wikisql
CREATE TABLE table_name_41 ( opponent VARCHAR, method VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent of the submission (triangle choke) method of submission?
SELECT opponent FROM table_name_41 WHERE method = "submission (triangle choke)"
sql_create_context
CREATE TABLE table_name_51 ( season INTEGER, races VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Season were then less than 3 Races with less than 1 Win?
SELECT AVG(season) FROM table_name_51 WHERE races < 3 AND wins < 1
sql_create_context
CREATE TABLE table_38568 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Class has a Frequency MHz larger than 91.5, and a City of lice...
SELECT "Class" FROM table_38568 WHERE "Frequency MHz" > '91.5' AND "City of license" = 'hyannis, nebraska'
wikisql
CREATE TABLE table_16820 ( "Model name" text, "Power (ps)" real, "Torque (Nm@rpm)" text, "Displacement (cm\u00b3)" real, "Engine code" text, "Comment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the comment with model name being 2.4 (2...
SELECT "Comment" FROM table_16820 WHERE "Model name" = '2.4 (2001-2007)'
wikisql
CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'american' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM geog...
restaurants
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 demographic.dischtime FROM demographic WHERE demographic.name = "Caren Obrien"
mimicsql_data
CREATE TABLE table_74254 ( "Date/Location" text, "Mens singles" text, "Womens Singles" text, "U21 Mens" text, "U21 Womens" text, "Mixed Restricted" text, "Mixed Veteran" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Matt Ware won the m...
SELECT "Mixed Restricted" FROM table_74254 WHERE "Mens singles" = 'Matt Ware'
wikisql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'WOMENSTD' AND course.number = 498 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o...
advising
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.admityear < "2168" AND diagnoses.long_title = "Cerebral aneurysm, nonruptured"
mimicsql_data
CREATE TABLE table_24887326_6 ( tie_no VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tie has Orient as the home team?
SELECT tie_no FROM table_24887326_6 WHERE home_team = "Orient"
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, ...
SELECT COUNT(*) FROM Votes JOIN Posts ON Votes.PostId = Posts.Id WHERE Votes.VoteTypeId IN (2) AND Votes.CreationDate >= DATEADD(DAY, -30, GETDATE()) AND Posts.PostTypeId IN (2)
sede
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ftng autmtc dfibrillator') AND DATETIME(diagnoses_icd.char...
mimic_iii
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE table_24106 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Black Knights points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of black knights points for 3 game
SELECT COUNT("Black Knights points") FROM table_24106 WHERE "Game" = '3'
wikisql
CREATE TABLE table_22901612_2 ( region VARCHAR, chief_judge VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the chief judge is Glen E. Conrad, what is the region?
SELECT region FROM table_22901612_2 WHERE chief_judge = "Glen E. Conrad"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT YEAR(Posts.CreationDate) AS Year, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ('gt.group-theory', 'co.combinatorics') AND PostTypes.Name = 'Q...
sede
CREATE TABLE procedures ( 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Old myocardial infarction"
mimicsql_data
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int...
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_name_24 ( school_club_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school/club did gerald wilkins attend?
SELECT school_club_team FROM table_name_24 WHERE player = "gerald wilkins"
sql_create_context
CREATE TABLE table_13542 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the quantity ...
SELECT "Quantity made" FROM table_13542 WHERE "Wheel arrangement" = '2-8-0' AND "Class" = 'f-4'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '015-23047' AND patient.hospitaldischargetime IS NULL
eicu
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.short_title = "CV cath plcmt w guidance"
mimicsql_data
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID
nvbench
CREATE TABLE table_name_21 ( decision VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who made the decision when toronto was the home team?
SELECT decision FROM table_name_21 WHERE home = "toronto"
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_31160 ( "No." real, "#" real, "Episode title" text, "Director" text, "Writer(s)" text, "U.S. original airdate" text, "Prod. code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 'speed metal' is the episode title what ...
SELECT MIN("No.") FROM table_31160 WHERE "Episode title" = 'Speed Metal'
wikisql
CREATE TABLE table_37404 ( "Nationality" text, "Height" text, "Name" text, "Sport" text, "Lifespan" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How tall is Dylan Postl?
SELECT "Height" FROM table_37404 WHERE "Name" = 'dylan postl'
wikisql
CREATE TABLE table_name_95 ( title VARCHAR, result VARCHAR, director VARCHAR, survey VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title for the Murex D'or survey, after 2005, Said Elmarouk as director, and was nominate...
SELECT title FROM table_name_95 WHERE survey = "murex d'or" AND year > 2005 AND director = "said elmarouk" AND result = "nominated"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT SQRGH, SQRXM FROM jybgb WHERE JZLSH = '60552087558' GROUP BY SQRGH HAVING COUNT(*) > 19
css