instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefin... | SELECT COUNT(p.Id) AS "Num Answers", u.Id AS "user_link", u.DisplayName, u.Reputation FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 2 AND u.Reputation > 10 GROUP BY u.Id, u.Reputation, u.DisplayName ORDER BY u.Reputation DESC | sede |
CREATE TABLE table_18795 (
"Season" real,
"Premiers" text,
"Runners Up" text,
"Score" text,
"Captain" text,
"Coach" text,
"Simpson Medal" text,
"Venue" text,
"Attendance" real,
"Umpires" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT "Umpires" FROM table_18795 WHERE "Simpson Medal" = 'Paul Vines (S)' | wikisql |
CREATE TABLE table_name_77 (
became_duchess VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did eleonor magdalene of the palatinate-neuburg become duchess?
| SELECT became_duchess FROM table_name_77 WHERE name = "eleonor magdalene of the palatinate-neuburg" | sql_create_context |
CREATE TABLE table_59240 (
"Name" text,
"Total" real,
"Outstanding Performance" real,
"Fighting Spirit" real,
"Technique" real,
"Years" text,
"Highest rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Fighting Spirit has a Name of t... | SELECT AVG("Fighting Spirit") FROM table_59240 WHERE "Name" = 'tsurugamine' AND "Technique" < '10' | wikisql |
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 COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.... | eicu |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank | nvbench |
CREATE TABLE table_61806 (
"2010" text,
"2009" real,
"2008" real,
"2007" text,
"2006" real,
"2005" real,
"2004" real,
"2003" real,
"2002" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the 2008 with a 2007 of 4,244... | SELECT SUM("2008") FROM table_61806 WHERE "2007" = '4,244,115' AND "2003" < '3,296,267' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2135" AND diagnoses.short_title = "Ac kidny fail, tubr necr" | mimicsql_data |
CREATE TABLE table_57787 (
"Phoneme" text,
"Realization" text,
"Environment" text,
"Example" text,
"Gloss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the example when the environment is #_x
| SELECT "Example" FROM table_57787 WHERE "Environment" = '#_x' | wikisql |
CREATE TABLE table_80402 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country is Chad Campbell from?
| SELECT "Country" FROM table_80402 WHERE "Player" = 'chad campbell' | wikisql |
CREATE TABLE table_47675 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Team 2, when 2nd Leg is 2-1?
| SELECT "Team 2" FROM table_47675 WHERE "2nd leg" = '2-1' | wikisql |
CREATE TABLE table_name_67 (
visitor VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the visiting team when Minnesota is the home team?
| SELECT visitor FROM table_name_67 WHERE home = "minnesota" | sql_create_context |
CREATE TABLE table_202_135 (
id number,
"series" number,
"year" text,
"rank" text,
"average audience share" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many years did heartbeat series run in total ?
| SELECT MAX("year") - MIN("year") FROM table_202_135 | squall |
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 CloseAsOffTopicReasonTypes (
Id number,
IsUniversal... | SELECT TagName FROM Tags WHERE TagName LIKE 'excel-%' | sede |
CREATE TABLE table_204_438 (
id number,
"year" number,
"title" text,
"album" text,
"us r&b" number,
"us pop" number,
"us dance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which years did the album changes not make it on the us dance li... | SELECT "year" FROM table_204_438 WHERE "album" = 'changes' AND "us dance" IS NULL | squall |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "OVERDOSE" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_name_43 (
heat INTEGER,
lane VARCHAR,
country VARCHAR,
mark VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest heat for the United states with a mark of 51.85 pb and lane higher than 6?
| SELECT MIN(heat) FROM table_name_43 WHERE country = "united states" AND mark = "51.85 pb" AND lane > 6 | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD 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 = '2594151' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-10-21' AND '2007-11-27' GROUP B... | css |
CREATE TABLE table_45950 (
"Region (year)" text,
"No. 1" text,
"No. 2" text,
"No. 3" text,
"No. 4" text,
"No. 5" text,
"No. 6" text,
"No. 7" text,
"No. 8" text,
"No. 9" text,
"No. 10" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "No. 7" FROM table_45950 WHERE "No. 4" = 'madison' AND "No. 10" = 'amelia' | wikisql |
CREATE TABLE festival_detail (
Num_of_Audience INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the total number of the audiences who visited any of the festivals?
| SELECT SUM(Num_of_Audience) FROM festival_detail | sql_create_context |
CREATE TABLE table_203_686 (
id number,
"release date" text,
"album" text,
"record label" text,
"uk albums chart" number,
"u.s. billboard 200 chart" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the album that was first to... | SELECT "album" FROM table_203_686 ORDER BY "release date" LIMIT 1 | squall |
CREATE TABLE table_name_38 (
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the visitor on January 19, 2008?
| SELECT visitor FROM table_name_38 WHERE date = "january 19, 2008" | sql_create_context |
CREATE TABLE table_22736523_1 (
result VARCHAR,
song_choice VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result if Coba is the song choice?
| SELECT result FROM table_22736523_1 WHERE song_choice = "Coba" | sql_create_context |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | (SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND j... | css |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT u.Id, u.DisplayName, u.Reputation, u.DownVotes, (u.DownVotes * 2) AS SpentReputation, u.LastAccessDate, u.UpVotes FROM Users AS u WHERE u.Reputation > 30000 ORDER BY u.DownVotes | sede |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'other brain incision') AND STRFTIME('%y', procedures_icd.charttime) >= '2103' | mimic_iii |
CREATE TABLE table_name_40 (
game INTEGER,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What sum of game has an attendance of 18,690?
| SELECT SUM(game) FROM table_name_40 WHERE attendance = 18 OFFSET 690 | sql_create_context |
CREATE TABLE Students (
cell_mobile_number VARCHAR,
student_id VARCHAR
)
CREATE TABLE Student_Addresses (
student_id VARCHAR,
monthly_rental VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the cell phone number of the student whose address ha... | SELECT T2.cell_mobile_number FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.monthly_rental LIMIT 1 | sql_create_context |
CREATE TABLE table_1342233_11 (
candidates VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which district is associated with the incumbent Carl Vinson?
| SELECT candidates FROM table_1342233_11 WHERE incumbent = "Carl Vinson" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM ... | css |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
hig... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BOSTON' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_60684 (
"HD designation" text,
"Constellation" text,
"Distance ( ly )" real,
"Spectral type" text,
"Signal power ( kW )" real,
"Date sent" text,
"Arrival date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Constel... | SELECT "Constellation" FROM table_60684 WHERE "HD designation" = 'hd197076' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32163)) AND DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start o... | mimic_iii |
CREATE TABLE Maintenance_Contracts (
maintenance_contract_id INTEGER,
maintenance_contract_company_id INTEGER,
contract_start_date DATETIME,
contract_end_date DATETIME,
other_contract_details VARCHAR(255)
)
CREATE TABLE Engineer_Visits (
engineer_visit_id INTEGER,
contact_staff_id INTEGER,
... | SELECT fault_short_name, COUNT(fault_short_name) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY fault_short_name | nvbench |
CREATE TABLE table_33848 (
"Number (map)" real,
"Borough" text,
"Population Canada 2011 Census" real,
"Area in km\u00b2" real,
"Density per km\u00b2" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Number (map) is the lowest one that has a Area... | SELECT MIN("Number (map)") FROM table_33848 WHERE "Area in km\u00b2" = '9.7' AND "Population Canada 2011 Census" > '66,158' | wikisql |
CREATE TABLE table_23567 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Foochow" text,
"Area" real,
"Population" real,
"Density" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the density for
| SELECT "Density" FROM table_23567 WHERE "Traditional" = '古田縣' | wikisql |
CREATE TABLE table_19630743_2 (
no INTEGER,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum number of the bmw championship tournament.
| SELECT MIN(no) FROM table_19630743_2 WHERE tournament = "BMW Championship" | sql_create_context |
CREATE TABLE table_name_50 (
april INTEGER,
game VARCHAR,
points VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which April has Points of 95, and a Record of 41 25 10 3, and a Game smaller than 79?
| SELECT SUM(april) FROM table_name_50 WHERE points = 95 AND record = "41–25–10–3" AND game < 79 | sql_create_context |
CREATE TABLE table_52721 (
"Tournament" text,
"Starts" real,
"Top-10s" real,
"Wins" real,
"Earnings ($)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On average, how many Starts have Wins that are smaller than 0?
| SELECT AVG("Starts") FROM table_52721 WHERE "Wins" < '0' | wikisql |
CREATE TABLE table_203_844 (
id number,
"res." text,
"record" text,
"opponent" text,
"method" text,
"event" text,
"date" text,
"round" number,
"time" text,
"location" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "opponent" FROM table_203_844 WHERE "date" > (SELECT "date" FROM table_203_844 WHERE "opponent" = 'hatsu hioki') ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
Dup... | SELECT x.Id, x.DisplayName, x.PostTypeId, x.Score FROM (SELECT u.Id, u.DisplayName, p.PostTypeId, MAX(CAST(Score AS FLOAT)) AS score, ROW_NUMBER() OVER (PARTITION BY u.Id, p.PostTypeId ORDER BY MAX(CAST(Score AS FLOAT)) DESC) AS rn FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id GROUP BY u.Id, u.DisplayNa... | sede |
CREATE TABLE table_62821 (
"Location" text,
"Year" text,
"Champion" text,
"Runner-up" text,
"Score" text,
"Name" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name with a Score of 6 3, 6 3?
| SELECT "Name" FROM table_62821 WHERE "Score" = '6–3, 6–3' | wikisql |
CREATE TABLE table_11944282_1 (
integrated VARCHAR,
component VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the integrated where the component are customers?
| SELECT integrated FROM table_11944282_1 WHERE component = "Customers" | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
ins... | SELECT DISTINCT course_offering.friday 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.department = 'ANTHRARC' AND course.number = 487 AND semester.semester = 'WN' AND semester.year = 2016 | 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.admission_location = "CLINIC REFERRAL/PREMATURE" AND prescriptions.drug = "Ampicillin-Sulbactam" | mimicsql_data |
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 t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'cultures - sputum' AND STRFTIME('%y', treatment.treatmenttime) <= '2104')... | eicu |
CREATE TABLE table_19859 (
"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 divisi... | SELECT COUNT("Number of seasons in top division") FROM table_19859 WHERE "Position in 2012\u201313" = '005 5th' | wikisql |
CREATE TABLE table_41280 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT "High rebounds" FROM table_41280 WHERE "Score" = 'l 108–114 (ot)' | wikisql |
CREATE TABLE table_60935 (
"Name" text,
"Public" text,
"Intranet" text,
"Extranet" text,
"Personal Sites" text,
"Team Sites" text,
"Developer" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the intranet entry is Yes, what is the extranet ... | SELECT "Extranet" FROM table_60935 WHERE "Intranet" = 'yes' AND "Name" = 'microsoft exchange server' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE IN_DIAG_DIS_NM = '腔隙性脑梗死' | css |
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
... | SELECT apt_type_code, COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_2721 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the manner of departure for 1 decem... | SELECT "Manner of departure" FROM table_2721 WHERE "Date of vacancy" = '1 December 2009' | wikisql |
CREATE TABLE table_name_35 (
iata VARCHAR,
icao VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is IATA, when ICAO is 'Hesh'?
| SELECT iata FROM table_name_35 WHERE icao = "hesh" | sql_create_context |
CREATE TABLE visitors (
tourist_id number,
tourist_details text
)
CREATE TABLE staff (
staff_id number,
tourist_attraction_id number,
name text,
other_details text
)
CREATE TABLE visits (
visit_id number,
tourist_attraction_id number,
tourist_id number,
visit_date time,
vis... | SELECT address FROM locations WHERE location_name = "UK Gallery" | spider |
CREATE TABLE table_name_73 (
outcome VARCHAR,
year VARCHAR,
surface VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result in 1973 when the surface was clay?
| SELECT outcome FROM table_name_73 WHERE year = 1973 AND surface = "clay" | sql_create_context |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.dob_year < "1846" | mimicsql_data |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type t... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21079) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 = 2 | mimic_iii |
CREATE TABLE table_55232 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the home team's score when the away tea... | SELECT "Home team score" FROM table_55232 WHERE "Away team score" = '16.14 (110)' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE restriction (
restriction_c... | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'DALLAS' AND flight.to_airport = airport_service.airport_code | atis |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Oxygen Saturation" | mimicsql_data |
CREATE TABLE table_1342270_3 (
first_elected VARCHAR,
candidates VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the first elected with candidates being joe starnes (d) 100.0% george bogus ( w/i ) 0.003%
| SELECT first_elected FROM table_1342270_3 WHERE candidates = "Joe Starnes (D) 100.0% George Bogus ( W/I ) 0.003%" | sql_create_context |
CREATE TABLE table_8190 (
"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 was the money value for Jerry Pate?
| SELECT "Money ( $ )" FROM table_8190 WHERE "Player" = 'jerry pate' | wikisql |
CREATE TABLE table_79222 (
"Date" text,
"Track" text,
"Race" text,
"Finish" text,
"Fin. Time" text,
"Last 1/4" text,
"Driver" text,
"Trainer" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the finishing time with a 2/1q finish on... | SELECT "Fin. Time" FROM table_79222 WHERE "Finish" = '2/1q' AND "Track" = 'the meadowlands' | wikisql |
CREATE TABLE table_name_47 (
attendance INTEGER,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many attended tie number 1?
| SELECT SUM(attendance) FROM table_name_47 WHERE tie_no = "1" | sql_create_context |
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
... | SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY state | nvbench |
CREATE TABLE table_1342218_13 (
incumbent VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the incumbent in the Illinois 17 district?
| SELECT incumbent FROM table_1342218_13 WHERE district = "Illinois 17" | sql_create_context |
CREATE TABLE table_200_32 (
id number,
"year" number,
"w" number,
"l" number,
"t" number,
"finish" text,
"coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many years did cooney checkaye coach the muncie flyers ?
| SELECT COUNT("year") FROM table_200_32 WHERE "coach" = 'cooney checkaye' | squall |
CREATE TABLE table_16684420_2 (
skip VARCHAR,
stolen_ends_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the skip when the stolen ends against was 13?
| SELECT skip FROM table_16684420_2 WHERE stolen_ends_against = 13 | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT PostId AS "post_link", OwnerUserId AS "user_link", COUNT(Id) AS SuggestionCount FROM SuggestedEdits WHERE NOT RejectionDate IS NULL AND NOT OwnerUserId IS NULL GROUP BY PostId, OwnerUserId ORDER BY SuggestionCount DESC LIMIT 100 | sede |
CREATE TABLE table_23023 (
"Country" text,
"Total Drivers" real,
"Champions" real,
"Championships" real,
"Current March 20, 2010" real,
"First driver(s)" text,
"Last/Current driver(s) March 20, 2010" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT MIN("Championships") FROM table_23023 | wikisql |
CREATE TABLE table_29644931_1 (
result VARCHAR,
category VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result when competing in the Opening NIght Film category?
| SELECT result FROM table_29644931_1 WHERE category = "Opening Night Film" | sql_create_context |
CREATE TABLE table_name_79 (
country VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the country when the score is 72-68-67=207?
| SELECT country FROM table_name_79 WHERE score = 72 - 68 - 67 = 207 | sql_create_context |
CREATE TABLE table_5546 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of laps for Marco Simoncelli on a grid higher than 11?
| SELECT MIN("Laps") FROM table_5546 WHERE "Rider" = 'marco simoncelli' AND "Grid" > '11' | wikisql |
CREATE TABLE customer (
store_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which store has most the customers?
| SELECT store_id FROM customer GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_name_56 (
perth VARCHAR,
adelaide VARCHAR,
melbourne VARCHAR,
gold_coast VARCHAR,
sydney VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Perth has Gold Coast yes, Sydney yes, Melbourne yes, and Adelaide yes?
| SELECT perth FROM table_name_56 WHERE gold_coast = "yes" AND sydney = "yes" AND melbourne = "yes" AND adelaide = "yes" | sql_create_context |
CREATE TABLE table_name_92 (
quantity_made VARCHAR,
class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Quantity made when class is f-7?
| SELECT quantity_made FROM table_name_92 WHERE class = "f-7" | sql_create_context |
CREATE TABLE table_204_670 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"record" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which game had a bigger crowd , week 4 or week 9 ?
| SELECT "week" FROM table_204_670 WHERE "week" IN (4, 9) ORDER BY "attendance" DESC LIMIT 1 | squall |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | SELECT zzmzjzjlb.JZLSH 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 = '55748768' AND hz_info.YLJGDM = '3373155' AND zzmzjzjlb.JZKSMC LIKE '%推拿%' UNION SELECT fzzmzjzjlb.JZLSH FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJG... | css |
CREATE TABLE table_name_42 (
player VARCHAR,
position VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player has a Position of defence, and a Pick # of 6?
| SELECT player FROM table_name_42 WHERE position = "defence" AND pick__number = "6" | sql_create_context |
CREATE TABLE table_name_78 (
award VARCHAR,
director_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the award for candida scott knight
| SELECT award FROM table_name_78 WHERE director_s_ = "candida scott knight" | sql_create_context |
CREATE TABLE table_22398 (
"Episode" text,
"Garfield Episode 1" text,
"U.S. Acres Episode" text,
"Garfield Episode 2" text,
"Original Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original air date of the u.s. acres episode who... | SELECT "Original Airdate" FROM table_22398 WHERE "U.S. Acres Episode" = 'Who Done It?' | wikisql |
CREATE TABLE table_43497 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many grids had a constructor of renault and less than 4 laps?
| SELECT SUM("Grid") FROM table_43497 WHERE "Constructor" = 'renault' AND "Laps" < '4' | wikisql |
CREATE TABLE table_16343 (
"League" text,
"Sport" text,
"Country" text,
"Season" text,
"Games" real,
"Average attendance" real,
"Total attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sport of the La Liga league?
| SELECT "Sport" FROM table_16343 WHERE "League" = 'La Liga' | wikisql |
CREATE TABLE table_24096813_15 (
part_number_s_ VARCHAR,
tdp VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the part number of the model with TDP of 2.9 (max.4.1~5.4) w?
| SELECT part_number_s_ FROM table_24096813_15 WHERE tdp = "2.9 (Max.4.1~5.4) W" | sql_create_context |
CREATE TABLE table_13196 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has a 14 to par?
| SELECT "Country" FROM table_13196 WHERE "To par" = '14' | wikisql |
CREATE TABLE table_75431 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Opponent of edmonton oilers, and a Game of 3 is what series?
| SELECT "Series" FROM table_75431 WHERE "Opponent" = 'edmonton oilers' AND "Game" = '3' | wikisql |
CREATE TABLE table_name_94 (
fleet_number_s_ VARCHAR,
wheel_arrangement VARCHAR,
year_made VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fleet number with a 4-6-0 wheel arrangement made in 1890?
| SELECT fleet_number_s_ FROM table_name_94 WHERE wheel_arrangement = "4-6-0" AND year_made = "1890" | sql_create_context |
CREATE TABLE table_name_13 (
position VARCHAR,
club_team VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Postion, when the Club/Team is Warroad Lakers, and when the Name is Roger Christian?
| SELECT position FROM table_name_13 WHERE club_team = "warroad lakers" AND name = "roger christian" | sql_create_context |
CREATE TABLE table_16738 (
"Rnd" real,
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many roun... | SELECT COUNT("Rnd") FROM table_16738 WHERE "Pole Position" = 'James Hunt' AND "Fastest Lap" = 'John Watson' | wikisql |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
... | SELECT DISTINCT WRITES_0.paperid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'ras bodik' AND AUTHOR_1.authorname = 'ameet soni' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid | scholar |
CREATE TABLE table_4916 (
"Lane" real,
"Name" text,
"Nationality" text,
"50m Split" real,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Lane had a 50m Split of 25.8?
| SELECT COUNT("Lane") FROM table_4916 WHERE "50m Split" = '25.8' | wikisql |
CREATE TABLE building (
name VARCHAR,
street_address VARCHAR,
floors VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the name, street address, and number of floors for all buildings ordered by the number of floors.
| SELECT name, street_address, floors FROM building ORDER BY floors | sql_create_context |
CREATE TABLE table_36187 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the record for Game 58?
| SELECT "Record" FROM table_36187 WHERE "Game" = '58' | wikisql |
CREATE TABLE table_name_87 (
surface VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Surface, when Tournament is 'Saint Joseph , United States'?
| SELECT surface FROM table_name_87 WHERE tournament = "saint joseph , united states" | sql_create_context |
CREATE TABLE table_203_481 (
id number,
"n\u00b0" number,
"name" text,
"position" text,
"date of birth" text,
"nationality" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which player is younger , soan falafala or david smith ?
| SELECT "name" FROM table_203_481 WHERE "name" IN ('soane falafala', 'david smith') ORDER BY "date of birth" DESC LIMIT 1 | squall |
CREATE TABLE table_27987 (
"Rnd" text,
"Circuit" text,
"Location" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Most laps led" text,
"Winning driver" text,
"Winning team" text,
"Supporting" text
)
-- Using valid SQLite, answer the following questions for the tab... | SELECT "Most laps led" FROM table_27987 WHERE "Location" = 'Monterey, California' AND "Winning driver" = 'Scott Rarick' | wikisql |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE city (
city_code varchar,
city_na... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare 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 ... | atis |
CREATE TABLE table_159359_2 (
start_date__1st_night_ VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When are start dates (1st night) for the season of 1966?
| SELECT start_date__1st_night_ FROM table_159359_2 WHERE season = "1966" | sql_create_context |
CREATE TABLE table_64990 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which game was on September 12?
| SELECT "Game" FROM table_64990 WHERE "Date" = 'september 12' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.