instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_77 ( outgoing_manager VARCHAR, date_of_vacancy VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Outgoing Manager, when Date of Vacancy is '25 September 2008'?
SELECT outgoing_manager FROM table_name_77 WHERE date_of_vacancy = "25 september 2008"
sql_create_context
CREATE TABLE table_name_81 ( silver INTEGER, nation VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silver medals for germany with a bronze count more than 0?
SELECT MAX(silver) FROM table_name_81 WHERE nation = "germany" AND bronze > 0
sql_create_context
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURS...
advising
CREATE TABLE table_30400 ( "# (season #)" text, "No. (episode #)" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the orginal air date ...
SELECT "Original air date" FROM table_30400 WHERE "Prod. code" = '2ACX12'
wikisql
CREATE TABLE table_name_30 ( introduced INTEGER, seating VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the aircraft introduced that could seat 115 people?
SELECT AVG(introduced) FROM table_name_30 WHERE seating = "115"
sql_create_context
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT DISTINCT PostHistory.PostId AS "post_link" FROM PostHistory, Posts WHERE PostHistory.PostId = Posts.Id AND PostHistory.UserId = '##UserId##' AND PostHistoryTypeId BETWEEN 4 AND 6 AND Posts.Tags LIKE '%<' + '##tag:string##' + '>%'
sede
CREATE TABLE table_203_333 ( id number, "kilometers" number, "name" text, "location" text, "intersecting routes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the last junction on highway 91 ?
SELECT "name" FROM table_203_333 ORDER BY "kilometers" DESC LIMIT 1
squall
CREATE TABLE Stay ( StayID INTEGER, Patient INTEGER, Room INTEGER, StayStart DATETIME, StayEnd DATETIME ) CREATE TABLE Nurse ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), Registered BOOLEAN, SSN INTEGER ) CREATE TABLE Trained_In ( Physician INTEGER, Trea...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY T1.Name DESC
nvbench
CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE cla...
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name
nvbench
CREATE TABLE table_25277363_2 ( written_by VARCHAR, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote episode number 149 in the series?
SELECT written_by FROM table_25277363_2 WHERE no_in_series = 149
sql_create_context
CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age ...
SELECT Country, COUNT(Country) FROM people WHERE Age < (SELECT AVG(Age) FROM people) GROUP BY Country
nvbench
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.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.short_title = "Renal & ureteral dis NOS"
mimicsql_data
CREATE TABLE table_1505 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Falcons points" real, "Opponents" real, "Record" text, "Streak" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Did the Falcons ha...
SELECT "Result" FROM table_1505 WHERE "Record" = '3-7'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester...
advising
CREATE TABLE table_name_6 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Home Team is 'Everton'?
SELECT date FROM table_name_6 WHERE home_team = "everton"
sql_create_context
CREATE TABLE table_62579 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has a to par greater than 15, money ($) greater than 116, with billy bur...
SELECT "Score" FROM table_62579 WHERE "To par" > '15' AND "Money ( $ )" > '116' AND "Player" = 'billy burke'
wikisql
CREATE TABLE table_2817 ( "Month" text, "Week" real, "Overall" text, "Offensive" text, "Defensive" text, "Transition" text, "Rookie" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of offensive for colin doyle
SELECT COUNT("Offensive") FROM table_2817 WHERE "Overall" = 'Colin Doyle'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number ...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'ALA' AND number = 325
advising
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "HISPANIC OR LATINO"
mimicsql_data
CREATE TABLE table_8262 ( "Name" text, "Company" text, "Tracking Method" text, "Latest stable release" text, "Price in USD" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Latest stable release that has a Price in USD of free / negotiable?
SELECT "Latest stable release" FROM table_8262 WHERE "Price in USD" = 'free / negotiable'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX num...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
SELECT containsTags.TagName, COUNT(containsTags.TagName) AS usageCount FROM Posts JOIN Tags AS alternate ON alternate.TagName LIKE '##TagName:string##' JOIN PostTags AS alternateRel ON alternateRel.TagId = alternate.Id AND alternateRel.PostId = Posts.Id JOIN PostTags AS tagRel ON tagRel.PostId = Posts.Id JOIN Tags AS c...
sede
CREATE TABLE table_56698 ( "PRR Class" text, "Builder\u2019s Model" text, "Build date" text, "Total produced" real, "Wheel arrangement" text, "Service" text, "Power output" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the build da...
SELECT "Build date" FROM table_56698 WHERE "PRR Class" = 'ff20' AND "Builder\u2019s Model" = 'erie built'
wikisql
CREATE TABLE products ( code number, name text, price number, manufacturer number ) CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What a...
SELECT name FROM products
spider
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'carrier' AND d_item...
mimic_iii
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT Id AS "post_link", Tags AS "tags", Score, ViewCount AS Views, CreationDate AS "date_asked" FROM Posts WHERE Tags LIKE '%<' + '##TagName:string##' + '>%' AND ClosedDate IS NULL AND (AnswerCount = 1)
sede
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '41068843' AND hz_info.YLJGDM = '5511402' AND NOT mzjzjlb.JZKSMC LIKE '%肠镜%'
css
CREATE TABLE table_name_68 ( bronze INTEGER, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bronzes have a Total of 9?
SELECT SUM(bronze) FROM table_name_68 WHERE total = 9
sql_create_context
CREATE TABLE table_name_98 ( australian_national_kennel_council_toy_dogs_group VARCHAR, the_kennel_club__uk__toy_group VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Australian National Kennel Council Toy Dogs Group with papillon as the Kennel Cl...
SELECT australian_national_kennel_council_toy_dogs_group FROM table_name_98 WHERE the_kennel_club__uk__toy_group = "papillon"
sql_create_context
CREATE TABLE table_28246 ( "Metropolitan ring" text, "Localities" real, "Total" real, "Jews and others 1" real, "Thereof: Jews" real, "Arabs" real, "Population density (per km\u00b2)" text, "Annual Population growth rate" text ) -- Using valid SQLite, answer the following questions for...
SELECT "Metropolitan ring" FROM table_28246 WHERE "Thereof: Jews" = '30600'
wikisql
CREATE TABLE customers_policies ( customer_id VARCHAR ) CREATE TABLE customers ( customer_id VARCHAR, customer_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many policies are listed for the customer named 'Dayana Robel'?
SELECT COUNT(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Dayana Robel"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-76683' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala...
eicu
CREATE TABLE table_2646656_3 ( incumbent VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the incumbent in the Ohio 10 district?
SELECT incumbent FROM table_2646656_3 WHERE district = "Ohio 10"
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Noninf gastroenterit NEC" AND lab.fluid = "Pleural"
mimicsql_data
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 JYKSBM, JYKSMC FROM jybgb WHERE BGDH = '65530393272'
css
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 zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i...
css
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is minimum age for dif...
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job
nvbench
CREATE TABLE table_name_78 ( conf VARCHAR, head_coach VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the conference that K. C. Jones was a head coach in?
SELECT conf FROM table_name_78 WHERE head_coach = "k. c. jones"
sql_create_context
CREATE TABLE table_40469 ( "Pos." text, "Player" text, "Team" text, "Height" text, "Weight" real, "First round" text, "Final round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height of the player with a first round score of 4...
SELECT "Height" FROM table_40469 WHERE "First round" = '44.1'
wikisql
CREATE TABLE table_12740151_8 ( clock_speed VARCHAR, price___usd__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the clock speed of the model that costs $910?
SELECT clock_speed FROM table_12740151_8 WHERE price___usd__ = "$910"
sql_create_context
CREATE TABLE table_name_66 ( time VARCHAR, lane VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much total time was in lane 4?
SELECT COUNT(time) FROM table_name_66 WHERE lane = 4
sql_create_context
CREATE TABLE greatermanchestercrime ( crimeid text, crimets time, location text, lsoa text, type text, outcome text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the most dangerous area?
SELECT location FROM greatermanchestercrime GROUP BY location ORDER BY COUNT(*) DESC LIMIT 1
greatermanchestercrime
CREATE TABLE table_1322914_1 ( windows VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Is icewind dale available for windows
SELECT windows FROM table_1322914_1 WHERE title = "Icewind Dale"
sql_create_context
CREATE TABLE zyb ( 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 SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_SEX = '潘虹颖' AND t_kc22.STA_DATE BETWEEN '2009-07-02' AND '2014-03-08' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) 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, ...
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIM...
atis
CREATE TABLE table_62137 ( "Round" real, "Race" text, "Circuit" text, "Date" text, "Event" text, "Winning driver" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Round is less than 10, and when Circuit is 'Norisring'?
SELECT "Date" FROM table_62137 WHERE "Round" < '10' AND "Circuit" = 'norisring'
wikisql
CREATE TABLE table_22460085_1 ( character VARCHAR, original_manchester_performer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What character did Lisa Davina Phillip portray?
SELECT character FROM table_22460085_1 WHERE original_manchester_performer = "Lisa Davina Phillip"
sql_create_context
CREATE TABLE table_67833 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- yes or no for the auckland with a yes for sydney, no for perth, yes for melbo...
SELECT "Auckland" FROM table_67833 WHERE "Sydney" = 'yes' AND "Perth" = 'no' AND "Melbourne" = 'yes' AND "Gold Coast" = 'yes'
wikisql
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, ...
SELECT T2.Party, AVG(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY AVG(COUNT(*))
nvbench
CREATE TABLE table_483 ( "Season #" real, "Series #" real, "Title" text, "Canadian airdate" text, "U.S. airdate" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of u.s. air dates with a title of 'd...
SELECT COUNT("U.S. airdate") FROM table_483 WHERE "Title" = 'Dermabrasion'
wikisql
CREATE TABLE table_name_59 ( rank INTEGER, silver VARCHAR, gold VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the sum of rank for when gold is more than 0 and silver less than 23 with total more than 32
SELECT SUM(rank) FROM table_name_59 WHERE gold > 0 AND total > 32 AND silver < 23
sql_create_context
CREATE TABLE table_204_869 ( id number, "species" text, "country of origin" text, "total released" number, "first release" text, "last release" text, "areas of release" text, "areas established" text, "pasture type" text ) -- Using valid SQLite, answer the following questions for t...
SELECT "total released" FROM table_204_869 WHERE "species" = 'liatongus militaris castelanu'
squall
CREATE TABLE table_name_85 ( mult VARCHAR, model_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Mult, when Model Number is Pentium II 450?
SELECT mult FROM table_name_85 WHERE model_number = "pentium ii 450"
sql_create_context
CREATE TABLE Product ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255) ) CREATE TABLE Problems ( problem_id INTEGER, product_id INTEGER, closure_authorised_by_staff_id INTEGER, reported_by_staff_id INTEGER, date_problem_reported DATETIME, date_problem_clos...
SELECT COUNT(*), T1.product_id FROM Problems AS T1 JOIN Product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > "1986-11-13" GROUP BY T2.product_id
nvbench
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int )...
SELECT COUNT(*) > 0, program_course.workload FROM course, program_course WHERE course.department = 'ASIANLAN' AND course.number = 465 AND program_course.course_id = course.course_id AND program_course.workload > 3
advising
CREATE TABLE table_5971 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Rank smaller than 5, and a Time of 31 03.093 is what rider?
SELECT "Rider" FROM table_5971 WHERE "Rank" < '5' AND "Time" = '31’ 03.093'
wikisql
CREATE TABLE table_24425491_3 ( cover_model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played 20 questions during the issue in which Pamela Horton is on the cover?
SELECT 20 AS _questions FROM table_24425491_3 WHERE cover_model = "Pamela Horton"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '013-29856'
eicu
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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.age < "55" AND procedures.long_title = "Administration of inhaled nitric oxide"
mimicsql_data
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), CO...
SELECT LAST_NAME, DEPARTMENT_ID FROM employees ORDER BY DEPARTMENT_ID DESC
nvbench
CREATE TABLE table_name_42 ( date VARCHAR, recipient VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did Passion Pictures receive an award?
SELECT date FROM table_name_42 WHERE recipient = "passion pictures"
sql_create_context
CREATE TABLE table_65802 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the competition that happened in Singapore?
SELECT "Competition" FROM table_65802 WHERE "Venue" = 'singapore'
wikisql
CREATE TABLE table_204_567 ( id number, "team" text, "location" text, "stadium" text, "capacity" number, "manager" text, "captain" text, "kit manufacturer" text, "shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many...
SELECT COUNT("team") FROM table_204_567 WHERE "kit manufacturer" = 'samurai'
squall
CREATE TABLE table_train_262 ( "id" int, "gender" string, "hemoglobin_a1c_hba1c" float, "obesity" bool, "diabetic" string, "hba1c" float, "body_mass_index_bmi" float, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT * FROM table_train_262 WHERE hba1c >= 8
criteria2sql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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 COUNT(*) FROM t_kc22 WHERE t_kc22.MED_ORG_DEPT_CD = '9438' AND t_kc22.STA_DATE BETWEEN '2003-05-10' AND '2005-01-31' AND t_kc22.SOC_SRT_DIRE_NM = '复方丙酸氯倍他索软膏'
css
CREATE TABLE table_74740 ( "Municipality" text, "Inhabitants" real, "Mayor" text, "Party" text, "Election" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the election earlier than 2012 how many Inhabitants had a Party of five star movement?
SELECT SUM("Inhabitants") FROM table_74740 WHERE "Party" = 'five star movement' AND "Election" < '2012'
wikisql
CREATE TABLE table_34137 ( "Year" text, "Title" text, "Director" text, "Distributor(s)" text, "Box office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What movie earned $1,659,542 at the box office?
SELECT "Title" FROM table_34137 WHERE "Box office" = '$1,659,542'
wikisql
CREATE TABLE table_54032 ( "Name v t e" text, "Pos." text, "Height" text, "Weight" text, "Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the weight of the v t e of du ko pijetlovi category:articles with hcards?
SELECT "Weight" FROM table_54032 WHERE "Name v t e" = 'duško pijetlović category:articles with hcards'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Name, Weight FROM people ORDER BY Weight
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_ORG_DEPT_NM, OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '9564037' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_CD
css
CREATE TABLE table_39242 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round has a Player of anthony christnovich?
SELECT "Round" FROM table_39242 WHERE "Player" = 'anthony christnovich'
wikisql
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 d_icd_diagnoses ( row_id number, icd9_code text, sh...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94316) AND STRFTIME('%y-%m', prescriptions.startdate) = '2103-03' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE table_68967 ( "Event" text, "Date" text, "DP / DA" real, "NP / NNP" text, "COPE" text, "ACDP" real, "Others" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the NP/NNP for ACDP of 1 and others of 1 and DP/DA of 5
SELECT "NP / NNP" FROM table_68967 WHERE "ACDP" = '1' AND "Others" = '1' AND "DP / DA" = '5'
wikisql
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE aircraft ( aircraft_code varc...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU...
atis
CREATE TABLE table_70001 ( "Unit" text, "Reactortype" text, "Net capacity" text, "Gross capacity" text, "Construction started" text, "Electricity Grid" text, "Commercial Operation" text, "Shutdown" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Reactortype" FROM table_70001 WHERE "Gross capacity" = '417 mw' AND "Electricity Grid" = '27.12.1971'
wikisql
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "0389" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_77088 ( "Couple" text, "Style" text, "Music" text, "Choreographer(s)" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What couple had a safe result and a lyrical jazz style?
SELECT "Couple" FROM table_77088 WHERE "Result" = 'safe' AND "Style" = 'lyrical jazz'
wikisql
CREATE TABLE COURSES ( course_description VARCHAR, course_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the descriptions of the courses with name 'database'?
SELECT course_description FROM COURSES WHERE course_name = "database"
sql_create_context
CREATE TABLE Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, Team text, Primary_Conference text, building_id text ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real...
SELECT Name, Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880 ORDER BY Height_feet DESC
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) ...
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE table_40689 ( "Year" real, "Class" text, "Team" text, "Points" real, "Rank" text, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Team has a Class of 350cc, with less than 13 points in 1959?
SELECT "Team" FROM table_40689 WHERE "Class" = '350cc' AND "Points" < '13' AND "Year" = '1959'
wikisql
CREATE TABLE table_31819 ( "Week" real, "Date" text, "Opponent" text, "Time ( ET )" text, "Game Site" text, "Final Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where will the game at (ET) of 7:00 pm be at?
SELECT "Game Site" FROM table_31819 WHERE "Time ( ET )" = '7:00 pm'
wikisql
CREATE TABLE photos ( photo_id number, tourist_attraction_id number, name text, description text, filename text, other_details text ) CREATE TABLE museums ( museum_id number, museum_details text ) CREATE TABLE street_markets ( market_id number, market_details text ) CREATE TAB...
SELECT T1.name, T2.tourist_attraction_id, COUNT(*) FROM tourist_attractions AS T1 JOIN visits AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id GROUP BY T2.tourist_attraction_id
spider
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 AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_SER_ORG_NO = '预防保健科' AND zyb.IN_HOSP_DAYS BETWEEN '2004-07-03' AND '2008-09-09' AND zyb.IN_DIAG_DIS_NM = 'G15.489'
css
CREATE TABLE table_45992 ( "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. -- Which Team 1 has a 2nd leg of 1 2?
SELECT "Team 1" FROM table_45992 WHERE "2nd leg" = '1–2'
wikisql
CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, department_id INTEGER, date_assigned_from DATETIME, job_title_code VARCHAR(10), date_assigned_to DATETIME ) CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Product_Suppliers ( product...
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code
nvbench
CREATE TABLE table_23537091_1 ( early_chalcolithic VARCHAR, ubaid_period_in_mesopotamia VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the second intermediate period of egypt is the ubaid period in mesopotamia how many early calcolithics are there?
SELECT COUNT(early_chalcolithic) FROM table_23537091_1 WHERE ubaid_period_in_mesopotamia = "Second Intermediate Period of Egypt"
sql_create_context
CREATE TABLE table_56867 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is th...
SELECT "Date" FROM table_56867 WHERE "Race" = 'mexican grand prix'
wikisql
CREATE TABLE table_name_73 ( format VARCHAR, brand VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the format for Digital 94.9?
SELECT format FROM table_name_73 WHERE brand = "digital 94.9"
sql_create_context
CREATE TABLE table_73937 ( "Round" real, "Race" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In how many rounds was Race...
SELECT COUNT("Round") FROM table_73937 WHERE "Race" = '17'
wikisql
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TA...
SELECT origin, COUNT(*) FROM train GROUP BY origin ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_13525 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "# / County" text, "Year Joined" real, "Previous Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year joined...
SELECT "Year Joined" FROM table_13525 WHERE "Enrollment" < '438' AND "IHSAA Class" = 'aa'
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 jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '09797743' AND jybgb.BGRQ BETWEEN '2013-05-06' AND '2020-...
css
CREATE TABLE table_39277 ( "Year" real, "Class" text, "Team" text, "Points" real, "Rank" text, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has a class of 500cc and rank of 16th?
SELECT "Team" FROM table_39277 WHERE "Class" = '500cc' AND "Rank" = '16th'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT REF_SLT_FLG FROM t_kc24 WHERE MED_CLINIC_ID = '01329710561'
css
CREATE TABLE Ref_Service_Types ( Service_Type_Code CHAR(15), Parent_Service_Type_Code CHAR(15), Service_Type_Description VARCHAR(255) ) CREATE TABLE Marketing_Regions ( Marketing_Region_Code CHAR(15), Marketing_Region_Name VARCHAR(255), Marketing_Region_Descriptrion VARCHAR(255), Other_Deta...
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code
nvbench
CREATE TABLE table_name_67 ( rank INTEGER, year VARCHAR, accolade VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest rank for an album after 1999 and an Accolade of the 100 greatest indie rock albums of all time?
SELECT MIN(rank) FROM table_name_67 WHERE year > 1999 AND accolade = "the 100 greatest indie rock albums of all time"
sql_create_context
CREATE TABLE table_name_69 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Home team score for the Away team of North Melbourne?
SELECT home_team AS score FROM table_name_69 WHERE away_team = "north melbourne"
sql_create_context
CREATE TABLE table_56148 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the name of the home team, when the score for home team w...
SELECT "Home team" FROM table_56148 WHERE "Home team score" = '10.17 (77)'
wikisql