instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_62724 ( "Name" text, "Premier League" real, "League Cup" real, "FA Cup" real, "UEFA Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which FA Cup has a Total smaller than 1?
SELECT AVG("FA Cup") FROM table_62724 WHERE "Total" < '1'
wikisql
CREATE TABLE table_28068645_8 ( total INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the minimum sum?
SELECT MIN(total) FROM table_28068645_8
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.fluid = "Other Body Fluid"
mimicsql_data
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 WHERE demographic.admission_type = "NEWBORN" AND demographic.dob_year < "2168"
mimicsql_data
CREATE TABLE table_name_74 ( date VARCHAR, event VARCHAR, acts VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the Monsters of Rock show with 12 bands?
SELECT date FROM table_name_74 WHERE event = "monsters of rock" AND acts = "12 bands"
sql_create_context
CREATE TABLE table_name_64 ( venue VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue features geelong as the away side?
SELECT venue FROM table_name_64 WHERE away_team = "geelong"
sql_create_context
CREATE TABLE table_1140088_6 ( constructor VARCHAR, race_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who constructed the I Italian Republic Grand Prix?
SELECT constructor FROM table_1140088_6 WHERE race_name = "I Italian Republic Grand Prix"
sql_create_context
CREATE TABLE table_30058355_2 ( fri_26_aug VARCHAR, mon_22_aug VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is shown for fri 26 aug when mon 22 aug is no time?
SELECT fri_26_aug FROM table_30058355_2 WHERE mon_22_aug = "—— No Time"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_62431 ( "Rank" text, "Name" text, "Height ft (m)" text, "Floors" real, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How tall is the building ranked #13?
SELECT "Height ft (m)" FROM table_62431 WHERE "Rank" = '13'
wikisql
CREATE TABLE table_42669 ( "Benchmark" text, "Crown height" text, "Pavilion depth" text, "Table diameter" text, "Girdle thickness" text, "Crown angle" text, "Pavilion angle" text, "Brilliance Grade" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Pavilion depth" FROM table_42669 WHERE "Crown angle" = '34.0–34.7°'
wikisql
CREATE TABLE Customers ( customer_id VARCHAR, customer_details VARCHAR ) CREATE TABLE Customer_Events ( date_moved_in VARCHAR, customer_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is each customer's move in date, and the corresponding cus...
SELECT T2.date_moved_in, T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id
sql_create_context
CREATE TABLE table_27721131_6 ( team VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team played them when andray blatche , javale mcgee (20) had the high points?
SELECT team FROM table_27721131_6 WHERE high_points = "Andray Blatche , JaVale McGee (20)"
sql_create_context
CREATE TABLE table_name_66 ( week VARCHAR, finalist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Week, when the Finalist is Carlos Moy (5)?
SELECT week FROM table_name_66 WHERE finalist = "carlos moyá (5)"
sql_create_context
CREATE TABLE table_17155250_1 ( film_title_used_in_nomination VARCHAR, original_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What name was used for nomination for the film with an original title of 'The Black Tulip'?
SELECT film_title_used_in_nomination FROM table_17155250_1 WHERE original_title = "The Black Tulip"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span 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, fare, fare_basis, flight, flight_fare WHERE ((fare_basis.class_type = 'COACH' AND fare.fare_basis_code = fare_basis.fare_basis_code) AND CITY_1.city_code = AIRPORT_SERVICE_1....
atis
CREATE TABLE table_35409 ( "Year" real, "Jewish" real, "Muslim" real, "Christian" real, "Druze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average muslim that has a druze less than 2,534, a year prior to 2005, and a...
SELECT AVG("Muslim") FROM table_35409 WHERE "Druze" < '2,534' AND "Year" = '2005' AND "Jewish" > '100,657'
wikisql
CREATE TABLE table_name_51 ( res VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the 4:27 fight?
SELECT res FROM table_name_51 WHERE time = "4:27"
sql_create_context
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '慢性牙周炎' AND jyjgzbb.JCZBDM = '261843'
css
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAUKEE' AND date_day.day_number = 20 AND date_day.month_number = 1 AN...
atis
CREATE TABLE table_67164 ( "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 score of Australia?
SELECT "Score" FROM table_67164 WHERE "Country" = 'australia'
wikisql
CREATE TABLE table_18153 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Results" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the party elected in the district that first elected in 1990?
SELECT "Party" FROM table_18153 WHERE "First elected" = '1990'
wikisql
CREATE TABLE table_17626 ( "Municipality" text, "Population" real, "Police officers" real, "Residents per officer" real, "Total costs (2005)" text, "Cost per capita" text, "Case burden" real, "Crime rate per 1,000 people" real, "Police force" text ) -- Using valid SQLite, answer th...
SELECT "Cost per capita" FROM table_17626 WHERE "Total costs (2005)" = '$700,116'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY inputevents_cv.it...
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.dod_year <= "2155.0" AND diagnoses.icd9_code = "4240"
mimicsql_data
CREATE TABLE table_1342270_3 ( first_elected VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the first elected with incumbent being joe starnes
SELECT first_elected FROM table_1342270_3 WHERE incumbent = "Joe Starnes"
sql_create_context
CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_address_from DATETIME, address_type VARCHAR(15), date_address_to DATETIME ) CREATE TABLE Products ( product_id INTEGER, product_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, payme...
SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' ORDER BY COUNT(active_from_date)
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "UPPER GI BLEED"
mimicsql_data
CREATE TABLE table_18493 ( "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 are the candidates for noah m. mason?
SELECT COUNT("Candidates") FROM table_18493 WHERE "Incumbent" = 'Noah M. Mason'
wikisql
CREATE TABLE table_name_67 ( meet VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Meet has a Club of centro de natacon carabobo?
SELECT meet FROM table_name_67 WHERE club = "centro de natacon carabobo"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'implt/repl carddefib ...
mimic_iii
CREATE TABLE table_42287 ( "Rank" real, "Player" text, "Country" text, "Earnings( $ )" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest wins of Larry Nelson, who ranked less than 5?
SELECT MIN("Wins") FROM table_42287 WHERE "Player" = 'larry nelson' AND "Rank" < '5'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayNa...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%fremont%' OR UPPER(Location) LIKE '%FREMONT%' OR Location LIKE '%fremont%' AND Reputation >= 1000 ORDER BY Reputation DESC
sede
CREATE TABLE Customers ( customer_id INTEGER, payment_method VARCHAR(15), customer_name VARCHAR(80), date_became_customer DATETIME, other_customer_details VARCHAR(255) ) CREATE TABLE Order_Items ( order_id INTEGER, product_id INTEGER, order_quantity VARCHAR(15) ) CREATE TABLE Customer_...
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) DESC
nvbench
CREATE TABLE table_1513 ( "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("Loss") FROM table_1513 WHERE "Institution" = 'Michigan State Spartans'
wikisql
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, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '86828604' AND t_kc22.STA_DATE BETWEEN '2019-04-10' AND '2019-04-22' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸帕罗西汀片'
css
CREATE TABLE table_name_82 ( date VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the date in 1786?
SELECT date FROM table_name_82 WHERE year = 1786
sql_create_context
CREATE TABLE table_21891 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome in 1975?
SELECT "Outcome" FROM table_21891 WHERE "Year" = '1975'
wikisql
CREATE TABLE table_2746 ( "Season" real, "Winner" text, "Captain" text, "Coach" text, "League finish" text, "Mat" real, "W" real, "L" real, "Win %" text, "Runner-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the captain...
SELECT "Captain" FROM table_2746 WHERE "Runner-up" = 'Royal Challengers Bangalore' AND "L" = '5'
wikisql
CREATE TABLE table_name_23 ( age_as_of_1_february_2014 VARCHAR, province_or_country_of_birth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average age as of February 1, 2014 for the supercentenarians born in the United States?
SELECT age_as_of_1_february_2014 FROM table_name_23 WHERE province_or_country_of_birth = "united states"
sql_create_context
CREATE TABLE table_18424435_4 ( directed_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode with a production code of 301?
SELECT directed_by FROM table_18424435_4 WHERE production_code = 301
sql_create_context
CREATE TABLE table_62998 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college did the player picked number 136 go to?
SELECT "College" FROM table_62998 WHERE "Pick" = '136'
wikisql
CREATE TABLE table_203_875 ( id number, "#" number, "name" text, "birth and death" text, "office started" text, "office ended" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which bishop served between the years of 1846 and 1866 ?
SELECT "name" FROM table_203_875 WHERE "office started" >= 1846 AND "office ended" <= 1866
squall
CREATE TABLE table_name_33 ( others VARCHAR, martin VARCHAR, source VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percent of others did ogm/news count when MARTIN had 9%?
SELECT others FROM table_name_33 WHERE martin = "9%" AND source = "ogm/news"
sql_create_context
CREATE TABLE table_name_38 ( güzelçamlı’s_lost_panther VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2005 has a G zel aml s Lost Panther of the muse?
SELECT MAX(2005) FROM table_name_38 WHERE güzelçamlı’s_lost_panther = "the muse"
sql_create_context
CREATE TABLE table_name_4 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2012 that has tournament played as the tournament?
SELECT 2012 FROM table_name_4 WHERE tournament = "tournament played"
sql_create_context
CREATE TABLE table_16787 ( "Series #" real, "Episode title" text, "Writer(s)" text, "Director" text, "U.S. viewers (millions)" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Shelia Lawrence join the series?
SELECT MIN("Series #") FROM table_16787 WHERE "Writer(s)" = 'Shelia Lawrence'
wikisql
CREATE TABLE table_name_1 ( silver INTEGER, nation VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Silver has a Nation of total, and a Bronze smaller than 18?
SELECT MAX(silver) FROM table_name_1 WHERE nation = "total" AND bronze < 18
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb...
css
CREATE TABLE table_name_47 ( bowl_game VARCHAR, season VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which bowl game has a season greater than 2008, with new orleans, Louisiana as the location?
SELECT bowl_game FROM table_name_47 WHERE season > 2008 AND location = "new orleans, louisiana"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.MED_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '03425240816')
css
CREATE TABLE table_59852 ( "Year" real, "Song" text, "Artist" text, "Place" text, "Points" text, "Composer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the place in 2007 for the song ' work your magic '?
SELECT "Place" FROM table_59852 WHERE "Year" = '2007' AND "Song" = ' work your magic '
wikisql
CREATE TABLE table_75683 ( "Position" text, "Number" real, "Name" text, "Height" text, "Weight" real, "Class" text, "Hometown" text, "Games\u2191" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Class has a Weight of 203?
SELECT "Class" FROM table_75683 WHERE "Weight" = '203'
wikisql
CREATE TABLE table_2562572_2 ( population__1991_ VARCHAR, urban_settlement VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1991 population for the urban settlement named Ba ki Jarak?
SELECT population__1991_ FROM table_2562572_2 WHERE urban_settlement = "Bački Jarak"
sql_create_context
CREATE TABLE table_name_4 ( total INTEGER, nation VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Total has a Nation of united states, and a Bronze larger than 3?
SELECT MAX(total) FROM table_name_4 WHERE nation = "united states" AND bronze > 3
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 mzjzjlb.JZJSSJ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '51166395425'
css
CREATE TABLE table_204_212 ( id number, "wager" text, "winner" text, "loser" text, "location" text, "date" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the last wager on the chart ?
SELECT "wager" FROM table_204_212 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_name_5 ( br_number VARCHAR, lms_number INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which BR number has an LMS number over 14768?
SELECT br_number FROM table_name_5 WHERE lms_number > 14768
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31482 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_19 ( venue VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game when Collingwood was the home team?
SELECT venue FROM table_name_19 WHERE away_team = "collingwood"
sql_create_context
CREATE TABLE table_77024 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Gold, when Silver is 2, and when Total is less than 7?
SELECT COUNT("Gold") FROM table_77024 WHERE "Silver" = '2' AND "Total" < '7'
wikisql
CREATE TABLE table_204_479 ( id number, "defendant" text, "arrested" text, "charge" text, "result" text, "sentence" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- vernon cassel and reginald shaffer was sentenced how many years ?
SELECT "sentence" FROM table_204_479 WHERE "defendant" IN ('vernon cassel', 'reginald shaffer')
squall
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 booking_class, class_description, rank FROM class_of_service WHERE booking_class = 'B' OR booking_class = 'Q'
atis
CREATE TABLE table_67505 ( "Season" real, "Cars Entered" real, "Winning Driver" text, "Second Driver" text, "Third Driver" text, "Race Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the largest Cars Entered with a Winning Driver...
SELECT MAX("Cars Entered") FROM table_67505 WHERE "Winning Driver" = 'rodger ward' AND "Season" < '1959'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY AVG(meter_100)
nvbench
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, H...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '6786102' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸多奈哌齐胶囊'
css
CREATE TABLE mzb ( 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 qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '1314915' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM gyb JOIN t_kc24 ON gyb...
css
CREATE TABLE table_69810 ( "Year" text, "Men's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which women's doubles has a Year of 1992?
SELECT "Women's doubles" FROM table_69810 WHERE "Year" = '1992'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antibacte...
eicu
CREATE TABLE table_203_221 ( id number, "name" text, "nationality" text, "matches played" number, "goals scored" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of matches played by brazilians for melbourn...
SELECT SUM("matches played") FROM table_203_221 WHERE "nationality" = 'brazil'
squall
CREATE TABLE table_name_28 ( title VARCHAR, translation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which title has the Translation of vesoul?
SELECT title FROM table_name_28 WHERE translation = "vesoul"
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb 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.JZ...
css
CREATE TABLE table_35249 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Total medals for the team with a Rank of 8, 1 Bronze and more than 1 Silver?
SELECT MIN("Total") FROM table_35249 WHERE "Bronze" = '1' AND "Rank" = '8' AND "Silver" > '1'
wikisql
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.JYZBLSH 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 = ...
css
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, descript...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 23 AND date_day.month_number = 4...
atis
CREATE TABLE table_name_28 ( grid INTEGER, driver VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the grid for Johnny Herbert with more than 52 laps?
SELECT SUM(grid) FROM table_name_28 WHERE driver = "johnny herbert" AND laps > 52
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, depart...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_nam...
atis
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7880116' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '78801...
css
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
SELECT account_id, COUNT(*) FROM Financial_Transactions GROUP BY account_id
nvbench
CREATE TABLE table_2501754_4 ( viewing_figures_millions VARCHAR, prod_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many millions of people watched the episode with a production code of icec483x?
SELECT viewing_figures_millions FROM table_2501754_4 WHERE prod_code = "ICEC483X"
sql_create_context
CREATE TABLE table_name_68 ( position VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position does the player from Muscle Shoals, Alabama play?
SELECT position FROM table_name_68 WHERE hometown = "muscle shoals, alabama"
sql_create_context
CREATE TABLE table_61203 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2nd leg that Team 1 is Union Berlin?
SELECT "2nd leg" FROM table_61203 WHERE "Team 1" = 'union berlin'
wikisql
CREATE TABLE table_56970 ( "Track" real, "Title" text, "Translation" text, "Composer" text, "Recorded" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which title has a Track of 3?
SELECT "Title" FROM table_56970 WHERE "Track" = '3'
wikisql
CREATE TABLE table_60117 ( "Rank" real, "Club" text, "Season" text, "Goals" real, "Apps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Season has a Club of real madrid, and a Rank smaller than 6, and less than 121 goals?
SELECT "Season" FROM table_60117 WHERE "Club" = 'real madrid' AND "Rank" < '6' AND "Goals" < '121'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varc...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_re...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 7 AND date_day.month_number = 7 AND da...
atis
CREATE TABLE table_66971 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the margin of victory for Isao Aoki when he was a runner-up?
SELECT "Margin of victory" FROM table_66971 WHERE "Runner(s)-up" = 'isao aoki'
wikisql
CREATE TABLE table_51673 ( "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 Away team has a Home team score of 18.12 (1...
SELECT "Away team" FROM table_51673 WHERE "Home team score" = '18.12 (120)'
wikisql
CREATE TABLE table_name_27 ( total_medals INTEGER, gold_medals VARCHAR, ensemble VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Total Medals that has 0 Gold Medal and a Ensemble of east 80 indoor percussion?
SELECT MAX(total_medals) FROM table_name_27 WHERE gold_medals = 0 AND ensemble = "east 80 indoor percussion"
sql_create_context
CREATE TABLE table_name_84 ( goals_for INTEGER, drawn INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total sum of the goals at competitions with more than 10 draws?
SELECT SUM(goals_for) FROM table_name_84 WHERE drawn > 10
sql_create_context
CREATE TABLE table_name_25 ( year_left INTEGER, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year that the Roughriders left the conference?
SELECT MAX(year_left) FROM table_name_25 WHERE mascot = "roughriders"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE procedures...
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23760 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND microbiologyevents.spec_type_desc = 'eye' AND NOT microbiologyeven...
mimic_iii
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 512...
mimic_iii
CREATE TABLE table_name_30 ( miss_maja_pilipinas VARCHAR, binibining_pilipinas_tourism VARCHAR, binibining_pilipinas_universe VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Miss Maja Pilipinas has a Binibining Pilipinas-Tourism of not awarded, and a...
SELECT miss_maja_pilipinas FROM table_name_30 WHERE binibining_pilipinas_tourism = "not awarded" AND binibining_pilipinas_universe = "anjanette abayari"
sql_create_context
CREATE TABLE table_name_76 ( until VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Jos Luis S nchez Sol end his term of coaching?
SELECT until FROM table_name_76 WHERE name = "josé luis sánchez solá"
sql_create_context
CREATE TABLE table_17118657_10 ( high_points VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the score is 62-70, what are the high points?
SELECT high_points FROM table_17118657_10 WHERE score = "62-70"
sql_create_context
CREATE TABLE table_203_439 ( id number, "pos." number, "rider" text, "semi-final points" number, "final points" number, "final heats" text, "total points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is hisor her total semifinal poi...
SELECT "semi-final points" FROM table_203_439 WHERE "pos." = 12
squall
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "72" AND prescriptions.drug = "Sodium CITRATE 4%"
mimicsql_data
CREATE TABLE table_204_360 ( id number, "year" number, "host" text, "gold" text, "silver" text, "bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many countries took home the gold the same year they hosted fiba ?
SELECT COUNT(*) FROM table_204_360 WHERE "host" = "gold"
squall
CREATE TABLE table_name_68 ( school VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which school is the player who is headed to Duke from?
SELECT school FROM table_name_68 WHERE college = "duke"
sql_create_context