instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_18205 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Status" text, "Opponent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What parties are represented in Massachusetts4 district?
SELECT "Party" FROM table_18205 WHERE "District" = 'Massachusetts4'
wikisql
CREATE TABLE table_10542 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many draws for avia band with over 22 points?
SELECT COUNT("Draw") FROM table_10542 WHERE "Points" > '22' AND "Artist" = 'avia band'
wikisql
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.IN_DIAG_DIS_NM = '精神发育迟滞' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.IN_DIAG_D...
css
CREATE TABLE table_name_1 ( score VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for game 38?
SELECT score FROM table_name_1 WHERE game = 38
sql_create_context
CREATE TABLE table_20540006_6 ( attendance INTEGER, challenge_leader VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance for the game when the challenge leader was at Big East (4-2)?
SELECT MAX(attendance) FROM table_20540006_6 WHERE challenge_leader = "Big East (4-2)"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text...
SELECT COUNT(a.ParentId) AS AnswerCount, SUM(q.ViewCount) FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id WHERE a.PostTypeId = 2 AND a.CreationDate >= '##StartDate##' AND a.CreationDate <= '##EndDate##' AND a.DeletionDate IS NULL AND a.OwnerUserId = '##UserId##'
sede
CREATE TABLE table_62583 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a To par smaller than 7, and a Total of 148?
SELECT "Country" FROM table_62583 WHERE "To par" < '7' AND "Total" = '148'
wikisql
CREATE TABLE table_27925 ( "meas. num" real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of proposal is measure ...
SELECT "type" FROM table_27925 WHERE "meas. num" = '3'
wikisql
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 allergy ( allergy...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '027-142451' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '027-142451' AND patient.hospitaldischargetime IS NULL)) AND ...
eicu
CREATE TABLE table_60639 ( "Player" text, "Career" text, "Goals (Caps)" text, "Pct." real, "Playing status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the career of player serhiy konovalov, who has less than 1 pct.?
SELECT "Career" FROM table_60639 WHERE "Pct." < '1' AND "Player" = 'serhiy konovalov'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "83" AND lab.label = "Calculated Total CO2"
mimicsql_data
CREATE TABLE table_46209 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points against has a Lost...
SELECT "Points against" FROM table_46209 WHERE "Lost" = '13' AND "Points for" = '671'
wikisql
CREATE TABLE table_17742 ( "No." real, "P" text, "Name" text, "Country" text, "Age" real, "Loan Club" text, "Started" text, "Ended" text, "Start Source" text, "End Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date ...
SELECT "Started" FROM table_17742 WHERE "Name" = 'de Vries'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score num...
SELECT OwnerUserId AS "user_link", SUM(Posts.Score) AS Score, Users.Reputation, COUNT(Posts.Id) AS Posts, CAST(Users.Reputation AS FLOAT) / COUNT(Posts.Id) AS Ratio FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE Users.Reputation >= 1000 GROUP BY OwnerUserId, Users.Reputation HAVING COUNT(Posts.Id) > 50 ORD...
sede
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal...
SELECT JOB_ID, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
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 WHERE demographic.diagnosis = "GASTROINTESTINAL BLEED" AND demographic.admityear < "2115"
mimicsql_data
CREATE TABLE table_name_41 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record on January 18?
SELECT record FROM table_name_41 WHERE date = "january 18"
sql_create_context
CREATE TABLE table_35958 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average conceded nu...
SELECT AVG("Conceded") FROM table_35958 WHERE "Position" > '8' AND "Wins" > '2'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepi...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 't3' AND DATETIME(lab.labresulttime) >= DATETIME(CURRENT_TIME(), '-5 year'))
eicu
CREATE TABLE table_203_812 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many combined gold medals did japan and france win ?
SELECT SUM("gold") FROM table_203_812 WHERE "nation" IN ('japan', 'france')
squall
CREATE TABLE table_55035 ( "Outcome" text, "Date" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which outcome has a Opponent of fernando verdasco?
SELECT "Outcome" FROM table_55035 WHERE "Opponent" = 'fernando verdasco'
wikisql
CREATE TABLE table_204_522 ( id number, "boat #" text, "name" text, "builder" text, "laid down" text, "launched" text, "completed" text, "fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what other boat was completed on the same day ...
SELECT "name" FROM table_204_522 WHERE "name" <> 'ha-201' AND "completed" = (SELECT "completed" FROM table_204_522 WHERE "name" = 'ha-201')
squall
CREATE TABLE products ( product_id number, product_details text ) CREATE TABLE addresses ( address_id number, address_content text, city text, zip_postcode text, state_province_county text, country text, other_address_details text ) CREATE TABLE customer_orders ( order_id numbe...
SELECT COUNT(DISTINCT customer_id) FROM customer_orders WHERE order_status = "Cancelled"
spider
CREATE TABLE journalist ( Name VARCHAR, Years_working VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the names of journalists in ascending order of years working.
SELECT Name FROM journalist ORDER BY Years_working
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-40894')) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CU...
eicu
CREATE TABLE table_51620 ( "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. -- Who played Melbourne as the home team?
SELECT "Home team" FROM table_51620 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
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 COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '8485615' AND wdmzjzjlb.RYDJSJ BETWEEN '2007-08-28' AND '2012-03-21' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 28 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '8485615' AND bdmzjzjlb.RYDJSJ BETWEEN '2007-08-28' AND '2012-03-21' AND DATEDIFF(b...
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, insuranc...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40833) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1)
mimic_iii
CREATE TABLE table_dev_51 ( "id" int, "gender" string, "antihypertensive_agents" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "obesity" bool, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "hypertension" bool, "prehypertension" bool, ...
SELECT * FROM table_dev_51 WHERE gender = 'male' OR gender = 'female' AND age > 18
criteria2sql
CREATE TABLE Projects ( project_id INTEGER, organisation_id INTEGER, project_details VARCHAR(255) ) CREATE TABLE Documents ( document_id INTEGER, document_type_code VARCHAR(10), grant_id INTEGER, sent_date DATETIME, response_received_date DATETIME, other_details VARCHAR(255) ) CREA...
SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T1.organisation_id
nvbench
CREATE TABLE table_65626 ( "Club" text, "Total points" text, "Bonus points" text, "Match points" text, "Games" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Diff" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT "Points for" FROM table_65626 WHERE "Games" = '30' AND "Total points" = '73'
wikisql
CREATE TABLE table_31558 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the first year he placed 12th
SELECT MIN("Year") FROM table_31558 WHERE "Result" = '12th'
wikisql
CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) -- Using valid SQLite, answer the following questions for the ...
SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name
nvbench
CREATE TABLE table_name_3 ( nationality VARCHAR, heat VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality with less than 9 heat, and a time of 1:01.87?
SELECT nationality FROM table_name_3 WHERE heat < 9 AND time = "1:01.87"
sql_create_context
CREATE TABLE table_75442 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game has a Record of 14 10 4, and Points smaller than 32?
SELECT SUM("Game") FROM table_75442 WHERE "Record" = '14–10–4' AND "Points" < '32'
wikisql
CREATE TABLE table_name_30 ( venue VARCHAR, semi_final_heat_host VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue when David Jacobs was the host?
SELECT venue FROM table_name_30 WHERE semi_final_heat_host = "david jacobs"
sql_create_context
CREATE TABLE table_37472 ( "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. -- How many positions have figueirense as the team...
SELECT COUNT("Position") FROM table_37472 WHERE "Team" = 'figueirense' AND "Played" > '38'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
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 = "Dysthymic disorder" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_203_528 ( id number, "year" number, "political rights" number, "civil liberties" number, "status" text, "president" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the next president listed after hamani diori in the year...
SELECT "president" FROM table_203_528 WHERE id = (SELECT id FROM table_203_528 WHERE "year" = 1974) + 1
squall
CREATE TABLE station_company ( station_id number, company_id number, rank_of_the_year number ) CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion number, profits_billion number, assets_billion number, ...
SELECT COUNT(*) FROM company
spider
CREATE TABLE table_name_8 ( team VARCHAR, year VARCHAR, overall_pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 1981 which team picked overall 148?
SELECT team FROM table_name_8 WHERE year = 1981 AND overall_pick = "148"
sql_create_context
CREATE TABLE table_name_71 ( location VARCHAR, objectnumber VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Location has an ObjectNumber of 2005-7698?
SELECT location FROM table_name_71 WHERE objectnumber = "2005-7698"
sql_create_context
CREATE TABLE table_name_98 ( siburan_padawan VARCHAR, tagalog VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Siburan-Padawan word for the Tagalog word kanin?
SELECT siburan_padawan FROM table_name_98 WHERE tagalog = "kanin"
sql_create_context
CREATE TABLE table_name_59 ( mass__kg_ INTEGER, landing_zone VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest mass for Tycho Crater?
SELECT MAX(mass__kg_) FROM table_name_59 WHERE landing_zone = "tycho crater"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number,...
SELECT a.Id AS "post_link", a.Score, 'site://questions/' + CAST(b.Id AS TEXT) AS "other_answer_link", b.Score FROM Posts AS a INNER JOIN Posts AS b ON a.ParentId = b.ParentId AND a.Id != b.Id WHERE a.OwnerUserId = @UserId AND a.PostTypeId = 2 AND a.Score > 0 AND b.ParentId != @UserId AND b.PostTypeId = 2 AND EXISTS(SEL...
sede
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName
nvbench
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), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) ...
SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY SUM(Market_Value) DESC
nvbench
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 COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '5091716' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-01-05' AND '2011-12-30' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 7482.56) AS T
css
CREATE TABLE table_name_77 ( result VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the directorial debut of the year award?
SELECT result FROM table_name_77 WHERE category = "directorial debut of the year"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "4610"
mimicsql_data
CREATE TABLE table_52109 ( "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 away team score when the home team score was 11.18 (8...
SELECT "Away team score" FROM table_52109 WHERE "Home team score" = '11.18 (84)'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "James Sloan"
mimicsql_data
CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, OMIM int, Porphyria text ) CREATE TABLE medicine ( id int, name text, Trade_Name text, FDA_approved text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id in...
SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id
nvbench
CREATE TABLE table_49357 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Prize amount of Winner Dominik Nitsche?
SELECT "Prize" FROM table_49357 WHERE "Winner" = 'dominik nitsche'
wikisql
CREATE TABLE table_57176 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is shabazz muhammad from?
SELECT "Hometown" FROM table_57176 WHERE "Player" = 'shabazz muhammad'
wikisql
CREATE TABLE table_76397 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average top-5 when the cuts made is more than 34?
SELECT AVG("Top-5") FROM table_76397 WHERE "Cuts made" > '34'
wikisql
CREATE TABLE table_80235 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the entrant earlier than 1956 with a Vanwall Special chassis?
SELECT "Entrant" FROM table_80235 WHERE "Year" < '1956' AND "Chassis" = 'vanwall special'
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 t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '任书萱' AND t_kc21.MED_SER_ORG_NO = '4688366' AND t_kc21.OUT_DIAG_DOC_NM LIKE '王%'
css
CREATE TABLE table_37325 ( "Date" text, "Opponent" text, "Result" text, "Score" text, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which record has a score of 135 134?
SELECT "Record" FROM table_37325 WHERE "Score" = '135–134'
wikisql
CREATE TABLE item ( title VARCHAR, i_id VARCHAR ) CREATE TABLE review ( i_id VARCHAR, rating INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name and id of the item with the highest average rating.
SELECT T1.title, T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rating) DESC LIMIT 1
sql_create_context
CREATE TABLE table_48753 ( "Rank" real, "Team" text, "Played" real, "Wins" real, "Ties" real, "Losses" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Ties, when Played is greater than 5?
SELECT AVG("Ties") FROM table_48753 WHERE "Played" > '5'
wikisql
CREATE TABLE table_name_91 ( place INTEGER, rank_by_average VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average place for a couple with the rank by average of 9 and total smaller than 83?
SELECT AVG(place) FROM table_name_91 WHERE rank_by_average = 9 AND total < 83
sql_create_context
CREATE TABLE table_204_266 ( id number, "#" number, "event year" number, "season" text, "flag bearer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the last flag bearer for georgia ?
SELECT "flag bearer" FROM table_204_266 ORDER BY "event year" DESC LIMIT 1
squall
CREATE TABLE table_21538 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "Location Attendance" FROM table_21538 WHERE "Team" = 'Orlando'
wikisql
CREATE TABLE table_48204 ( "Member" text, "Party" text, "Electorate" text, "State" text, "Term of office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is State, when Member is 'Gil Duthie'?
SELECT "State" FROM table_48204 WHERE "Member" = 'gil duthie'
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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '5633728' AND qtb.MED_ORG_DEPT_NM = '检验科' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '5633728' AND gyb.MED_ORG_DEPT_NM = '检验科' UNION SELECT zyb.MED_CLINIC_ID FROM ...
css
CREATE TABLE nuclear_power_plants ( id text, name text, latitude text, longitude text, country text, status text, reactortype text, reactormodel text, constructionstartat text, operationalfrom text, operationalto text, capacity text, lastupdatedat text, source tex...
SELECT country FROM nuclear_power_plants WHERE status = "Under Construction" GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
geonucleardata
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 intakeoutput ( in...
SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-24610') AND NOT patient.unitdischargetime IS ...
eicu
CREATE TABLE table_62790 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest number of 2009 electorates ...
SELECT MAX("Number of electorates (2009)") FROM table_62790 WHERE "District" = 'raisen' AND "Constituency number" = '142'
wikisql
CREATE TABLE table_74666 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team score when the away team i...
SELECT "Home team score" FROM table_74666 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE table_15014 ( "Rank" real, "Player" text, "From" text, "Transfer fee ( \u20ac million)" real, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a transfer fee larger than 12 from ajax in 2006 while ranked higher than 17?
SELECT "Player" FROM table_15014 WHERE "Transfer fee ( \u20ac million)" > '12' AND "Rank" > '17' AND "Year" > '2006' AND "From" = 'ajax'
wikisql
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 varchar(2) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_14479 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine scored 17 points?
SELECT "Engine" FROM table_14479 WHERE "Points" = '17'
wikisql
CREATE TABLE table_53949 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text, "Alternate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has the lead in Norway?
SELECT "Lead" FROM table_53949 WHERE "Nation" = 'norway'
wikisql
CREATE TABLE table_15796100_1 ( theme VARCHAR, original_artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many themes have the original artist of Judy Garland?
SELECT COUNT(theme) FROM table_15796100_1 WHERE original_artist = "Judy Garland"
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJ...
css
CREATE TABLE table_50132 ( "Model" text, "Manufacturer" text, "Weight (kg)" real, "Display size (in)" real, "Processor model" text, "Storage type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Weight (kg) has a Manufacturer of fujitsu, an...
SELECT AVG("Weight (kg)") FROM table_50132 WHERE "Manufacturer" = 'fujitsu' AND "Model" = 'lifebook p1610'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( ...
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-207754')) AND intakeoutput.celllabel = 'urin...
eicu
CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) -- U...
SELECT Country, COUNT(*) FROM member GROUP BY Country
nvbench
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9880958' AND t_kc21.IN_DIAG_DIS_NM = '矽肺贰期')
css
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 varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
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 table_204_25 ( id number, "rank" number, "mountain peak" text, "mountain range" text, "elevation" text, "prominence" text, "isolation" text, "location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which mountain peak is th...
SELECT "mountain peak" FROM table_204_25 WHERE "mountain range" = 'cascade range'
squall
CREATE TABLE table_6857 ( "Date" text, "Rocket" text, "Type" text, "Launch site" text, "Satellite" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which type is a satellite of GPS IIIA-2?
SELECT "Type" FROM table_6857 WHERE "Satellite" = 'gps iiia-2'
wikisql
CREATE TABLE table_name_90 ( regional_county_municipality VARCHAR, type VARCHAR, code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the regional county municipality when the type is m and the code is less than 91015?
SELECT regional_county_municipality FROM table_name_90 WHERE type = "m" AND code < 91015
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C...
atis
CREATE TABLE table_name_17 ( nationality VARCHAR, round VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Nationality, when Round is less than 2, and when Pick is '24'?
SELECT nationality FROM table_name_17 WHERE round < 2 AND pick = 24
sql_create_context
CREATE TABLE table_21471897_2 ( ranking VARCHAR, rr2_pts VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the ranking for rr2 pts being 8
SELECT ranking FROM table_21471897_2 WHERE rr2_pts = 8
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests i...
SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'CMBIOL' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_name_67 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Home team of essendon is playing what is the Away team score?
SELECT away_team AS score FROM table_name_67 WHERE home_team = "essendon"
sql_create_context
CREATE TABLE table_name_55 ( original_air_date VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the original air date of the episode with production code 2395120?
SELECT original_air_date FROM table_name_55 WHERE production_code = "2395120"
sql_create_context
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) -- Using valid SQLite, answer the following questions fo...
SELECT Fate, COUNT(Fate) FROM mission GROUP BY Fate ORDER BY Fate
nvbench
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE admissions ( row_id numb...
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18517)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [syst...
mimic_iii
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName
nvbench
CREATE TABLE table_train_205 ( "id" int, "anemia" bool, "gender" string, "renal_disease" bool, "hematocrit_hct" float, "creatinine_gfr" int, "fasting_plasma_triglyceride" int, "thiazolidinediones" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following qu...
SELECT * FROM table_train_205 WHERE renal_disease = 1 OR creatinine_gfr <= 30
criteria2sql
CREATE TABLE table_50161 ( "Date" text, "Opponent" text, "Score" text, "Leading Scorer" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Leading Scorer in the Game with a Score of 96-87?
SELECT "Leading Scorer" FROM table_50161 WHERE "Score" = '96-87'
wikisql
CREATE TABLE table_name_87 ( team_2 VARCHAR, captain_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team 2 has a Captain 1 of final?
SELECT team_2 FROM table_name_87 WHERE captain_1 = "final"
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Rev...
SELECT Posts.Id AS "post_link", COUNT(DISTINCT PostLinks.Id) AS number_of_closures FROM Posts INNER JOIN PostLinks ON PostLinks.RelatedPostId = Posts.Id WHERE LinkTypeId = 3 GROUP BY Posts.Id ORDER BY COUNT(DISTINCT PostLinks.Id) DESC
sede
CREATE TABLE table_12545 ( "Tournament" text, "1973" text, "1974" text, "1975" text, "1976" text, "1977" text, "1978" text, "1979" text, "1983" text, "1984" text, "1985" text, "1986" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "1973" FROM table_12545 WHERE "1978" = '75%'
wikisql