instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_33 (
player VARCHAR,
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Player that has the Place of t5, and the Score of 73-72-71-75=291?
| SELECT player FROM table_name_33 WHERE place = "t5" AND score = 73 - 72 - 71 - 75 = 291 | sql_create_context |
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 lab (
subject_id text,
hadm_id text,
... | SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Sodium Chloride 3% Inhalation Soln" | mimicsql_data |
CREATE TABLE table_name_90 (
rank VARCHAR,
height__ft_ VARCHAR,
city VARCHAR,
floors VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the rank for the city of cologne, floors is 34 and height (ft) is more than 452.8?
| SELECT COUNT(rank) FROM table_name_90 WHERE city = "cologne" AND floors = 34 AND height__ft_ > 452.8 | sql_create_context |
CREATE TABLE table_name_84 (
capacity INTEGER,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest capacity for Fandok?
| SELECT MIN(capacity) FROM table_name_84 WHERE team = "fandok" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'respiratory arrest' AND DATETIME(diagnosis.diagnosistime, 'start of year'... | eicu |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure - due to neurologi... | eicu |
CREATE TABLE table_19210115_1 (
affiliation VARCHAR,
nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the affiliation of the University called Explorers?
| SELECT affiliation FROM table_19210115_1 WHERE nickname = "Explorers" | sql_create_context |
CREATE TABLE table_31296 (
"Round" real,
"Country" text,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Rider" text,
"Winning Team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what i... | SELECT "Circuit" FROM table_31296 WHERE "Fastest Lap" = 'Sam Lowes' AND "Winning Rider" = 'Luca Scassa' | wikisql |
CREATE TABLE table_train_249 (
"id" int,
"gender" string,
"allergy_to_dapagliflozin" bool,
"body_weight" float,
"estimated_glomerular_filtration_rate_egfr" int,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the table... | SELECT * FROM table_train_249 WHERE estimated_glomerular_filtration_rate_egfr < 60 | criteria2sql |
CREATE TABLE table_62575 (
"Team 1" text,
"Score" text,
"Team 2" text,
"1st round" text,
"2nd round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for the 1st round when the team 1 was Lb Ch teauroux (d2)?
| SELECT "1st round" FROM table_62575 WHERE "Team 1" = 'lb châteauroux (d2)' | wikisql |
CREATE TABLE table_2538117_5 (
type VARCHAR,
letters VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type is ?
| SELECT type FROM table_2538117_5 WHERE letters = "ΣΑΕΠ" | sql_create_context |
CREATE TABLE table_203_761 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who placed next after paul tr... | SELECT "driver" FROM table_203_761 WHERE "pos" = (SELECT "pos" FROM table_203_761 WHERE "driver" = 'paul tracy') + 1 | squall |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
-- Using valid SQLite, answer the following questions fo... | SELECT Fate, COUNT(Fate) FROM mission GROUP BY Fate ORDER BY COUNT(Fate) DESC | nvbench |
CREATE TABLE table_name_42 (
colour VARCHAR,
built VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the color of the locomotive built by Minirail 1954?
| SELECT colour FROM table_name_42 WHERE built = "minirail 1954" | sql_create_context |
CREATE TABLE table_30047613_12 (
date VARCHAR,
streak VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in which date the strea was w 2
| SELECT date FROM table_30047613_12 WHERE streak = "W 2" | sql_create_context |
CREATE TABLE company (
rank VARCHAR,
company VARCHAR,
market_value VARCHAR,
main_industry VARCHAR,
sales_billion VARCHAR,
profits_billion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- find the rank, company names, market values of the compan... | SELECT rank, company, market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion, profits_billion | sql_create_context |
CREATE TABLE table_10557 (
"Year" real,
"Butterfly" text,
"Artist" text,
"Mintage" real,
"Issue Price" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which artist's work is the butterfly Tiger Swallowtail?
| SELECT "Artist" FROM table_10557 WHERE "Butterfly" = 'tiger swallowtail' | 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 procedures_icd (
row_id number,
subject_id number,
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 636... | mimic_iii |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.... | 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 WHERE demographic.gender = "F" AND demographic.expire_flag = "0" | mimicsql_data |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.religion = "GREEK ORTHODOX" AND diagnoses.long_title = "Drug-induced delirium" | mimicsql_data |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airline (
airline_code... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER'... | atis |
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_name VARCHAR(20),
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplier_company_id INTEGER,
asset_details VAR... | SELECT staff_name, COUNT(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id GROUP BY T1.staff_name ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_86 (
total INTEGER,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Australia's highest total?
| SELECT MAX(total) FROM table_name_86 WHERE country = "australia" | sql_create_context |
CREATE TABLE table_name_89 (
segment_d VARCHAR,
series_ep VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Segment D of 20-08 series Ep.?
| SELECT segment_d FROM table_name_89 WHERE series_ep = "20-08" | sql_create_context |
CREATE TABLE table_name_6 (
record VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of the team from chicago?
| SELECT record FROM table_name_6 WHERE home = "chicago" | sql_create_context |
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 = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND demographic.days_stay > "27" | mimicsql_data |
CREATE TABLE table_203_330 (
id number,
"year of election" number,
"candidates elected" number,
"# of seats available" number,
"# of votes" number,
"% of popular vote" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many candidates were elect... | SELECT "candidates elected" FROM table_203_330 WHERE "year of election" = 1971 | squall |
CREATE TABLE table_49717 (
"Year" real,
"U.S." text,
"U.S. R&B" text,
"U.S. Rap" text,
"Album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the U.S. rap ranking in 2000 of the U.S. 105 single?
| SELECT "U.S. Rap" FROM table_49717 WHERE "Year" = '2000' AND "U.S." = '105' | wikisql |
CREATE TABLE table_53160 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest PL GP for a round greater than 9?
| SELECT MAX("Pl GP") FROM table_53160 WHERE "Rd #" > '9' | wikisql |
CREATE TABLE Companies (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many companies are there?
| SELECT COUNT(*) FROM Companies | sql_create_context |
CREATE TABLE table_29029 (
"Season" real,
"Series" text,
"Team Name" text,
"Races" real,
"Poles" real,
"Wins" real,
"Podiums" real,
"F/Laps" real,
"Points" text,
"Final Placing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When... | SELECT "Points" FROM table_29029 WHERE "Final Placing" = '13th' AND "Races" = '30' | wikisql |
CREATE TABLE table_name_50 (
season VARCHAR,
acquisition_via VARCHAR,
number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Season with an Acquisition via of rookie draft, and the number is 15?
| SELECT season FROM table_name_50 WHERE acquisition_via = "rookie draft" AND number = "15" | sql_create_context |
CREATE TABLE table_50249 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest amount of money player jim colbert has?
| SELECT MIN("Money ( $ )") FROM table_50249 WHERE "Player" = 'jim colbert' | wikisql |
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 Votes (
Id number,
PostId number,
VoteTypeId nu... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Bengalore%' OR UPPER(Location) LIKE '%BENGALORE' ORDER BY Reputation DESC LIMIT 100 | sede |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare 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.... | atis |
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 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 = 12775)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [syst... | mimic_iii |
CREATE TABLE table_203_257 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many people attended the new york giants game on october 25 , 1981 ?
| SELECT "attendance" FROM table_203_257 WHERE "opponent" = 'new york giants' AND "date" = 'october 25, 1981' | squall |
CREATE TABLE table_14465 (
"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 number of points for the maserati straight-4 engine, later than 1959?
| SELECT COUNT("Points") FROM table_14465 WHERE "Engine" = 'maserati straight-4' AND "Year" > '1959' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.dob_year < "1821" | mimicsql_data |
CREATE TABLE Block (
BlockFloor INTEGER,
BlockCode INTEGER
)
CREATE TABLE Physician (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
SSN INTEGER
)
CREATE TABLE Medication (
Code INTEGER,
Name VARCHAR(30),
Brand VARCHAR(30),
Description VARCHAR(30)
)
CREATE TABLE P... | SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand ORDER BY Name DESC | nvbench |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE writes (
paperid int,
... | SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'sentiment analysis' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpaperid ... | scholar |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Code | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Spinal canal explor NEC" | mimicsql_data |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId... | SELECT SUM(CASE WHEN VoteTypeId = 1 THEN 15 WHEN VoteTypeId = 2 AND PostTypeId = 1 THEN 5 WHEN VoteTypeId = 2 AND PostTypeId = 2 THEN 10 WHEN VoteTypeId = 3 THEN -2 WHEN VoteTypeId = 9 THEN BountyAmount END) AS UncappedReputation FROM Votes INNER JOIN Posts ON Posts.Id = Votes.PostId WHERE Posts.OwnerUserId = @UserId | sede |
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 month (
... | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BAL... | atis |
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 qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '9861939' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM HAVING AVG(qtb.PERSON_AGE) < 3 UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '9861939' GROUP ... | css |
CREATE TABLE table_204_337 (
id number,
"festival" text,
"year" number,
"award" text,
"nominee" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many more winners were there than nominees ?
| SELECT (SELECT COUNT(*) FROM table_204_337 WHERE "result" = 'won') - (SELECT COUNT(*) FROM table_204_337 WHERE "result" = 'nominated') | squall |
CREATE TABLE status (
station_id number,
bikes_available number,
docks_available number,
time text
)
CREATE TABLE trip (
id number,
duration number,
start_date text,
start_station_name text,
start_station_id number,
end_date text,
end_station_name text,
end_station_id nu... | SELECT T1.id FROM trip AS T1 JOIN weather AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.zip_code HAVING AVG(T2.mean_temperature_f) > 60 | spider |
CREATE TABLE table_203_131 (
id number,
"pos." number,
"car #" number,
"driver" text,
"make" text,
"team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many chevrolets were in the top 10 ?
| SELECT COUNT(*) FROM table_203_131 WHERE "make" = 'chevrolet' | squall |
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 compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE restriction (
... | 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 = 'KANSAS CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'A... | atis |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate... | SELECT DATEFROMPARTS(YEAR('date'), MONTH('date'), 1) AS "month", AVG('count') AS "average_questions_/_day_/_month" FROM (SELECT DATEFROMPARTS(YEAR(CreationDate), MONTH(CreationDate), DAY(CreationDate)) AS "date", COUNT(*) AS "count" FROM Posts WHERE PostTypeId = 1 GROUP BY YEAR(CreationDate), MONTH(CreationDate), DAY(C... | sede |
CREATE TABLE table_name_38 (
week VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total for the week in the game against the Chicago Bears
| SELECT COUNT(week) FROM table_name_38 WHERE opponent = "chicago bears" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id num... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 3125 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_40438 (
"Band" text,
"Value" text,
"Ratio" text,
"Ratio as %" text,
"Average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Ratio has a Ratio as % of 78%?
| SELECT "Ratio" FROM table_40438 WHERE "Ratio as %" = '78%' | wikisql |
CREATE TABLE table_58880 (
"Year" real,
"Award" text,
"Category" text,
"Show" text,
"Character" text,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Character has a Category of favourite naya sadasya?
| SELECT "Character" FROM table_58880 WHERE "Category" = 'favourite naya sadasya' | wikisql |
CREATE TABLE table_name_9 (
rank INTEGER,
bronze INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank with 0 bronze?
| SELECT AVG(rank) FROM table_name_9 WHERE bronze < 0 | sql_create_context |
CREATE TABLE table_train_225 (
"id" int,
"heart_disease" bool,
"diabetic" string,
"creatinine_clearance_cl" float,
"panel_reactive_antibodies" int,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- symptomatic congestive h... | SELECT * FROM table_train_225 WHERE heart_disease = 1 | criteria2sql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
... | SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14054)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'lipids 20%' ... | mimic_iii |
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 zzmzjzjlb.YLJGDM FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '52382275' UNION SELECT fzzmzjzjlb.YLJGDM FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AND hz_info.KH = fzzmzjzjlb.KH AND hz_i... | css |
CREATE TABLE table_name_89 (
film_title_used_in_nomination VARCHAR,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the film title used in nomination for the film directed by Gheorghe Vitanidis?
| SELECT film_title_used_in_nomination FROM table_name_89 WHERE director = "gheorghe vitanidis" | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABL... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_11964154_7 (
score VARCHAR,
high_assists VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times was the high assists earl watson (5) and the date of the game was december 2?
| SELECT COUNT(score) FROM table_11964154_7 WHERE high_assists = "Earl Watson (5)" AND date = "December 2" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'granular casts') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE table_name_54 (
heat INTEGER,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average heat ranked at 30?
| SELECT AVG(heat) FROM table_name_54 WHERE rank = 30 | sql_create_context |
CREATE TABLE table_79151 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's was the location for fight against Liam Mccarty?
| SELECT "Location" FROM table_79151 WHERE "Opponent" = 'liam mccarty' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subje... | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5849 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) | mimic_iii |
CREATE TABLE table_8945 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the match with an away... | SELECT "Date" FROM table_8945 WHERE "Away team score" = '13.15 (93)' | 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 demographic (
subject_id text,
hadm_id t... | SELECT demographic.discharge_location FROM demographic WHERE demographic.subject_id = "29541" | mimicsql_data |
CREATE TABLE table_name_2 (
grid VARCHAR,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Grid, when Rider is Aleix Espargaro?
| SELECT COUNT(grid) FROM table_name_2 WHERE rider = "aleix espargaro" | sql_create_context |
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 jybgb (
YLJGDM text,
YLJGDM_M... | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '云成双' AND hz_info.YLJGDM = '5772837' AND zyjzjlb.JZKSMC LIKE '%免疫科%' | css |
CREATE TABLE table_204_379 (
id number,
"year" text,
"title" text,
"hangul" text,
"network" text,
"further info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when is the last year as listed ?
| SELECT MAX("year") FROM table_204_379 | squall |
CREATE TABLE table_44620 (
"Event" text,
"Date" text,
"Round" text,
"Name" text,
"Nationality" text,
"Time" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record for the date 15 december, and a round of final?
| SELECT "Record" FROM table_44620 WHERE "Date" = '15 december' AND "Round" = 'final' | wikisql |
CREATE TABLE table_49674 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times is the chassis brabham bt33?
| SELECT COUNT("Year") FROM table_49674 WHERE "Chassis" = 'brabham bt33' | wikisql |
CREATE TABLE table_name_56 (
score VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a Tournament of san jose, us (2)?
| SELECT score FROM table_name_56 WHERE tournament = "san jose, us (2)" | sql_create_context |
CREATE TABLE table_name_57 (
game_site VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did they play in week 14?
| SELECT game_site FROM table_name_57 WHERE week = "14" | sql_create_context |
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 t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0314561' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM | css |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '陶秀竹' AND t_kc22.STA_DATE BETWEEN '2002-04-20' AND '2003-08-28' AND t_kc22.t_kc21_MED_SER_ORG_NO = '4933509' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_72218 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the height of the player who attended Har... | SELECT "Height in Ft." FROM table_72218 WHERE "School/Club Team/Country" = 'Hartford' | wikisql |
CREATE TABLE table_train_77 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"language" string,
"hiv_aids" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- written and oral fluency in english or spanish .... | SELECT * FROM table_train_77 WHERE language = 'english' OR language = 'spanish' | criteria2sql |
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 All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY School_ID | nvbench |
CREATE TABLE table_59732 (
"Name (year commissioned)" text,
"Owner/operator" text,
"Length" text,
"Maximum diameter" text,
"From/to" text,
"Licence number" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name where the license number ... | SELECT "Name (year commissioned)" FROM table_59732 WHERE "Licence number" = 'pl 22' | wikisql |
CREATE TABLE table_52460 (
"Tournament" text,
"1972" text,
"1973" text,
"1974" text,
"1975" text,
"1976" text,
"1977" text,
"1978" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1976 value of the Australian Open?
| SELECT "1976" FROM table_52460 WHERE "Tournament" = 'australian open' | wikisql |
CREATE TABLE table_name_45 (
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2009 year has a total of 1, and 2004 year of 7th?
| SELECT 2009 FROM table_name_45 WHERE total = 1 AND 2004 = "7th" | sql_create_context |
CREATE TABLE table_26916 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What numbered pick attended western ontario and is an OL?
| SELECT "Pick #" FROM table_26916 WHERE "School" = 'Western Ontario' AND "Position" = 'OL' | 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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '74604701' AND t_kc21.MED_SER_ORG_NO = '0359926' AND t_kc21.OUT_DIAG_DIS_NM LIKE '%使用%' | css |
CREATE TABLE table_name_32 (
nationality VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality of the HMS Cheshire?
| SELECT nationality FROM table_name_32 WHERE name = "hms cheshire" | sql_create_context |
CREATE TABLE table_name_72 (
school VARCHAR,
college VARCHAR,
height VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the Player playing for the College of Kentucky and a Height of 6-7 what was their corresponding School?
| SELECT school FROM table_name_72 WHERE college = "kentucky" AND height = "6-7" | sql_create_context |
CREATE TABLE table_47221 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the box score for the game that had the Cairns Taipans... | SELECT "Box Score" FROM table_47221 WHERE "Home team" = 'cairns taipans' | wikisql |
CREATE TABLE table_58864 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Place of the Player with a Score of 73-75-71-73=292?
| SELECT "Place" FROM table_58864 WHERE "Score" = '73-75-71-73=292' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "4" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_29039942_1 (
writer VARCHAR,
episode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the writer for episode 3?
| SELECT writer FROM table_29039942_1 WHERE episode = 3 | sql_create_context |
CREATE TABLE table_27235 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote 'Co... | SELECT "Written by" FROM table_27235 WHERE "Title" = 'Concordia' | wikisql |
CREATE TABLE table_name_32 (
round___race VARCHAR,
winning_driver VARCHAR,
pole_position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the round or race of the winning driver Charles Hollings and what was his pole position?
| SELECT round___race FROM table_name_32 WHERE winning_driver = "charles hollings" AND pole_position = "charles hollings" | sql_create_context |
CREATE TABLE table_12481 (
"Draft" real,
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Pick, when Nationality is 'France', and when Draft is less than 1979?
| SELECT MAX("Pick") FROM table_12481 WHERE "Nationality" = 'france' AND "Draft" < '1979' | wikisql |
CREATE TABLE table_203_67 (
id number,
"place" number,
"team" text,
"played" number,
"won" number,
"draw" number,
"lost" number,
"goals\nscored" number,
"goals\nconceded" number,
"+/-" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the t... | SELECT MAX("goals\nscored") - MIN("goals\nscored") FROM table_203_67 | squall |
CREATE TABLE table_name_41 (
year INTEGER,
seat_factor VARCHAR,
flying_hours VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the earliest year that had more than 105,579 flying hours and a seat factor of 68%?
| SELECT MIN(year) FROM table_name_41 WHERE seat_factor = "68%" AND flying_hours > 105 OFFSET 579 | sql_create_context |
CREATE TABLE table_56260 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who drove grid 5?
| SELECT "Driver" FROM table_56260 WHERE "Grid" = '5' | wikisql |
CREATE TABLE table_36841 (
"Rank" text,
"Film" text,
"Director(s)" text,
"Producer(s)" text,
"Writer(s)" text,
"Production Company" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For which production company did Sam Mccarthy produce?
| SELECT "Production Company" FROM table_36841 WHERE "Producer(s)" = 'sam mccarthy' | wikisql |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Cu... | SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.