instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_52 ( diameter__km_ INTEGER, longitude VARCHAR, year_named VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Diameter (km) of the Valle with a Longitude of 152.5e named before 1997?
SELECT MAX(diameter__km_) FROM table_name_52 WHERE longitude = "152.5e" AND year_named < 1997
sql_create_context
CREATE TABLE table_name_7 ( pick INTEGER, round VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Pick when the round was less than 6 for kenneth green?
SELECT AVG(pick) FROM table_name_7 WHERE round < 6 AND player = "kenneth green"
sql_create_context
CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real ) CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text ) -- Using valid SQLite, answer the ...
SELECT Party, COUNT(Party) FROM representative GROUP BY Party ORDER BY Party DESC
nvbench
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number...
WITH firstpostids_cte AS (SELECT MIN(Id) AS MinId, OwnerUserId FROM Posts WHERE PostTypeId = 1 GROUP BY OwnerUserId), firstpostsclosed_cte AS (SELECT p.Id, p.CreationDate AS cre, p.ClosedDate AS clo FROM firstpostids_cte AS fp JOIN Posts AS p ON fp.MinId = p.Id) SELECT LAST_DATE_OF_MONTH(cre), COUNT(clo), COUNT(*), ROU...
sede
CREATE TABLE table_27069 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name who wrote the episode...
SELECT "Written by" FROM table_27069 WHERE "Directed by" = 'Patrick Duffy' AND "Original air date" = 'November 7, 1997'
wikisql
CREATE TABLE table_2150068_1 ( nssdc_id VARCHAR, satellite VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nssdc id for Echo 1?
SELECT nssdc_id FROM table_2150068_1 WHERE satellite = "Echo 1"
sql_create_context
CREATE TABLE table_30703 ( "Constellation" text, "IAU abbreviation" text, "Other abbreviation" text, "Genitive" text, "Family" text, "Origin" text, "Meaning" text, "Brightest star" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is t...
SELECT "Meaning" FROM table_30703 WHERE "Genitive" = 'Puppis /ˈpʌpɨs/'
wikisql
CREATE TABLE table_name_93 ( week INTEGER, attendance VARCHAR, result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Week when the result was l 13 10, November 30, 1975, with more than 44,982 people in attendance?
SELECT MIN(week) FROM table_name_93 WHERE result = "l 13–10" AND date = "november 30, 1975" AND attendance > 44 OFFSET 982
sql_create_context
CREATE TABLE table_204_664 ( id number, "rank" number, "bib" number, "name" text, "nationality" text, "start" text, "penalties (p+p+s+s)" text, "time" text, "deficit" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number ...
SELECT COUNT(*) FROM table_204_664 WHERE "nationality" = 'russia'
squall
CREATE TABLE table_16864968_8 ( points VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points were made in game 70?
SELECT COUNT(points) FROM table_16864968_8 WHERE game = 70
sql_create_context
CREATE TABLE table_20583 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tournament wins were at Volvo Master...
SELECT COUNT("No.") FROM table_20583 WHERE "Tournament" = 'Volvo Masters Andalucia'
wikisql
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE date_day ( ...
SELECT DISTINCT flight_id FROM flight WHERE (airline_code = 'AS')
atis
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Regional enteritis of unspecified site" AND prescriptions.route = "OU"
mimicsql_data
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SDH" AND demographic.days_stay > "10"
mimicsql_data
CREATE TABLE table_42622 ( "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. -- What is the Points with a Played larger than 14...
SELECT COUNT("Points") FROM table_42622 WHERE "Played" > '14'
wikisql
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 * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '杨凌霜' AND hz_info.YLJGDM = '7646173' AND zyjzjlb.JZKSMC LIKE '%骨肿瘤%'
css
CREATE TABLE table_35248 ( "Distance" text, "Event" text, "Record" text, "Nationality" text, "Year" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which nationality's distance was 200m and had a year more recent than 1994 when t...
SELECT "Nationality" FROM table_35248 WHERE "Distance" = '200m' AND "Year" > '1994' AND "Record" = '33.778s'
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 diagnosis ( diagnosisid number, ...
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 = '021-35988' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala...
eicu
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.ethnicity = "BLACK/HAITIAN" AND demographic.age < "68"
mimicsql_data
CREATE TABLE table_203_815 ( id number, "pick #" number, "nfl team" text, "player" text, "position" text, "college" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the number of guards picked in the ninth round of the 1937 nfl draft ?
SELECT COUNT(*) FROM table_203_815 WHERE "position" = 'guard'
squall
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, pat...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-250695')) AND medication.routeadmin = 'oral rinse' AND STRFTIME...
eicu
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, Po...
SELECT q.Id AS "post_link", q.Score AS "Q Score", a.Score AS "A Score" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.Score < 0 AND a.Score < -3 AND NOT q.AcceptedAnswerId IS NULL AND q.AnswerCount = 1 ORDER BY a.Score
sede
CREATE TABLE table_name_80 ( score INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the top score for tsuneyuki nakajima?
SELECT MAX(score) FROM table_name_80 WHERE player = "tsuneyuki nakajima"
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dis...
SELECT chartevents.charttime 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 = 26469)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE resultsdata15 ( sample_pk number, commod text, commtype text, lab text, pestcode text, testclass text, concen number, lod number, conunit text, confmethod text, confmethod2 text, annotate text, quantitate text, mean text, extract text, determi...
SELECT COUNT(*) FROM sampledata15 WHERE origin = "3"
pesticide
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH ...
SELECT BGDH FROM jybgb WHERE JZLSH = '78649221818' AND NOT KSMC LIKE '%变态反应%'
css
CREATE TABLE table_13430 ( "Non-dictatorship" text, "Pareto efficiency" text, "Majority" text, "Monotone" text, "Consistency & Participation" text, "Condorcet" text, "Condorcet loser" text, "Clone independence" text, "Reversal symmetry" text ) -- Using valid SQLite, answer the foll...
SELECT "Consistency & Participation" FROM table_13430 WHERE "Pareto efficiency" = 'yes' AND "Condorcet" = 'no'
wikisql
CREATE TABLE table_train_21 ( "id" int, "pregnancy_or_lactation" bool, "severe_sepsis" bool, "systolic_blood_pressure_sbp" int, "active_infection" bool, "limited_care" bool, "septic_shock" bool, "coagulopathy" bool, "age" float, "lactate" int, "NOUSE" float ) -- Using valid...
SELECT * FROM table_train_21 WHERE coagulopathy = 1
criteria2sql
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 demographic (...
SELECT procedures.icd9_code, prescriptions.drug_type FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "52012"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT demographic.age, demographic.diagnosis FROM demographic WHERE demographic.name = "Gonzalo Wasson"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodici...
SELECT 1 * (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 = '030-42006'...
eicu
CREATE TABLE table_36007 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the name of the Competition in Rome, Italy?
SELECT "Competition" FROM table_36007 WHERE "Venue" = 'rome, italy'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'enteritis - c. difficile colitis')
eicu
CREATE TABLE table_22667773_8 ( COUnT VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of eu for quinn
SELECT COUnT AS eu FROM table_22667773_8 WHERE name = "Quinn"
sql_create_context
CREATE TABLE table_71268 ( "Year" real, "Venue" text, "Winner" text, "Country" text, "Score" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest year during which the winner was Matthew King, and during which the score was higher th...
SELECT MIN("Year") FROM table_71268 WHERE "Winner" = 'matthew king' AND "Score" > '270'
wikisql
CREATE TABLE table_66885 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who lost the game on May 26?
SELECT "Loss" FROM table_66885 WHERE "Date" = 'may 26'
wikisql
CREATE TABLE table_name_60 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for 2004 when 2005 is A, 2006 is A, tournament is US Open?
SELECT 2004 FROM table_name_60 WHERE 2005 = "a" AND 2006 = "a" AND tournament = "us open"
sql_create_context
CREATE TABLE table_45233 ( "State" text, "Type" text, "Name" text, "Title" text, "Royal house" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what state did Jing have the title of Marquis?
SELECT "State" FROM table_45233 WHERE "Title" = 'marquis' AND "Name" = 'jing'
wikisql
CREATE TABLE table_34972 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Player when College/Junior/Club Team (League) was regina pats...
SELECT "Player" FROM table_34972 WHERE "College/Junior/Club Team (League)" = 'regina pats (whl)'
wikisql
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "7" AND lab.label = "Prostate Specific Antigen"
mimicsql_data
CREATE TABLE table_74374 ( "Rank" real, "Rider" text, "Mon 30 May" text, "Tues 31 May" text, "Wed 1 June" text, "Thurs 2 June" text, "Fri 3 June" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of riders that had a Tues 31 ...
SELECT COUNT("Rider") FROM table_74374 WHERE "Tues 31 May" = '18'' 55.91 124.236mph'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Bod...
SELECT T.TagName, (SELECT CAST(COUNT(*) AS FLOAT) FROM PostTags AS QT JOIN Posts AS Q ON QT.PostId = Q.Id WHERE Q.PostTypeId = 1 AND QT.TagId = T.Id AND Q.ViewCount >= 1000 AND NOT Q.ClosedDate IS NULL AND Q.CreationDate >= @latest_date) / (SELECT CAST(CASE WHEN COUNT(*) = 0 THEN 1 ELSE COUNT(*) END AS FLOAT) FROM Post...
sede
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Alcohol abuse-continuous" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_name_58 ( coach VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the coach for qadsia?
SELECT coach FROM table_name_58 WHERE club = "qadsia"
sql_create_context
CREATE TABLE ref_product_categories ( unit_of_measure VARCHAR, product_category_code VARCHAR ) CREATE TABLE products ( product_category_code VARCHAR, product_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the unit of measurement and produc...
SELECT t2.unit_of_measure, t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "chervil"
sql_create_context
CREATE TABLE table_name_40 ( first_elected INTEGER, results VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest year for first elected with john hostettler as incumbent and a result of lost re-election democratic gain?
SELECT MAX(first_elected) FROM table_name_40 WHERE results = "lost re-election democratic gain" AND incumbent = "john hostettler"
sql_create_context
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 MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'dext 5%-nacl 0.9% 1000 ml lvp')) AND DATETIME(...
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "74" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_name_78 ( visitor VARCHAR, home VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Visitor of the Montreal Canadiens Home game with a Record of 6 4 4?
SELECT visitor FROM table_name_78 WHERE home = "montreal canadiens" AND record = "6–4–4"
sql_create_context
CREATE TABLE table_55804 ( "Year" real, "Record" text, "Finish" text, "Manager" text, "Playoffs" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least year for gene hassell manager and 6th finish
SELECT MIN("Year") FROM table_55804 WHERE "Manager" = 'gene hassell' AND "Finish" = '6th'
wikisql
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, ...
SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'THEORY' AND course....
advising
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "13" AND prescriptions.drug = "Caphosol"
mimicsql_data
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 d_icd_procedures ( ...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'int insert dual-cham ...
mimic_iii
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code
nvbench
CREATE TABLE table_78922 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the finish for the total 288?
SELECT "Finish" FROM table_78922 WHERE "Total" = '288'
wikisql
CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3),...
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY cust_name DESC
nvbench
CREATE TABLE browser ( id int, name text, market_share real ) CREATE TABLE accelerator_compatible_browser ( accelerator_id int, browser_id int, compatible_since_year int ) CREATE TABLE Web_client_accelerator ( id int, name text, Operating_system text, Client text, Connectio...
SELECT name, id FROM Web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id ORDER BY name
nvbench
CREATE TABLE table_68170 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT MIN("Goals for") FROM table_68170 WHERE "Wins" = '18' AND "Goals against" < '38'
wikisql
CREATE TABLE table_4451 ( "Runs (Balls)" text, "Wicket" text, "Partnerships" text, "Opponent" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the runs balls for wicket of 3rd for australia opponent
SELECT "Runs (Balls)" FROM table_4451 WHERE "Wicket" = '3rd' AND "Opponent" = 'australia'
wikisql
CREATE TABLE table_27037 ( "Processor" text, "Brand name" text, "Model (list)" text, "Cores" real, "L2 Cache" text, "Socket" text, "TDP" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every value for TDP if model is x53xx?
SELECT "TDP" FROM table_27037 WHERE "Model (list)" = 'X53xx'
wikisql
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "6961"
mimicsql_data
CREATE TABLE products ( product_id number, parent_product_id number, production_type_code text, unit_price number, product_name text, product_color text, product_size text ) CREATE TABLE accounts ( account_id number, customer_id number, date_account_opened time, account_name...
SELECT product_id, COUNT(DISTINCT order_id) FROM order_items GROUP BY product_id
spider
CREATE TABLE table_name_94 ( date VARCHAR, circuit VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date was held at Laguna Seca Raceway, in class GTX/GTO?
SELECT date FROM table_name_94 WHERE circuit = "laguna seca raceway" AND class = "gtx/gto"
sql_create_context
CREATE TABLE table_name_30 ( set_1 VARCHAR, set_2 VARCHAR, set_4 VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Set 1, when Set 4 is NA, when Score is 3-0, and when Set 2 is 29-27?
SELECT set_1 FROM table_name_30 WHERE set_4 = "na" AND score = "3-0" AND set_2 = "29-27"
sql_create_context
CREATE TABLE table_203_442 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which month held the least amount of competitions ?...
SELECT "date" FROM table_203_442 GROUP BY "date" ORDER BY COUNT(*) LIMIT 1
squall
CREATE TABLE airport_aircraft ( id number, airport_id number, aircraft_id number ) CREATE TABLE pilot ( pilot_id number, name text, age number ) CREATE TABLE aircraft ( aircraft_id number, aircraft text, description text, max_gross_weight text, total_disk_area text, max...
SELECT AVG(international_passengers) FROM airport
spider
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, ...
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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'T...
atis
CREATE TABLE driverstandings ( driverstandingsid number, raceid number, driverid number, points number, position number, positiontext text, wins number ) CREATE TABLE laptimes ( raceid number, driverid number, lap number, position number, time text, milliseconds numb...
SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5
spider
CREATE TABLE table_49688 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Bronze, when Total is 4, and when Silver is less than 2?
SELECT AVG("Bronze") FROM table_49688 WHERE "Total" = '4' AND "Silver" < '2'
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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "2384" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_15187735_4 ( netflix VARCHAR, episode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the netflix code for episode 46?
SELECT netflix FROM table_15187735_4 WHERE episode = 46
sql_create_context
CREATE TABLE table_204_737 ( id number, "year" number, "order" text, "quantity" number, "ger nos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what amount of time to the years span ?
SELECT MAX("year") - MIN("year") FROM table_204_737
squall
CREATE TABLE table_name_1 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest Attendance for Games played on the Date of February 5?
SELECT MIN(attendance) FROM table_name_1 WHERE date = "february 5"
sql_create_context
CREATE TABLE table_5659 ( "Club" text, "Position in 2012\u201313" text, "First season in top division" text, "Number of seasons in top division" real, "Number of seasons in Prva HNL" real, "First season of current spell in top division" text, "Top division titles" text, "Last top divisio...
SELECT MIN("Number of seasons in top division") FROM table_5659 WHERE "Position in 2012\u201313" = '001 1st'
wikisql
CREATE TABLE table_45541 ( "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. -- What was the highest lap count for Walker Racing with a grid larger than 15?
SELECT MAX("Laps") FROM table_45541 WHERE "Team" = 'walker racing' AND "Grid" > '15'
wikisql
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) -- Using valid SQLite, answer the following que...
SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_40430 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Round for the jiu-jitsu vs martial arts...
SELECT "Round" FROM table_40430 WHERE "Event" = 'jiu-jitsu vs martial arts'
wikisql
CREATE TABLE table_204_508 ( id number, "no." number, "race title" text, "track" text, "date" text, "tv" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which sports network has aired the most races in this season ?
SELECT "tv" FROM table_204_508 GROUP BY "tv" ORDER BY COUNT(*) DESC LIMIT 1
squall
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '60467779' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE table_name_17 ( season INTEGER, total_prize_money VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest season number with a total prize of $108,000?
SELECT MAX(season) FROM table_name_17 WHERE total_prize_money = "$108,000"
sql_create_context
CREATE TABLE table_78251 ( "Year" real, "Manufacturer" text, "Model" text, "Length (ft.)" text, "Fuel or Propulsion" text, "Fleet series" text, "Quantity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the fleet series with a quantity o...
SELECT "Fleet series" FROM table_78251 WHERE "Quantity" = '5'
wikisql
CREATE TABLE table_37241 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Attendance of 48,510 had what highest week?
SELECT MAX("Week") FROM table_37241 WHERE "Attendance" = '48,510'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%shanghai%' OR UPPER(Location) LIKE '%shanghai%' ORDER BY Reputation DESC LIMIT 100
sede
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagn...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'crnry athrscl natve vssl') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM adm...
mimic_iii
CREATE TABLE table_name_51 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for home team of collingwood
SELECT date FROM table_name_51 WHERE home_team = "collingwood"
sql_create_context
CREATE TABLE table_name_23 ( french_abbr VARCHAR, group_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the group name European Progressive Democrats what is the French abbr?
SELECT french_abbr FROM table_name_23 WHERE group_name = "european progressive democrats"
sql_create_context
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_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5675709' GROUP BY t_kc21.IN_DIAG_DIS_CD
css
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 * FROM t_kc21 WHERE MED_SER_ORG_NO = '4723266' AND IN_HOSP_DATE BETWEEN '2005-06-17' AND '2018-05-08') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '4723266' AND IN_HOSP_DATE BETWEEN '2005-06-17' AND '2018-05-08' AND MED_ORG_DEPT_NM = '小儿神经外科')
css
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT COUNT(t_kc21.MED_SER_ORG_NO) FROM t_kc21 WHERE t_kc21.PERSON_ID = '76533732' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-06-24' AND '2016-11-03'
css
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC
nvbench
CREATE TABLE table_name_44 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 2012, when 2009 is 'A'?
SELECT 2012 FROM table_name_44 WHERE 2009 = "a"
sql_create_context
CREATE TABLE table_name_15 ( method VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the method in the fight against Chris Myers?
SELECT method FROM table_name_15 WHERE opponent = "chris myers"
sql_create_context
CREATE TABLE table_17852 ( "Candidate" text, "Background" text, "Original Team" text, "Age" real, "Hometown" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many backgrounds are there represented from Memphis, Tennessee?
SELECT COUNT("Background") FROM table_17852 WHERE "Hometown" = 'Memphis, Tennessee'
wikisql
CREATE TABLE table_name_30 ( total INTEGER, rank VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the lowest total when the rank is less than 2 and bronze is more than 0?
SELECT MIN(total) FROM table_name_30 WHERE rank < 2 AND bronze > 0
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "SNF"
mimicsql_data
CREATE TABLE table_name_50 ( winning_team VARCHAR, losing_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Winning Team, when Losing Team is South Sydney Rabbitohs?
SELECT winning_team FROM table_name_50 WHERE losing_team = "south sydney rabbitohs"
sql_create_context
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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID DESC
nvbench
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) GROUP BY labevents.itemid) AS ...
mimic_iii
CREATE TABLE table_61821 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the gold medal count ranked 2 with a total of more than 21?
SELECT COUNT("Gold") FROM table_61821 WHERE "Rank" = '2' AND "Total" > '21'
wikisql
CREATE TABLE table_1183 ( "Date Released" text, "Institute" text, "Socialist" text, "Social Democratic" text, "Green-Communist" text, "Left Bloc" text, "Peoples Party" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is t...
SELECT "Lead" FROM table_1183 WHERE "Socialist" = '35.5%'
wikisql