instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id...
SELECT invoice_number, COUNT(*) FROM Financial_Transactions GROUP BY invoice_number
nvbench
CREATE TABLE table_27369069_1 ( varsity_name VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team mascot for the soccer team in Charlottetown?
SELECT varsity_name FROM table_27369069_1 WHERE city = "Charlottetown"
sql_create_context
CREATE TABLE table_40330 ( "Eliminated" text, "Wrestler" text, "Entered" real, "Eliminated by" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the entered number for the person with a time of 29:28?
SELECT "Entered" FROM table_40330 WHERE "Time" = '29:28'
wikisql
CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2)...
SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY AVG(salary) DESC
nvbench
CREATE TABLE Project_Staff ( date_from VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the first staff for the projects started working?
SELECT date_from FROM Project_Staff ORDER BY date_from LIMIT 1
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49176 AND a...
mimic_iii
CREATE TABLE table_719 ( "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 is the district where the result is re-elected and the incumbent is r...
SELECT "District" FROM table_719 WHERE "Result" = 'Re-elected' AND "Incumbent" = 'Richard Kelly'
wikisql
CREATE TABLE table_name_1 ( melbourne VARCHAR, sydney VARCHAR, auckland VARCHAR, gold_coast VARCHAR, perth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result for Melbourne when Gold Coast, Perth, Auckland, and Sydney are no?
SELECT melbourne FROM table_name_1 WHERE gold_coast = "no" AND perth = "no" AND auckland = "no" AND sydney = "no"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time,...
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 10811 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE table_47363 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Scorers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the scorer mccoist (3), johnston, butcher, steven?
SELECT "Date" FROM table_47363 WHERE "Scorers" = 'mccoist (3), johnston, butcher, steven'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '2型糖尿病' AND jyjgzbb.JCZBMC = '低密度脂蛋白胆固醇' UNION SELECT jyjgzbb.CKZFW...
css
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( ...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 26218 AND STRFTIME('%y', admissions.admittime) = '2101'
mimic_iii
CREATE TABLE table_31821 ( "Year" real, "Competition" text, "Date" text, "Location" text, "Score" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At what location was there a loss on 20 jan?
SELECT "Location" FROM table_31821 WHERE "Result" = 'loss' AND "Date" = '20 jan'
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "WIDOWED" AND prescriptions.route = "NG"
mimicsql_data
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND procedures.short_title = "Drug detoxification"
mimicsql_data
CREATE TABLE table_name_86 ( draws INTEGER, club VARCHAR, goals_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest amount of draws club ud l rida, which has less than 41 goals, has?
SELECT MIN(draws) FROM table_name_86 WHERE club = "ud lérida" AND goals_for < 41
sql_create_context
CREATE TABLE table_name_46 ( area_km_2 INTEGER, official_name VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Area km 2 has an Official Name of stanley, and a Population larger than 1,817?
SELECT MAX(area_km_2) FROM table_name_46 WHERE official_name = "stanley" AND population > 1 OFFSET 817
sql_create_context
CREATE TABLE table_name_68 ( ovrs INTEGER, wkts VARCHAR, econ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Ovrs, when Wkts is greater than 13, and when Econ is less than 3.21?
SELECT MIN(ovrs) FROM table_name_68 WHERE wkts > 13 AND econ < 3.21
sql_create_context
CREATE TABLE table_28133 ( "Episode" real, "Air Date" text, "Team Swash" text, "Team guest captain" text, "Team Coxy" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the team swash when the team guest captain was gail porter?
SELECT "Team Swash" FROM table_28133 WHERE "Team guest captain" = 'Gail Porter'
wikisql
CREATE TABLE table_42275 ( "Position" text, "Jersey #" real, "Name" text, "Height (cm)" real, "Weight (kg)" real, "Birthdate" text, "Birthplace" text, "1999\u20132000 Team" text, "NHL Rights" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "Birthplace" FROM table_42275 WHERE "Jersey #" < '18' AND "Height (cm)" > '185' AND "Birthdate" = 'march 3, 1980'
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY MIN(Weight)
nvbench
CREATE TABLE table_60506 ( "Date" text, "Opponent" text, "Score" text, "Site/Stadium" text, "Loss" text, "Save" text, "Attendance" real, "Overall Record" text, "NCAAT Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the...
SELECT "Opponent" FROM table_60506 WHERE "Date" = 'june 15'
wikisql
CREATE TABLE table_68653 ( "Tournament" text, "2003" text, "2007" text, "2008" text, "2009" text, "2011" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2003 value with 1r in 2009 at the Australian Open?
SELECT "2003" FROM table_68653 WHERE "2009" = '1r' AND "Tournament" = 'australian open'
wikisql
CREATE TABLE table_21134 ( "Species" text, "Species common name" text, "NCBI Accession Number (mRNA/Protein)" text, "Length (bp/aa)" text, "Protein Identity" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NCBI Accession Number of the Hom...
SELECT "NCBI Accession Number (mRNA/Protein)" FROM table_21134 WHERE "Species" = 'Homo sapiens'
wikisql
CREATE TABLE table_50851 ( "Name" text, "Other names" text, "Birth" text, "Death" text, "Death Place" text, "Mother" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was birth when death place is n.a., other names is n.a. and name is wahid-un...
SELECT "Birth" FROM table_50851 WHERE "Death Place" = 'n.a.' AND "Other names" = 'n.a.' AND "Name" = 'wahid-un-nisa begum sahiba'
wikisql
CREATE TABLE table_25018 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when the vacator was Henry Latimer (f), what were th...
SELECT "Reason for change" FROM table_25018 WHERE "Vacator" = 'Henry Latimer (F)'
wikisql
CREATE TABLE people ( People_ID int, Name text, Age real, Height real, Hometown text ) CREATE TABLE gymnast ( Gymnast_ID int, Floor_Exercise_Points real, Pommel_Horse_Points real, Rings_Points real, Vault_Points real, Parallel_Bars_Points real, Horizontal_Bar_Points real...
SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown
nvbench
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality
nvbench
CREATE TABLE table_name_6 ( rank INTEGER, notes VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the rank of the rower with an r note from Australia?
SELECT SUM(rank) FROM table_name_6 WHERE notes = "r" AND country = "australia"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE time_inte...
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 = 'DENVER'...
atis
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE diagnosis ( diagn...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-88691...
eicu
CREATE TABLE table_name_54 ( time_retired VARCHAR, grid INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time of the driver in grid 2?
SELECT time_retired FROM table_name_54 WHERE grid < 2
sql_create_context
CREATE TABLE table_name_2 ( engine VARCHAR, driver VARCHAR, class VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What c class engine did philipp eng and team hs technik motorsport use?
SELECT engine FROM table_name_2 WHERE class = "c" AND team = "hs technik motorsport" AND driver = "philipp eng"
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 jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jybgb JOIN jyjgzbb ON jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE jybgb.JZLSH = '84548610152' AND jyjgzbb.JCRXM LIKE '李%'
css
CREATE TABLE table_28802 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Position in table" text, "Incoming manager" text, "Date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What...
SELECT "Manner of departure" FROM table_28802 WHERE "Incoming manager" = 'George Burley'
wikisql
CREATE TABLE table_60950 ( "Event" text, "Time" text, "Nationality" text, "Date" text, "Meet" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Time is '56.49'?
SELECT "Date" FROM table_60950 WHERE "Time" = '56.49'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) ...
SELECT DISTINCT flight_id FROM flight WHERE (((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 = 22 AND DATE_DAYalias0.month_number = 3 AND DATE_DAYalias0.year = 1991)) AND to...
atis
CREATE TABLE table_22875369_3 ( irish_points INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the max irish points for eastern michigan
SELECT MAX(irish_points) FROM table_22875369_3 WHERE opponent = "Eastern Michigan"
sql_create_context
CREATE TABLE table_name_52 ( loss VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who took the loss on May 20?
SELECT loss FROM table_name_52 WHERE date = "may 20"
sql_create_context
CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of...
SELECT Name, COUNT(*) FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.Manufacturer_ID = t2.Manufacturer_ID GROUP BY t1.Manufacturer_ID
nvbench
CREATE TABLE table_name_35 ( date_given VARCHAR, head_of_household VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was Rica head of household?
SELECT date_given FROM table_name_35 WHERE head_of_household = "rica"
sql_create_context
CREATE TABLE table_52693 ( "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 was the home team score when North Melbourn...
SELECT "Home team score" FROM table_52693 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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, J...
SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info 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 person_info_hz_info.KH = hz_info.KH AND pers...
css
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT * 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 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT demographic.discharge_location FROM demographic WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_name_82 ( attendance INTEGER, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average attendance when the Forest Green Rovers is the away team?
SELECT AVG(attendance) FROM table_name_82 WHERE away_team = "forest green rovers"
sql_create_context
CREATE TABLE table_73340 ( "Chapter" text, "Installation Date" text, "Institution" text, "Location" text, "Inactive" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the installation date for the Delta Chapter?
SELECT "Installation Date" FROM table_73340 WHERE "Chapter" = 'Delta'
wikisql
CREATE TABLE table_36893 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the visiting team when Winnipeg was the home team?
SELECT "Visitor" FROM table_36893 WHERE "Home" = 'winnipeg'
wikisql
CREATE TABLE table_65959 ( "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. -- Ho...
SELECT SUM("Latitude") FROM table_65959 WHERE "Water (sqmi)" = '0.267' AND "ANSI code" > '1759605'
wikisql
CREATE TABLE table_name_74 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team when geelong was the away team?
SELECT home_team FROM table_name_74 WHERE away_team = "geelong"
sql_create_context
CREATE TABLE market ( Market_ID int, Country text, Number_cities int ) CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE film ( Film_ID int, Title text, Stud...
SELECT Low_Estimate, High_Estimate FROM film_market_estimation
nvbench
CREATE TABLE table_38667 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team with laps of 97 and grid of 3
SELECT "Team" FROM table_38667 WHERE "Laps" = '97' AND "Grid" = '3'
wikisql
CREATE TABLE table_name_55 ( time VARCHAR, grid VARCHAR, rider VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time for a grid less than 6 for Noriyuki Haga?
SELECT time FROM table_name_55 WHERE grid < 6 AND rider = "noriyuki haga"
sql_create_context
CREATE TABLE table_2850912_5 ( college_junior_club_team VARCHAR, position VARCHAR, nhl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college/junior/club team played right wing position with NHL team Chicago Black Hawks?
SELECT college_junior_club_team FROM table_2850912_5 WHERE position = "Right Wing" AND nhl_team = "Chicago Black Hawks"
sql_create_context
CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Documen...
SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID ORDER BY T1.Project_Details DESC
nvbench
CREATE TABLE table_42625 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points has a Position of 3, and a Drawn s...
SELECT MAX("Points") FROM table_42625 WHERE "Position" = '3' AND "Drawn" < '2'
wikisql
CREATE TABLE table_12539 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week has Attendance of 71,740?
SELECT SUM("Week") FROM table_12539 WHERE "Attendance" = '71,740'
wikisql
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 diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "27652"
mimicsql_data
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Sc...
SELECT q.Id AS "question_id", q.CreationDate AS "question_date", MIN(a.CreationDate) AS "1st_answer_date", DATEDIFF(n, q.CreationDate, MIN(a.CreationDate)) AS "min_to_1st_answer" FROM Posts AS q LEFT OUTER JOIN Posts AS a ON q.Id = a.ParentId WHERE q.PostTypeId = 1 AND (a.PostTypeId = 2 OR a.PostTypeId IS NULL) AND q.D...
sede
CREATE TABLE gyb ( 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.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '沈馨欣' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 3945.59) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '沈馨欣' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED...
css
CREATE TABLE table_1817879_2 ( date_opened VARCHAR, segment_description VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date of segment description red line mos-2 north open?
SELECT date_opened FROM table_1817879_2 WHERE segment_description = "Red Line MOS-2 North"
sql_create_context
CREATE TABLE table_24330912_1 ( tournaments_played INTEGER, best_finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When t3 is the best finish what is the lowest amount of tournaments played?
SELECT MIN(tournaments_played) FROM table_24330912_1 WHERE best_finish = "T3"
sql_create_context
CREATE TABLE table_2007 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Year Joined" real, "Nickname" text, "Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nickname o...
SELECT "Nickname" FROM table_2007 WHERE "Institution" = 'Drexel University'
wikisql
CREATE TABLE table_15468 ( "Year" real, "English title" text, "Original title" text, "Country" text, "Director" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the country for 2002
SELECT "Country" FROM table_15468 WHERE "Year" = '2002'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '李晴画' AND mzjzjlb.JZKSRQ BETWEEN '2001-04-08' AND '2011-09-20' AND mzjzjlb.YLJGDM = '4822306'
css
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
SELECT p.Id AS "post_link" FROM Posts AS p INNER JOIN PostHistory AS ph ON p.Id = ph.PostId AND ph.PostHistoryTypeId = 10 AND ph.Comment = '103' WHERE NOT p.ClosedDate IS NULL ORDER BY p.CreationDate DESC
sede
CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number ) CREATE TABLE tags ( index number, id number, tag text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT groupname FROM torrents WHERE releasetype = "single" ORDER BY totalsnatched DESC LIMIT 100
whatcdhiphop
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT Votes.UserId AS "user_link", Posts.Id AS "post_link" FROM Votes JOIN Posts ON Posts.Id = Votes.PostId WHERE VoteTypeId = 5 AND Posts.PostTypeId = 1 AND Posts.OwnerUserId = '##UserId##' AND Posts.Id = '##PostId##'
sede
CREATE TABLE table_name_75 ( year VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did the rank of 31 happen in?
SELECT year FROM table_name_75 WHERE rank = "31"
sql_create_context
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cine...
SELECT Name, Capacity FROM cinema ORDER BY Capacity
nvbench
CREATE TABLE table_16768245_2 ( longitude VARCHAR, diameter VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many longitudes have a diameter of 224.0?
SELECT COUNT(longitude) FROM table_16768245_2 WHERE diameter = "224.0"
sql_create_context
CREATE TABLE table_name_50 ( fa_cup INTEGER, total VARCHAR, fa_trophy VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of FA cups of club Stalybridge Celtic, which has more than 0 FA trophies and a total less than 20?
SELECT SUM(fa_cup) FROM table_name_50 WHERE fa_trophy > 0 AND club = "stalybridge celtic" AND total < 20
sql_create_context
CREATE TABLE table_name_28 ( bronze INTEGER, gold VARCHAR, total VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the nation of poland had less than 17 medals but more than 1 gold medal, what's the Highest number of bronze medals?
SELECT MAX(bronze) FROM table_name_28 WHERE total < 17 AND nation = "poland" AND gold > 1
sql_create_context
CREATE TABLE table_name_47 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Home team score has a Home team of geelong?
SELECT home_team AS score FROM table_name_47 WHERE home_team = "geelong"
sql_create_context
CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE college ( cname text, state text, enr number ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT COUNT(*) FROM tryout WHERE decision = 'yes'
spider
CREATE TABLE table_61140 ( "Date" text, "Round" text, "Opponents" text, "H / A" text, "Result F \u2013 A" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent(s) in round 6?
SELECT "Opponents" FROM table_61140 WHERE "Round" = 'round 6'
wikisql
CREATE TABLE table_50166 ( "Cartridge" text, "Bullet weight" text, "Muzzle velocity" text, "Muzzle energy" text, "Max pressure" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the muzzle energy with grains (g) bullet weight and a max pressure...
SELECT "Muzzle energy" FROM table_50166 WHERE "Bullet weight" = 'grains (g)' AND "Max pressure" = '35,000 psi'
wikisql
CREATE TABLE table_43481 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" real, "Song" text, "Artist" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which song by David Essex spent 2 weeks on top of the charts?
SELECT "Song" FROM table_43481 WHERE "Weeks on Top" = '2' AND "Artist" = 'david essex'
wikisql
CREATE TABLE table_78355 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result for rounds under 2 against D.J. Linderman?
SELECT "Res." FROM table_78355 WHERE "Round" < '2' AND "Opponent" = 'd.j. linderman'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyj...
css
CREATE TABLE table_name_2 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 1983 has a Tournament of wimbledon?
SELECT 1983 FROM table_name_2 WHERE tournament = "wimbledon"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, g...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77586) AND prescriptions.drug = 'ceftriaxone' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
CREATE TABLE table_name_32 ( census_ranking VARCHAR, area_km_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the census ranking when the area km 2 is 173.4?
SELECT census_ranking FROM table_name_32 WHERE area_km_2 = 173.4
sql_create_context
CREATE TABLE table_204_481 ( id number, "poll source" text, "date(s)\nadministered" text, "sample\nsize" number, "margin of\nerror" text, "andrew\ncuomo (d)" text, "rob\nastorino (r)" text, "other" text, "undecided" text ) -- Using valid SQLite, answer the following questions for t...
SELECT "poll source" FROM table_204_481 ORDER BY "sample\nsize" DESC LIMIT 1
squall
CREATE TABLE table_1341640_39 ( result VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome of the election in Pennsylvania 6 district?
SELECT result FROM table_1341640_39 WHERE district = "Pennsylvania 6"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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_MZJZ...
css
CREATE TABLE table_name_24 ( total INTEGER, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Total of the Player with a To par of 13?
SELECT SUM(total) FROM table_name_24 WHERE to_par = "–13"
sql_create_context
CREATE TABLE table_202_7 ( id number, "year" text, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in what year did jon stewart have the highest number of roles ?
SELECT "year" FROM table_202_7 GROUP BY "year" ORDER BY COUNT("role") DESC LIMIT 1
squall
CREATE TABLE table_name_31 ( colour VARCHAR, compound_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What color is the super-soft compound?
SELECT colour FROM table_name_31 WHERE compound_name = "super-soft"
sql_create_context
CREATE TABLE table_29370 ( "Episode #" real, "Title" text, "Directed by" text, "Written by" text, "Originalairdate" text, "Ratings" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did the epiode that had 1.37 million as the rating origi...
SELECT "Originalairdate" FROM table_29370 WHERE "Ratings" = '1.37 Million'
wikisql
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7738882' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-01-07' AND '2010-10-09'
css
CREATE TABLE table_name_27 ( bronze INTEGER, event VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Bronze with the Event 1972 Heidelberg and Total less than 5?
SELECT MAX(bronze) FROM table_name_27 WHERE event = "1972 heidelberg" AND total < 5
sql_create_context
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 lab ( subject_id text, hadm_id text, ...
SELECT prescriptions.drug_type, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Oxacillin"
mimicsql_data
CREATE TABLE table_204_988 ( id number, "responsible minister(s)" text, "crown entities" text, "monitoring department(s)" text, "category / type" text, "empowering legislation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which responsible min...
SELECT "responsible minister(s)" FROM table_204_988 GROUP BY "responsible minister(s)" ORDER BY COUNT("empowering legislation") DESC LIMIT 1
squall
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 va...
SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Pleas...
SELECT title, AVG(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY title
nvbench
CREATE TABLE table_69248 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was their record when the attendance was 26,827?
SELECT "Record" FROM table_69248 WHERE "Attendance" = '26,827'
wikisql
CREATE TABLE table_name_68 ( date VARCHAR, game VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the game against Toronto which had a game number higher than 53?
SELECT date FROM table_name_68 WHERE game > 53 AND team = "toronto"
sql_create_context