instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_46263 (
"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.
-- How much total has a To par of +9?
| SELECT COUNT("Total") FROM table_46263 WHERE "To par" = '+9' | wikisql |
CREATE TABLE table_name_22 (
district_attorney VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the DA for bureau chief ada
| SELECT district_attorney FROM table_name_22 WHERE position = "bureau chief ada" | sql_create_context |
CREATE TABLE table_43064 (
"Round" real,
"Selection" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds had a selection of 165?
| SELECT SUM("Round") FROM table_43064 WHERE "Selection" = '165' | wikisql |
CREATE TABLE table_10403 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the right ascension for sagittarius and NGC number ... | SELECT "Right ascension ( J2000 )" FROM table_10403 WHERE "Constellation" = 'sagittarius' AND "NGC number" > '6522' AND "Object type" = 'open cluster' AND "Declination ( J2000 )" = '°22′' | wikisql |
CREATE TABLE table_25117 (
"Player" text,
"Nat" text,
"Pos" text,
"L Apps" real,
"L G" real,
"C Apps" real,
"C G" real,
"Total Apps" real,
"Total G" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of lg for cg is... | SELECT COUNT("L G") FROM table_25117 WHERE "C G" > '1.0' AND "C Apps" = '3' | wikisql |
CREATE TABLE table_64830 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many golds have denmark as the nation, with a total less than 1?
| SELECT COUNT("Gold") FROM table_64830 WHERE "Nation" = 'denmark' AND "Total" < '1' | wikisql |
CREATE TABLE table_name_89 (
part_number_s_ VARCHAR,
model_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the part number of athlon x2 4850e?
| SELECT part_number_s_ FROM table_name_89 WHERE model_number = "athlon x2 4850e" | sql_create_context |
CREATE TABLE table_name_1 (
id_code_of_his_zero_fighter VARCHAR,
count VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Zero Fighter has a count of 10?
| SELECT id_code_of_his_zero_fighter FROM table_name_1 WHERE count = "10" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLO... | SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID | nvbench |
CREATE TABLE table_20140132_1 (
venue VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue for the team Terek?
| SELECT venue FROM table_20140132_1 WHERE team = "Terek" | sql_create_context |
CREATE TABLE table_49271 (
"Name" text,
"Type" text,
"Themed area" text,
"Manufacturer" text,
"Opened" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which type had an unknown manufacturer?
| SELECT "Type" FROM table_49271 WHERE "Manufacturer" = 'unknown' | wikisql |
CREATE TABLE Accounts (
customer_id VARCHAR
)
CREATE TABLE Customers (
customer_first_name VARCHAR,
customer_last_name VARCHAR,
customer_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the first names and last names of customers without any a... | SELECT customer_first_name, customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name, T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id | sql_create_context |
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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "49" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE Parts (
part_id VARCHAR,
chargeable_amount VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which part has the least chargeable amount? List the part id and amount.
| SELECT part_id, chargeable_amount FROM Parts ORDER BY chargeable_amount LIMIT 1 | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | SELECT COUNT(*) > 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.section_number = 496 AND course.department = 'DANCE' AND course.number = 103 AND semester.semester = 'Fall' AND semester... | advising |
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 microlab (
microlabid number,
... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND microlab.culturesite = 'blood, venipuncture' ORD... | eicu |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id numbe... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 94229 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_68234 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game that had a loss of Williams (1-1)?
| SELECT "Score" FROM table_68234 WHERE "Loss" = 'williams (1-1)' | 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 person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.JZZDSM = '过敏性皮炎' GROUP BY person_info.JGDM | css |
CREATE TABLE table_38639 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the country for johannesburg
| SELECT "Country" FROM table_38639 WHERE "City" = 'johannesburg' | wikisql |
CREATE TABLE table_25075 (
"Year" real,
"Network" text,
"Race caller" text,
"s Host" text,
"s Analyst" text,
"Reporters" text,
"Trophy presentation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the trophy presentation in the year 19... | SELECT "Trophy presentation" FROM table_25075 WHERE "Year" = '1987' | wikisql |
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(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'biotene dry mouth mt liqd') | eicu |
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 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, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | mimic_iii |
CREATE TABLE table_21472 (
"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.
-- Who ha... | SELECT "High assists" FROM table_21472 WHERE "High rebounds" = 'Erick Dampier (8)' | wikisql |
CREATE TABLE table_32636 (
"FAT16" text,
"FAT32" text,
"HPFS" text,
"ISO 9660" text,
"NTFS" text,
"ReFS" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which NTFS has a no for ReFS and a yes for HPFS?
| SELECT "NTFS" FROM table_32636 WHERE "ReFS" = 'no' AND "HPFS" = 'yes' | wikisql |
CREATE TABLE table_25401_2 (
form__to_sing_ VARCHAR,
brazilian_portuguese VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the form ('to sing') when brazilian portuguese is [k t mus]?
| SELECT form__to_sing_ FROM table_25401_2 WHERE brazilian_portuguese = "[kɐ̃ˈtẽmus]" | sql_create_context |
CREATE TABLE table_1342393_16 (
party VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the party or first elected is 1920
| SELECT party FROM table_1342393_16 WHERE first_elected = 1920 | sql_create_context |
CREATE TABLE table_name_65 (
drawn INTEGER,
nationality VARCHAR,
games VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest draw with 37 games from England?
| SELECT MAX(drawn) FROM table_name_65 WHERE nationality = "england" AND games = 37 | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,... | SELECT CAST(STR(DATEPART(hour, p.CreationDate)) AS INT) AS Hour, COUNT(DATEPART(hour, p.CreationDate)) AS "# of questions" FROM Posts AS p WHERE p.PostTypeId = 1 AND DATEDIFF(DAY, p.CreationDate, GETDATE()) < '##Days:int?7##' GROUP BY DATEPART(hour, p.CreationDate) | sede |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'sepsis' AND STRFTIME('%y', diagnosis.diagnosistime) = '2104' GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1 | eicu |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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(25... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
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 Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder | nvbench |
CREATE TABLE table_62412 (
"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 average amount of money of players in t8 place with a 68-71-69-72=280 s... | SELECT AVG("Money ( $ )") FROM table_62412 WHERE "Place" = 't8' AND "Score" = '68-71-69-72=280' | wikisql |
CREATE TABLE table_21101 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At the longitude of 355.0e, what is the name origin?
| SELECT "Name origin" FROM table_21101 WHERE "Longitude" = '355.0E' | wikisql |
CREATE TABLE table_3733 (
"Country" text,
"Total Drivers" real,
"Champions" text,
"Championships" text,
"Current 3 November 2013" real,
"First driver(s)" text,
"Last/Current driver(s) 3 November 2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Country" FROM table_3733 WHERE "Last/Current driver(s) 3 November 2013" = 'Daniel Abt ( 2012 )' | wikisql |
CREATE TABLE Patient (
SSN INTEGER,
Name VARCHAR(30),
Address VARCHAR(30),
Phone VARCHAR(30),
InsuranceID INTEGER,
PCP INTEGER
)
CREATE TABLE Department (
DepartmentID INTEGER,
Name VARCHAR(30),
Head INTEGER
)
CREATE TABLE Stay (
StayID INTEGER,
Patient INTEGER,
Room IN... | SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name ORDER BY COUNT(T1.Name) | nvbench |
CREATE TABLE table_204_170 (
id number,
"player" text,
"position" text,
"games\nstarted" text,
"hometown" text,
"height" text,
"weight" number,
"age" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many players were from ann arbor ?... | SELECT COUNT("player") FROM table_204_170 WHERE "hometown" = 'ann arbor' | squall |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT p.Id AS "post_link", p.CreationDate, p.OwnerUserId AS "user_link" FROM Posts AS p WHERE p.Body LIKE '% i %' COLLATE Latin1_General_BIN OR p.Title LIKE 'a-z%' COLLATE Latin1_General_BIN OR p.Body LIKE '%`%' ORDER BY p.CreationDate DESC | sede |
CREATE TABLE table_78102 (
"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's the highest Pl GP with a Reg GP over 18?
| SELECT MAX("Pl GP") FROM table_78102 WHERE "Reg GP" > '18' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate tim... | SELECT Id AS "user_link", * FROM (SELECT * FROM Users WHERE Age != '' AND Age >= 13 AND Reputation > 5000 ORDER BY Age LIMIT 100) AS users | sede |
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 diagnoses (
... | 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.short_title = "Hemorrhage complic proc" AND prescriptions.drug_type = "MAIN" | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2174" | mimicsql_data |
CREATE TABLE table_name_81 (
record VARCHAR,
round INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was his record when he went over 1 round?
| SELECT record FROM table_name_81 WHERE round > 1 | sql_create_context |
CREATE TABLE table_train_183 (
"id" int,
"anemia" bool,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"creatinine_clearance_cl" float,
"panel_reactive_antibodies" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- hba1c 12 %
| SELECT * FROM table_train_183 WHERE hemoglobin_a1c_hba1c < 12 | criteria2sql |
CREATE TABLE table_51949 (
"Rank ( WJC )" real,
"Rank (ARDA)" real,
"Metro area" text,
"Number of Jews (WJC)" real,
"Number of Jews (ASARB)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many number of WJC Jews in the Los Angeles Metro Area has... | SELECT SUM("Number of Jews (WJC)") FROM table_51949 WHERE "Metro area" = 'los angeles' AND "Rank (ARDA)" > '2' | wikisql |
CREATE TABLE table_21781578_2 (
original_air_date VARCHAR,
season_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the original air date for season number 2?
| SELECT original_air_date FROM table_21781578_2 WHERE season_no = 2 | sql_create_context |
CREATE TABLE table_14325653_2 (
publisher_s_ VARCHAR,
video_game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the publisher for resident evil 4
| SELECT publisher_s_ FROM table_14325653_2 WHERE video_game = "Resident Evil 4" | sql_create_context |
CREATE TABLE table_16240 (
"Province" text,
"Population (2004 estimate)" real,
"Area (km\u00b2)" real,
"Density" text,
"GDP (2003, PPS in mil. \u20ac )" real,
"GDP per cap. (2003, in \u20ac)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which ... | SELECT "Province" FROM table_16240 WHERE "GDP (2003, PPS in mil. \u20ac )" = '38355' | wikisql |
CREATE TABLE table_13460 (
"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 Nation has more than 4 silver, more than 3 gold and 18 total medals?
| SELECT "Nation" FROM table_13460 WHERE "Silver" > '4' AND "Gold" > '3' AND "Total" = '18' | wikisql |
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Student (
StuID INTEGE... | SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY Sex DESC | nvbench |
CREATE TABLE table_68330 (
"Sydney" text,
"Melbourne" text,
"Perth" text,
"Adelaide" text,
"Gold Coast" text,
"Auckland" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Adelaide's Melbourne and Perth were yes when Auckland was no?
| SELECT "Adelaide" FROM table_68330 WHERE "Melbourne" = 'yes' AND "Auckland" = 'no' AND "Perth" = 'yes' | wikisql |
CREATE TABLE circuits (
circuitid number,
circuitref text,
name text,
location text,
country text,
lat number,
lng number,
alt number,
url text
)
CREATE TABLE pitstops (
raceid number,
driverid number,
stop number,
lap number,
time text,
duration text,
mi... | SELECT DISTINCT name FROM races ORDER BY name DESC | spider |
CREATE TABLE table_374 (
"Rank" real,
"English title" text,
"Chinese title" text,
"Average" real,
"Peak" real,
"Premiere" real,
"Finale" real,
"HK viewers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the Chinese name for Foren... | SELECT "Chinese title" FROM table_374 WHERE "English title" = 'Forensic Heroes II' | wikisql |
CREATE TABLE table_54781 (
"Rank" real,
"Club" text,
"Gold" real,
"Big Silver" real,
"Small Silver" real,
"Bronze" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Club aik had over 9 small silver medals and more than 8 bronze m... | SELECT AVG("Points") FROM table_54781 WHERE "Small Silver" > '9' AND "Club" = 'aik' AND "Bronze" > '8' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
Rejection... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(DisplayName) = 'jon skeet' ORDER BY Reputation DESC LIMIT 20 | sede |
CREATE TABLE table_72025 (
"Name" text,
"Reign" real,
"Days held" text,
"Location" text,
"Defenses" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the days held the champion with a reign larger than 3 and less than 1 defense has?
| SELECT "Days held" FROM table_72025 WHERE "Reign" > '3' AND "Defenses" < '1' | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd 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.long_title = "Malignant carcinoid tumor of the rectum" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_203_228 (
id number,
"#" number,
"title" text,
"songwriters" text,
"producer(s)" text,
"performer (s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which songwriter is credited with the largest number of songs ?
| SELECT "songwriters" FROM table_203_228 GROUP BY "songwriters" ORDER BY COUNT("title") DESC LIMIT 1 | squall |
CREATE TABLE table_204_853 (
id number,
"pos" number,
"grid" number,
"no." number,
"driver" text,
"team" text,
"manufacturer" text,
"laps" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many drivers got less th... | SELECT COUNT("driver") FROM table_204_853 WHERE "points" < 80 | squall |
CREATE TABLE table_55067 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text,
"Apparent magnitude" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the declination w... | SELECT "Declination ( J2000 )" FROM table_55067 WHERE "NGC number" > '5750' | wikisql |
CREATE TABLE table_45979 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when Calgary was visiting team and Niittymaki h... | SELECT "Score" FROM table_45979 WHERE "Decision" = 'niittymaki' AND "Visitor" = 'calgary' | wikisql |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId... | SELECT Posts.Id, Posts.Title, Posts.Score, CASE Votes.VoteTypeId WHEN 2 THEN 'up' WHEN 3 THEN 'down' WHEN 15 THEN 'mod review' WHEN 16 THEN 'approve edit' ELSE CONCAT('<', Votes.VoteTypeId, '>') END AS VoteType FROM Posts JOIN Votes ON Posts.Id = Votes.PostId WHERE Posts.OwnerUserId = '##UserId##' AND Posts.PostTypeId ... | sede |
CREATE TABLE table_61256 (
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Goals Conceded which has a Draw of 0 and a Played l... | SELECT AVG("Goals Conceded") FROM table_61256 WHERE "Draw" = '0' AND "Played" > '0' | wikisql |
CREATE TABLE table_40407 (
"Platform" real,
"Frequency (per hour)" real,
"Destination" text,
"Service Pattern" text,
"Operator" text,
"Line" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many frequencies have a line of East London and desti... | SELECT COUNT("Frequency (per hour)") FROM table_40407 WHERE "Line" = 'east london' AND "Destination" = 'crystal palace' | wikisql |
CREATE TABLE table_45870 (
"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 is Method, when Location is 'Tokyo , Japan', and when Event is ... | SELECT "Method" FROM table_45870 WHERE "Location" = 'tokyo , japan' AND "Event" = 'rings: millennium combine 2' | wikisql |
CREATE TABLE table_58804 (
"Date" text,
"Opponent#" text,
"Site" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the game that was attended by 72,703 people?
| SELECT "Result" FROM table_58804 WHERE "Attendance" = '72,703' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD... | SELECT AVG(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '1409067' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-02-01' AND '2011-06-01' | css |
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 airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
dire... | 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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CIT... | atis |
CREATE TABLE table_name_67 (
attendance INTEGER,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of people attending the game where Colorado was the home team?
| SELECT MIN(attendance) FROM table_name_67 WHERE home = "colorado" | sql_create_context |
CREATE TABLE table_19071 (
"District" text,
"Counties Represented" text,
"Delegate" text,
"Party" text,
"First Elected" real,
"Committee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has a delegate who was first elected in 2006?
| SELECT "Counties Represented" FROM table_19071 WHERE "First Elected" = '2006' | wikisql |
CREATE TABLE table_25516 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episode titled 'Two Towns'?
| SELECT "Directed by" FROM table_25516 WHERE "Title" = 'Two Towns' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'open reduc-int fix femur') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3403) AND ... | mimic_iii |
CREATE TABLE table_30149 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production" text,
"U.S. viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT "Directed by" FROM table_30149 WHERE "Production" = '2M5901' | wikisql |
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.
-- how many games had at least a score of two or more ... | SELECT COUNT(*) FROM table_203_442 WHERE "score" + "score" >= 2 | squall |
CREATE TABLE table_dev_34 (
"id" int,
"gender" string,
"heart_disease" bool,
"body_weight" float,
"hematocrit_hct" float,
"fasting_blood_glucose_fbg" float,
"hyperlipidemia" bool,
"systemic_illness" bool,
"angina" bool,
"serum_ldl" int,
"clinically_significant_atherosclerotic... | SELECT * FROM table_dev_34 WHERE hyperlipidemia = 1 OR (serum_ldl > 158 OR serum_tg > 691) | criteria2sql |
CREATE TABLE table_35880 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" text,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Class where City of license is lake oconee, ga?
| SELECT "Class" FROM table_35880 WHERE "City of license" = 'lake oconee, ga' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... | mimic_iii |
CREATE TABLE table_75299 (
"Position" text,
"Game 1" text,
"Game 2" text,
"Game 3" text,
"Exhibition*" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game 1 has bob lindner as game 2?
| SELECT "Game 1" FROM table_75299 WHERE "Game 2" = 'bob lindner' | wikisql |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
... | SELECT installation_date, COUNT(installation_date) FROM station GROUP BY installation_date ORDER BY installation_date | nvbench |
CREATE TABLE table_56780 (
"County" text,
"Name" text,
"Length (miles)" real,
"West or south terminus" text,
"East or north terminus" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name when the west or south terminus is ne 112 west of b... | SELECT "Name" FROM table_56780 WHERE "West or south terminus" = 'ne 112 west of blue springs' | wikisql |
CREATE TABLE table_name_71 (
frequency VARCHAR,
facility_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Frequency has a Facility ID of 13598?
| SELECT frequency FROM table_name_71 WHERE facility_id = 13598 | sql_create_context |
CREATE TABLE table_7876 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT WAS THE PICK NUMBER FOR BRANDON RUSH?
| SELECT COUNT("Pick") FROM table_7876 WHERE "Player" = 'brandon rush' | wikisql |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varch... | SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'COMP' AND COURSE_0.number = 239 AND COURSE_1.course_id = course_prerequisite.course_id | advising |
CREATE TABLE table_24463470_1 (
setting VARCHAR,
unlocked_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many instances is the unlocked n/a?
| SELECT COUNT(setting) FROM table_24463470_1 WHERE unlocked_by = "N/A" | sql_create_context |
CREATE TABLE table_name_47 (
time VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the time for the match with away team Convoy Sun Hei Team A?
| SELECT time FROM table_name_47 WHERE away_team = "convoy sun hei team a" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7831592' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-06-23' AND '2019-12-27' | css |
CREATE TABLE code_description (
code varchar,
description text
)
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,
fligh... | 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND date_day.day_number = 9 AND date_day.month_number = 4 AND da... | atis |
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 qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_ID = '02315348' AND qtb.IN_HOSP_DATE BETWEEN '2010-02-02' AND '2010-12-21' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_ID = '02315348' AND gyb.IN_HOSP... | css |
CREATE TABLE table_58671 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Position in table" text,
"Replaced by" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was ... | SELECT "Date of appointment" FROM table_58671 WHERE "Outgoing manager" = 'zoltán varga' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.gender = "F" | mimicsql_data |
CREATE TABLE table_19884 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Netflix where Segment D is pressure ga... | SELECT "Netflix" FROM table_19884 WHERE "Segment D" = 'Pressure Gauges' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.jybgb_JZLSH = '37659837066' AND jyjgzbb.JCRXM LIKE '沈%' | css |
CREATE TABLE table_name_25 (
result VARCHAR,
week VARCHAR,
game_site VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the result for week less than 7 and game sites of los angeles memorial coliseum
| SELECT result FROM table_name_25 WHERE week < 7 AND game_site = "los angeles memorial coliseum" | sql_create_context |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_J... | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY EMP_FNAME ORDER BY EMP_FNAME | nvbench |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND date_day.day_number = 27 AND date_day.month_number = 8 AND d... | atis |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Self Pay" AND procedures.long_title = "Regional lymph node excision" | mimicsql_data |
CREATE TABLE table_63877 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest rank of rider colin martin?
| SELECT MAX("Rank") FROM table_63877 WHERE "Rider" = 'colin martin' | wikisql |
CREATE TABLE table_name_68 (
british VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 17th c. pronunciation when the british is ?
| SELECT 17 AS th_c FROM table_name_68 WHERE british = "əʊ" | sql_create_context |
CREATE TABLE table_41412 (
"Club" text,
"Position in 2013" text,
"First season" real,
"First season of current spell" real,
"Number of seasons in Superettan" real,
"Number of seasons in second tier" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
--... | SELECT MIN("First season of current spell") FROM table_41412 WHERE "First season" > '2005' AND "Number of seasons in Superettan" < '8' AND "Club" = 'syrianska fc' | wikisql |
CREATE TABLE table_203_447 (
id number,
"constituency" number,
"region" text,
"name" text,
"party" text,
"last elected" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when was antonio horvath kiss last elected ?
| SELECT "last elected" FROM table_203_447 WHERE "name" = 'antonio horvath kiss' | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.