instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_99 ( first_elected INTEGER, district VARCHAR, committee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Highest first elected year that has a district of 06.0 6, and a committee of economic matters?
SELECT MAX(first_elected) FROM table_name_99 WHERE district = "06.0 6" AND committee = "economic matters"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, ...
WITH Raw AS (SELECT PostId, Id, Text FROM PostHistory WHERE Id IN (SELECT MAX(Id) AS CloseEventId FROM PostHistory WHERE PostHistoryTypeId = 10 AND PostId IN (SELECT Id FROM Posts WHERE NOT ClosedDate IS NULL) GROUP BY PostId)) SELECT PostId, JSON_EXTRACT_SCALAR(Text, '$.Voters0.Id') AS Voter FROM Raw UNION SELECT Post...
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 COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) <= '2104'
eicu
CREATE TABLE table_72052 ( "Year" real, "Office" text, "Candidate" text, "Popular Votes" real, "Percentage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many votes for the candidate after 1992, 1.59% of the vote, and the office of us represent...
SELECT AVG("Popular Votes") FROM table_72052 WHERE "Office" = 'us representative 4' AND "Percentage" = '1.59%' AND "Year" > '1992'
wikisql
CREATE TABLE table_46 ( "Scheme" text, "Tariff code" text, "BTs retail price (regulated)" text, "Approx premium" text, "Prefixes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the bts retail price (regulated) for tariff code g10?
SELECT "BTs retail price (regulated)" FROM table_46 WHERE "Tariff code" = 'g10'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND prescriptions.route = "PO"
mimicsql_data
CREATE TABLE table_15190 ( "Year" real, "Population (Total)" real, "(Barcaldine)" real, "(Aramac)" real, "(Jericho)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Year has an (Aramac) of 832 and a Population (Total) less than 3,762?
SELECT SUM("Year") FROM table_15190 WHERE "(Aramac)" = '832' AND "Population (Total)" < '3,762'
wikisql
CREATE TABLE table_26609690_1 ( position VARCHAR, team_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions are there for RB1 Motorsports?
SELECT COUNT(position) FROM table_26609690_1 WHERE team_s_ = "RB1 Motorsports"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varc...
SELECT JOB_TITLE, MAX_SALARY - MIN_SALARY FROM jobs WHERE MAX_SALARY BETWEEN 12000 AND 18000 ORDER BY JOB_TITLE DESC
nvbench
CREATE TABLE table_77450 ( "Game" text, "Date" text, "Opponent" text, "Result" text, "Dolphins' points" text, "Opponents' Points" text, "Record" text, "Streak" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How man...
SELECT "Opponents' Points" FROM table_77450 WHERE "Date" = '11/11/01'
wikisql
CREATE TABLE table_name_66 ( female INTEGER, district VARCHAR, number_of_households VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest female number of the hiroo 1-ch me district, which has more than 1,666 households?
SELECT MIN(female) FROM table_name_66 WHERE district = "hiroo 1-chōme" AND number_of_households > 1 OFFSET 666
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, ...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 17694 AND STRFTIME('%y', admissions.admittime) >= '2102' ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND diagnoses.long_title = "Other pulmonary insufficiency, not elsewhere classified"
mimicsql_data
CREATE TABLE table_name_13 ( results¹ VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game against Luxembourg?
SELECT results¹ FROM table_name_13 WHERE opponent = "luxembourg"
sql_create_context
CREATE TABLE table_18667 ( "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. -- who is the the incumbent with candidates being ben cravens (d) unopposed...
SELECT "Incumbent" FROM table_18667 WHERE "Candidates" = 'Ben Cravens (D) Unopposed'
wikisql
CREATE TABLE table_32840 ( "Player" text, "Span" text, "Start" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text, "Lost" text, "Draw" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What drop had 0 pens, 1 draw, and 8 tries?
SELECT "Drop" FROM table_32840 WHERE "Pens" = '0' AND "Draw" = '1' AND "Tries" = '8'
wikisql
CREATE TABLE table_14288212_1 ( played VARCHAR, first_played VARCHAR, points_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games did the team that began in 2011 and scored 36 points play?
SELECT COUNT(played) FROM table_14288212_1 WHERE first_played = 2011 AND points_for = 36
sql_create_context
CREATE TABLE table_name_41 ( rank VARCHAR, premiere VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank for the episode that premiered on September 12, 1979?
SELECT rank FROM table_name_41 WHERE premiere = "september 12, 1979"
sql_create_context
CREATE TABLE table_name_21 ( district VARCHAR, party VARCHAR, results VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district re-elected a Republican?
SELECT district FROM table_name_21 WHERE party = "republican" AND results = "re-elected"
sql_create_context
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, e...
SELECT city, COUNT(*) FROM station GROUP BY city ORDER BY city DESC
nvbench
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, ...
SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE table_name_98 ( nationality VARCHAR, elevator VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the elevator was Innocent IV what was the nationality?
SELECT nationality FROM table_name_98 WHERE elevator = "innocent iv"
sql_create_context
CREATE TABLE table_5802 ( "Player" text, "Rec." real, "Yards" real, "Avg." real, "Long" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Yards have an avg of 11.8, and a Player of brent celek, and a Long larger than 44?
SELECT AVG("Yards") FROM table_5802 WHERE "Avg." = '11.8' AND "Player" = 'brent celek' AND "Long" > '44'
wikisql
CREATE TABLE table_name_52 ( melbourne VARCHAR, gold_coast VARCHAR, perth VARCHAR, adelaide VARCHAR, sydney VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result for Melbourne when Adelaide, Sydney, and Perth are yes, and Gold Coast i...
SELECT melbourne FROM table_name_52 WHERE adelaide = "yes" AND sydney = "yes" AND perth = "yes" AND gold_coast = "no"
sql_create_context
CREATE TABLE table_67797 ( "Date" text, "Venue" text, "Score" text, "Competition" text, "Match report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score at Pankritio Stadium on June 6, 2007?
SELECT "Score" FROM table_67797 WHERE "Venue" = 'pankritio stadium' AND "Date" = 'june 6, 2007'
wikisql
CREATE TABLE table_name_38 ( time_retired VARCHAR, laps VARCHAR, grid VARCHAR, manufacturer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time/retired for a grid less than 19, under 21 laps, and made by aprilia?
SELECT time_retired FROM table_name_38 WHERE grid < 19 AND manufacturer = "aprilia" AND laps < 21
sql_create_context
CREATE TABLE table_1515 ( "Institution" text, "Wins" real, "Loss" real, "Home Wins" real, "Home Losses" real, "Away Wins" real, "Away Losses" real, "Neutral Wins" real, "Neutral Losses" real, "Current Streak" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT MAX("Wins") FROM table_1515 WHERE "Institution" = 'Northwestern Wildcats'
wikisql
CREATE TABLE table_name_80 ( height_in_ft VARCHAR, school_club_team_country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the height in feet for the player from valparaiso
SELECT height_in_ft FROM table_name_80 WHERE school_club_team_country = "valparaiso"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
SELECT Users.Id AS "user_link", SUM(Posts.Score) AS Total_Score FROM Posts LEFT JOIN Users ON Posts.OwnerUserId = Users.Id WHERE (Posts.ParentId IN (SELECT Id FROM Posts WHERE Tags LIKE '%<##tagName##>%')) AND LOWER(Users.Location) LIKE LOWER('%##CountryName##%') GROUP BY Users.Id
sede
CREATE TABLE table_8939 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of lanes used for races with winners from Austria?
SELECT COUNT("Lane") FROM table_8939 WHERE "Country" = 'austria'
wikisql
CREATE TABLE affiliated_with ( physician number, department number, primaryaffiliation boolean ) CREATE TABLE procedures ( code number, name text, cost number ) CREATE TABLE appointment ( appointmentid number, patient number, prepnurse number, physician number, start time, ...
SELECT physician, department FROM affiliated_with WHERE primaryaffiliation = 1
spider
CREATE TABLE table_name_88 ( player VARCHAR, position VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player was D past Round 3?
SELECT player FROM table_name_88 WHERE position = "d" AND round > 3
sql_create_context
CREATE TABLE table_10875 ( "Rank" real, "Name" text, "Team" text, "Goals" real, "Appearances" real, "Minutes played" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many apperances for shakhtar donetsk?
SELECT COUNT("Appearances") FROM table_10875 WHERE "Team" = 'shakhtar donetsk'
wikisql
CREATE TABLE table_10284385_1 ( representative VARCHAR, date_of_birth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which representative has a birthday of January 31, 1866?
SELECT representative FROM table_10284385_1 WHERE date_of_birth = "January 31, 1866"
sql_create_context
CREATE TABLE table_name_57 ( fa_cup INTEGER, league VARCHAR, total VARCHAR, fa_trophy VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of goals scored in the FA Cup among players that have more than 20 total goals, less than ...
SELECT AVG(fa_cup) FROM table_name_57 WHERE total > 20 AND fa_trophy < 1 AND league < 25
sql_create_context
CREATE TABLE table_56382 ( "Bowling figures Wickets-Runs (Overs)" text, "Bowler" text, "Versus" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were GD Mcgrath's bowling figures?
SELECT "Bowling figures Wickets-Runs (Overs)" FROM table_56382 WHERE "Bowler" = 'gd mcgrath'
wikisql
CREATE TABLE table_36362 ( "Virtue" text, "Latin" text, "Gloss" text, "(Vice)" text, "(Latin)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Diligence Virtues Gloss?
SELECT "Gloss" FROM table_36362 WHERE "Virtue" = 'diligence'
wikisql
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex
nvbench
CREATE TABLE table_24319661_5 ( no_in_series INTEGER, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What episode number in the series had 2.77 million U.S. viewers?
SELECT MAX(no_in_series) FROM table_24319661_5 WHERE us_viewers__million_ = "2.77"
sql_create_context
CREATE TABLE table_204_43 ( id number, "name" text, "rural\nmunicipality (rm)" text, "population\n(2011)" number, "population\n(2006)" number, "change\n(%)" number, "land\narea\n(km2)" number, "population\ndensity\n(per km2)" number ) -- Using valid SQLite, answer the following questio...
SELECT "name" FROM table_204_43 WHERE "name" <> 'bruno' AND "population\n(2011)" = (SELECT "population\n(2011)" FROM table_204_43 WHERE "name" = 'bruno')
squall
CREATE TABLE table_73819 ( "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. -- Which settlement...
SELECT "Settlement" FROM table_73819 WHERE "Cyrillic Name Other Names" = 'Сигет'
wikisql
CREATE TABLE table_name_4 ( wins VARCHAR, avg_start INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins for average start less than 25?
SELECT COUNT(wins) FROM table_name_4 WHERE avg_start < 25
sql_create_context
CREATE TABLE table_name_63 ( launches INTEGER, rocket VARCHAR, partial_failures VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the average launches for Ariane 5 and 0 partial failures?
SELECT AVG(launches) FROM table_name_63 WHERE rocket = "ariane 5" AND partial_failures < 0
sql_create_context
CREATE TABLE table_2849652_1 ( _number_of_divisions VARCHAR, sport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many divisions in bowling ?
SELECT _number_of_divisions FROM table_2849652_1 WHERE sport = "Bowling"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Noninf gastroenterit NEC" AND prescriptions.route = "ORAL"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.dob_year < "2071"
mimicsql_data
CREATE TABLE table_7801 ( "Company Name" text, "Product Name" text, "Hardware Model" text, "Accreditation type" text, "Accreditation level" text, "Accreditation status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Company Name, whe...
SELECT "Company Name" FROM table_7801 WHERE "Accreditation status" = 'approved (valid until 03.07.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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2154.0" AND diagnoses.icd9_code = "70715"
mimicsql_data
CREATE TABLE table_68840 ( "Original title" text, "Title in English" text, "Genre" text, "Role" text, "Directed by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The Last Metro refers to which Original Title?
SELECT "Original title" FROM table_68840 WHERE "Title in English" = 'the last metro'
wikisql
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 time, COUNT(time) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = "Chiltern" GROUP BY time
nvbench
CREATE TABLE table_48849 ( "Date" text, "Pos." text, "Player" text, "From club" text, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Date of sep. 2008?
SELECT "Player" FROM table_48849 WHERE "Date" = 'sep. 2008'
wikisql
CREATE TABLE table_name_72 ( round VARCHAR, h___a VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round has an H/A of A with Notts County as opponents?
SELECT round FROM table_name_72 WHERE h___a = "a" AND opponents = "notts county"
sql_create_context
CREATE TABLE table_14968 ( "Name" text, "Tenure" text, "Courtesy title" text, "Court Rank" text, "Revenues" text, "Lineage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lineage of oka tadatomo ( )?
SELECT "Lineage" FROM table_14968 WHERE "Name" = 'ōoka tadatomo (大岡忠與)'
wikisql
CREATE TABLE table_name_47 ( area_km_2 INTEGER, status VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the status is rural community what's the lowest area in kilometers squared?
SELECT MIN(area_km_2) FROM table_name_47 WHERE status = "rural community"
sql_create_context
CREATE TABLE table_36395 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHo has a Home of philadelphia and a Series of flyers lead 1 0?
SELECT "Visitor" FROM table_36395 WHERE "Home" = 'philadelphia' AND "Series" = 'flyers lead 1–0'
wikisql
CREATE TABLE country ( country_id number, country text, last_update time ) CREATE TABLE customer ( customer_id number, store_id number, first_name text, last_name text, email text, address_id number, active boolean, create_date time, last_update time ) CREATE TABLE film...
SELECT store_id FROM inventory GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, ...
SELECT COUNT(Id) FROM Users WHERE CreationDate <= '##Date##'
sede
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( 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...
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1943196' AND t_kc21.IN_DIAG_DIS_NM = '慢性支气管炎')
css
CREATE TABLE table_31802 ( "Year" real, "Date" text, "Event" text, "Days" text, "Stages" text, "Acts" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the Metallica: Escape from the Studio show?
SELECT "Date" FROM table_31802 WHERE "Event" = 'metallica: escape from the studio'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid numb...
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56556')) AND lab.labname = 'ph' AND DATETIME(lab.labresulttime, 'start of year...
eicu
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 26175 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_15038373_1 ( license VARCHAR, software VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many licenses have mind workstation software?
SELECT COUNT(license) FROM table_15038373_1 WHERE software = "Mind WorkStation"
sql_create_context
CREATE TABLE table_name_2 ( winner VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won on September 6?
SELECT winner FROM table_name_2 WHERE date = "september 6"
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "ED"
mimicsql_data
CREATE TABLE table_name_3 ( games INTEGER, name VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Games has a Name of st phane dumas and a Rank larger than 5?
SELECT AVG(games) FROM table_name_3 WHERE name = "stéphane dumas" AND rank > 5
sql_create_context
CREATE TABLE table_56864 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the I Dessau Autobahnspinne race?
SELECT "Date" FROM table_56864 WHERE "Race Name" = 'i dessau autobahnspinne'
wikisql
CREATE TABLE table_name_55 ( position VARCHAR, nfl_draft VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position has 1958 as the NFL Draft, and jerry kramer as the player?
SELECT position FROM table_name_55 WHERE nfl_draft = 1958 AND player = "jerry kramer"
sql_create_context
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 diagnoses ( ...
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "GELCLAIR"
mimicsql_data
CREATE TABLE table_204_365 ( id number, "year" number, "single" text, "chart positions\nusa billboard hot dance club play" number, "chart positions\npolish charts" number, "album" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times has...
SELECT COUNT(*) FROM table_204_365 WHERE NOT "chart positions\nusa billboard hot dance club play" IS NULL
squall
CREATE TABLE table_26267607_2 ( winning_driver VARCHAR, fastest_lap VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where the fastest lap is Mike Rockenfeller, who is the winning driver?
SELECT winning_driver FROM table_26267607_2 WHERE fastest_lap = "Mike Rockenfeller"
sql_create_context
CREATE TABLE table_42935 ( "State" text, "White (%)" real, "Brown (%)" real, "Black (%)" real, "Asian or Amerindian (%)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Asian or Amerindian (%), when State is Sergipe, and when Brown...
SELECT SUM("Asian or Amerindian (%)") FROM table_42935 WHERE "State" = 'sergipe' AND "Brown (%)" > '61,3'
wikisql
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA...
atis
CREATE TABLE table_204_813 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year was the first competition ?
SELECT MIN("year") FROM table_204_813
squall
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'sodium bicarb') AS t1 JOIN (SELECT admissions...
mimic_iii
CREATE TABLE table_53865 ( "Player" text, "Position" text, "Tries" real, "Goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the lowest tries for goals more than 0 with centre position and points less than 54
SELECT MIN("Tries") FROM table_53865 WHERE "Goals" > '0' AND "Position" = 'centre' AND "Points" < '54'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53416')) AND intakeoutput.celllabel = 'per i...
eicu
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.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucocorticoid administration - oral' AND DATETIME(t...
eicu
CREATE TABLE table_1375 ( "County" text, "McCain %" text, "McCain Votes" real, "Obama %" text, "Obama Votes" real, "Others %" text, "Others Votes" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of others votes for when others...
SELECT COUNT("Others Votes") FROM table_1375 WHERE "Others %" = '2.0%'
wikisql
CREATE TABLE table_52064 ( "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. -- In what Venue was the Away Team Score 19.13 (127...
SELECT "Venue" FROM table_52064 WHERE "Away team score" = '19.13 (127)'
wikisql
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
SELECT Name, COUNT(Name) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY Name ORDER BY COUNT(Name)
nvbench
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE ground_service ...
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.c...
atis
CREATE TABLE table_2490289_1 ( pc_demo VARCHAR, c64_demo VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What won best pc demo when tower power (camelot) won best c64 demo?
SELECT pc_demo FROM table_2490289_1 WHERE c64_demo = "Tower Power (Camelot)"
sql_create_context
CREATE TABLE table_46819 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player with a score less than 72 and a to par of +1?
SELECT "Player" FROM table_46819 WHERE "Score" < '72' AND "To par" = '+1'
wikisql
CREATE TABLE table_name_42 ( uci_points INTEGER, cyclist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of UCI points for Kim Kirchen?
SELECT SUM(uci_points) FROM table_name_42 WHERE cyclist = "kim kirchen"
sql_create_context
CREATE TABLE table_65485 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the highest amount of losses of Camperdown when the against was less than 945?
SELECT MAX("Losses") FROM table_65485 WHERE "Club" = 'camperdown' AND "Against" < '945'
wikisql
CREATE TABLE table_name_59 ( tier VARCHAR, opponent_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When David McNamara was the opponent in the final, what was the tier?
SELECT tier FROM table_name_59 WHERE opponent_in_the_final = "david mcnamara"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE compartment_cla...
SELECT DISTINCT flight.flight_id FROM fare, flight, flight_fare WHERE (((flight.departure_time < 900 AND flight.flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 24 AND DATE_D...
atis
CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_day text ) CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date text, Share_in_p...
SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_2 ( city VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What city did Yugoslavia play Norway in?
SELECT city FROM table_name_2 WHERE opponent = "norway"
sql_create_context
CREATE TABLE table_80221 ( "Year" real, "Alabama" text, "Arkansas" text, "Auburn" text, "Ole Miss" text, "Mississippi St." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Alabama player associated with Walt Harris?
SELECT "Alabama" FROM table_80221 WHERE "Mississippi St." = 'walt harris'
wikisql
CREATE TABLE purchase ( Member_ID int, Branch_ID text, Year text, Total_pounds real ) CREATE TABLE branch ( Branch_ID int, Name text, Open_year text, Address_road text, City text, membership_amount text ) CREATE TABLE membership_register_branch ( Member_ID int, Branch_I...
SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID ORDER BY Name DESC
nvbench
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGE...
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM Has_amenity AS T3 JOIN Dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') GROUP BY Fname ORDER BY COUNT(Fname) DESC
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT demographic.age, demographic.admission_type FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_204_232 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- nation to earn the most gold medals after colombia
SELECT "nation" FROM table_204_232 WHERE "gold" < (SELECT "gold" FROM table_204_232 WHERE "nation" = 'colombia') ORDER BY "gold" DESC LIMIT 1
squall
CREATE TABLE table_15366768_1 ( isotopic_mass___u__ VARCHAR, nuclide VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mass of the element with a nuclide that is 169 tm?
SELECT isotopic_mass___u__ FROM table_15366768_1 WHERE nuclide = "169 Tm"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
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 = '004-64091')) AND vitalperiodic.heartrate < 79.0 AND NOT vitalperiodi...
eicu
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY COUNT(All_Home) DESC
nvbench
CREATE TABLE table_1341472_51 ( candidates VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the candidates in district Wisconsin 1?
SELECT candidates FROM table_1341472_51 WHERE district = "Wisconsin 1"
sql_create_context
CREATE TABLE table_13046 ( "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 4, and a Player of patrick johnson...
SELECT "Position" FROM table_13046 WHERE "Round" > '4' AND "Player" = 'patrick johnson'
wikisql
CREATE TABLE table_name_72 ( against VARCHAR, losses VARCHAR, byes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number listed under against when there were less than 13 losses and less than 2 byes?
SELECT COUNT(against) FROM table_name_72 WHERE losses < 13 AND byes < 2
sql_create_context