instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_60 (
date_of_registration VARCHAR,
name_in_english VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the Canarian Workers Socialist Union registered?
| SELECT date_of_registration FROM table_name_60 WHERE name_in_english = "canarian workers socialist union" | sql_create_context |
CREATE TABLE table_12182 (
"Draft" text,
"Round" text,
"Pick" text,
"Nationality" text,
"Position" text,
"College/High School/Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which round was Position G from the United States drafted as Pi... | SELECT "Round" FROM table_12182 WHERE "Nationality" = 'united states' AND "Position" = 'g' AND "Pick" = '13' AND "Draft" = '1971-1 1971' | wikisql |
CREATE TABLE table_65539 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of the game played on 2/17/1974?
| SELECT "Record" FROM table_65539 WHERE "Date" = '2/17/1974' | wikisql |
CREATE TABLE table_38298 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" real,
"2nd (m)" real,
"Points" real,
"Overall WC points (Rank)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many 2nd (m) have aut as the nationality, w... | SELECT SUM("2nd (m)") FROM table_38298 WHERE "Nationality" = 'aut' AND "Rank" = '4' AND "1st (m)" < '122.5' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title 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... | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'abdmnal pain oth spcf st') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-5 year'... | mimic_iii |
CREATE TABLE table_name_40 (
shortstop VARCHAR,
second_baseman VARCHAR,
catcher VARCHAR,
third_baseman VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the shortstop when the Catcher was johnny roseboro, and a Third Baseman of jim l... | SELECT shortstop FROM table_name_40 WHERE catcher = "johnny roseboro" AND third_baseman = "jim lefebvre" AND second_baseman = "nate oliver" | sql_create_context |
CREATE TABLE weather (
date text,
max_temperature_f number,
mean_temperature_f number,
min_temperature_f number,
max_dew_point_f number,
mean_dew_point_f number,
min_dew_point_f number,
max_humidity number,
mean_humidity number,
min_humidity number,
max_sea_level_pressure_inc... | SELECT date, zip_code FROM weather WHERE min_dew_point_f < (SELECT MIN(min_dew_point_f) FROM weather WHERE zip_code = 94107) | spider |
CREATE TABLE table_name_17 (
date VARCHAR,
opposing_teams VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day was Wales the opposing team?
| SELECT date FROM table_name_17 WHERE opposing_teams = "wales" | sql_create_context |
CREATE TABLE table_name_96 (
series VARCHAR,
home VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Series has a Home of 2 0, and an Opponent of panathinaikos?
| SELECT series FROM table_name_96 WHERE home = "2–0" AND opponent = "panathinaikos" | sql_create_context |
CREATE TABLE book_club (
book_club_id number,
year number,
author_or_editor text,
book_title text,
publisher text,
category text,
result text
)
CREATE TABLE movie (
movie_id number,
title text,
year number,
director text,
budget_million number,
gross_worldwide number... | SELECT year, book_title, publisher FROM book_club ORDER BY year DESC | spider |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute coronary syndrome' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_T... | eicu |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '04270747' AND t_kc21.MED_SER_ORG_NO = '7760452' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-03-02' AND '2009-09-13') | css |
CREATE TABLE qualifying (
qualifyId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
position INTEGER,
q1 TEXT,
q2 TEXT,
q3 TEXT
)
CREATE TABLE circuits (
circuitId INTEGER,
circuitRef TEXT,
name TEXT,
location TEXT,
country TEXT,... | SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY COUNT(name) | nvbench |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-2586')) AND STRFTIME('%y', diagnosis.diagnosistime) = '2105' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2184" AND procedures.long_title = "Fiber-optic bronchoscopy" | mimicsql_data |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
... | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry | nvbench |
CREATE TABLE table_8114 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the pick for robert griffin iii?
| SELECT "Pick" FROM table_8114 WHERE "Name" = 'robert griffin iii' | wikisql |
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)
CREATE TABLE Research_Staff (
staff_id INTEGER,
employer_organisation_id INTEGER,
staff_details VARCHAR(255)
)
CREATE TABLE Documents (
document_id INTEGER,
document_type_code VARC... | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "16" AND prescriptions.route = "PO" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'hct') | eicu |
CREATE TABLE table_name_42 (
share INTEGER,
viewers__millions_ VARCHAR,
rating VARCHAR,
rank__timeslot_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of share with a rating larger than 1.2, a 3 rank timeslot, and 6.07 million viewers... | SELECT SUM(share) FROM table_name_42 WHERE rating > 1.2 AND rank__timeslot_ = 3 AND viewers__millions_ = 6.07 | sql_create_context |
CREATE TABLE table_name_30 (
country VARCHAR,
gdp__nominal_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has a GDP (nominal) of $29.9 billion?
| SELECT country FROM table_name_30 WHERE gdp__nominal_ = "$29.9 billion" | sql_create_context |
CREATE TABLE table_11875 (
"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.
-- When did the home team score 13.11 (89)?
| SELECT "Date" FROM table_11875 WHERE "Home team score" = '13.11 (89)' | wikisql |
CREATE TABLE table_name_8 (
date VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the game played at princes park?
| SELECT date FROM table_name_8 WHERE venue = "princes park" | sql_create_context |
CREATE TABLE table_name_33 (
goals_against INTEGER,
lost VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Goals Against, when Lost is 45, and when Points is greater than 68?
| SELECT SUM(goals_against) FROM table_name_33 WHERE lost = 45 AND points > 68 | sql_create_context |
CREATE TABLE table_20493 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Bills points" real,
"Opponents" real,
"Bills first downs" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many first downs did the bi... | SELECT MIN("Bills first downs") FROM table_20493 WHERE "Opponents" = '6' | wikisql |
CREATE TABLE table_33640 (
"Player" text,
"Nationality" text,
"Position" text,
"From" text,
"School/Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality of the guard/forward who began playing in 1977?
| SELECT "Nationality" FROM table_33640 WHERE "Position" = 'guard/forward' AND "From" = '1977' | wikisql |
CREATE TABLE table_204_479 (
id number,
"defendant" text,
"arrested" text,
"charge" text,
"result" text,
"sentence" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was arrested on jan 7,1956 ?
| SELECT "defendant" FROM table_204_479 WHERE "arrested" = 'january 7, 1956' | squall |
CREATE TABLE table_204_775 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many teams won at least three bronze medals in this event ?
| SELECT COUNT("nation") FROM table_204_775 WHERE "bronze" >= 3 | squall |
CREATE TABLE affiliated_with (
physician number,
department number,
primaryaffiliation boolean
)
CREATE TABLE medication (
code number,
name text,
brand text,
description text
)
CREATE TABLE trained_in (
physician number,
treatment number,
certificationdate time,
certificat... | SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE primaryaffiliation = 1 | spider |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.age < "68" | mimicsql_data |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'CDB' AND course.number = 450 AND semester.semester = 'WN' AND semester.semester_id = course_offe... | advising |
CREATE TABLE table_1769428_2 (
team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the represented team on June 27?
| SELECT team FROM table_1769428_2 WHERE date = "June 27" | sql_create_context |
CREATE TABLE table_74590 (
"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.
-- When was Fitzroy the home team?
| SELECT "Date" FROM table_74590 WHERE "Home team" = 'fitzroy' | wikisql |
CREATE TABLE table_1341973_11 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which district is the incumbent Carl Vinson?
| SELECT district FROM table_1341973_11 WHERE incumbent = "Carl Vinson" | sql_create_context |
CREATE TABLE table_name_42 (
opponent_in_the_final VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent in the final of the Tournament of Blenheim?
| SELECT opponent_in_the_final FROM table_name_42 WHERE tournament = "blenheim" | sql_create_context |
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Ref_Transaction_Types (
transa... | SELECT T2.date_of_transaction, COUNT(T2.date_of_transaction) FROM Ref_Transaction_Types AS T1 JOIN Transactions AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10 GROUP BY transaction_type_description | nvbench |
CREATE TABLE table_name_5 (
nationality VARCHAR,
goals VARCHAR,
apps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Nationality of the Player with more than 8 Goals and Apps of 52?
| SELECT nationality FROM table_name_5 WHERE goals > 8 AND apps = 52 | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Na... | WITH my_table AS (SELECT T.TagName, CAST((JULIANDAY(CreationDate) - JULIANDAY(P.CreationDate)) * 24.0 AS INT) AS ResponseMinutes FROM Posts AS P INNER JOIN Posts AS A ON P.AcceptedAnswerId = A.Id INNER JOIN PostTags AS PT ON P.Id = PT.PostId INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE P.PostTypeId = 1 AND (T.TagName ... | sede |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId n... | SELECT COUNT(*) FROM Posts | sede |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
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 COURSE (
CRS_CODE... | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM PROFESSOR AS T1 JOIN EMPLOYEE AS T2 ON T1.EMP_NUM = T2.EMP_NUM GROUP BY EMP_FNAME ORDER BY EMP_FNAME | nvbench |
CREATE TABLE table_9207 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Attendance, when Date is 'December 20, 1970', and when Week is less than 14?
| SELECT MIN("Attendance") FROM table_9207 WHERE "Date" = 'december 20, 1970' AND "Week" < '14' | wikisql |
CREATE TABLE table_name_48 (
t_papadopoulos VARCHAR,
d_christofias VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the percentage for T. Papadopoulos when D. Christofias was 28.4%?
| SELECT t_papadopoulos FROM table_name_48 WHERE d_christofias = "28.4%" | sql_create_context |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id nu... | SELECT COUNT(a.Id) FROM Posts AS a LEFT JOIN Posts AS q ON a.ParentId = q.Id WHERE a.PostTypeId = 2 AND (a.Score > 0 OR q.AcceptedAnswerId = a.Id) AND a.OwnerUserId = '##UserId:int##' | sede |
CREATE TABLE table_name_48 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Home team score At Windy Hill?
| SELECT home_team AS score FROM table_name_48 WHERE venue = "windy hill" | sql_create_context |
CREATE TABLE table_16799784_13 (
name VARCHAR,
latitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What feature is at latitude 23.9S?
| SELECT name FROM table_16799784_13 WHERE latitude = "23.9S" | sql_create_context |
CREATE TABLE playlist_tracks (
playlist_id number,
track_id number
)
CREATE TABLE employees (
id number,
last_name text,
first_name text,
title text,
reports_to number,
birth_date time,
hire_date time,
address text,
city text,
state text,
country text,
postal_cod... | SELECT composer FROM tracks WHERE name = "Fast As a Shark" | spider |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
ni... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_code = airport_service.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_name = 'ATLANTA' AND ground_service.airp... | atis |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGui... | SELECT tb.Id, tb.TagName, COUNT(*) FROM PostTags AS a JOIN PostTags AS b ON a.PostId = b.PostId LEFT OUTER JOIN Tags AS ta ON a.TagId = ta.Id LEFT OUTER JOIN Tags AS tb ON b.TagId = tb.Id WHERE ta.TagName = 'python' GROUP BY tb.Id, tb.TagName HAVING COUNT(*) > 10 ORDER BY COUNT(*) DESC | sede |
CREATE TABLE table_name_58 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record on March 22?
| SELECT record FROM table_name_58 WHERE date = "march 22" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '23126323' AND hz_info.YLJGDM = '2184508' AND NOT zyjzjlb.CYKSMC LIKE '%美容%' | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "6959" | mimicsql_data |
CREATE TABLE table_name_3 (
loss VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lost On August 20
| SELECT loss FROM table_name_3 WHERE date = "august 20" | sql_create_context |
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.drugname FROM (SELECT t2.drugname, 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 = 'protein-calorie malnutrition' AND DATETIME(diagnos... | eicu |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Closure of skin and subcutaneous tissue of other sites" | mimicsql_data |
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 mzjzjlb (
HXPLC number,
HZXM ... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON 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 jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM ... | css |
CREATE TABLE table_204_914 (
id number,
"year" number,
"team" text,
"games" number,
"attempts" number,
"yards" number,
"ypc" number,
"long" number,
"tds" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which year did dickerson earn ... | SELECT "year" FROM table_204_914 ORDER BY "yards" DESC LIMIT 1 | squall |
CREATE TABLE table_11026 (
"Country" text,
"Alternate title/Translation" text,
"TV network(s)" text,
"Series premiere" text,
"Weekly schedule" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What TV network is the series aistr em aired on?
| SELECT "TV network(s)" FROM table_11026 WHERE "Alternate title/Translation" = 'aistrų žemė' | wikisql |
CREATE TABLE table_61546 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/junior/club team (league)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Position, when Round is less than 5, when Nationality is 'Canada'... | SELECT "Position" FROM table_61546 WHERE "Round" < '5' AND "Nationality" = 'canada' AND "College/junior/club team (league)" = 'saint john sea dogs ( qmjhl )' | wikisql |
CREATE TABLE table_203_531 (
id number,
"date" text,
"tournament" text,
"location" text,
"winner" text,
"score" text,
"1st prize ($)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many tournaments did sergio garcia win on the 2002 pga... | SELECT COUNT("tournament") FROM table_203_531 WHERE "winner" = 'sergio garcia' | squall |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treat... | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'kidney stone procedure - with removal of ureteral calculus' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-6 year') | eicu |
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 PER_EXP FROM t_kc24 WHERE MED_CLINIC_ID = '72543099331' | css |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description... | SELECT Id AS "post_link", ViewCount, CreationDate FROM Posts WHERE PostTypeId = 1 AND ViewCount IS NULL ORDER BY CreationDate | sede |
CREATE TABLE table_name_40 (
category VARCHAR,
result VARCHAR,
lost_to VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which Category has a Result of nominated, and a Lost to of jennifer westfeldt ( kissing jessica stein )?
| SELECT category FROM table_name_40 WHERE result = "nominated" AND lost_to = "jennifer westfeldt ( kissing jessica stein )" | sql_create_context |
CREATE TABLE table_77389 (
"Rank" real,
"Mountain Peak" text,
"State" text,
"Mountain Range" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the mountain range when the state is colorado, rank is higher than 90 and mountain p... | SELECT "Mountain Range" FROM table_77389 WHERE "State" = 'colorado' AND "Rank" > '90' AND "Mountain Peak" = 'whetstone mountain' | wikisql |
CREATE TABLE table_16162581_1 (
simplified_characters VARCHAR,
wade_giles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the simplified charaacters being hsin-y an i-ma
| SELECT simplified_characters FROM table_16162581_1 WHERE wade_giles = "hsin-yüan … i-ma" | sql_create_context |
CREATE TABLE table_name_64 (
sport VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What sport is the rayo vallecano club in?
| SELECT sport FROM table_name_64 WHERE club = "rayo vallecano" | sql_create_context |
CREATE TABLE table_3822 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the o... | SELECT COUNT("Outgoing manager") FROM table_3822 WHERE "Replaced by" = 'Esteban Vigo' | 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 COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7794776' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-04-14' AND '2016-12-22' AND t_kc21.IN_DIAG_DIS_CD <> t_kc21.OUT_DIAG_DIS_CD | css |
CREATE TABLE table_20893 (
"Player" text,
"Team" text,
"Matches" real,
"Wickets" real,
"Average" text,
"Best Bowling" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players Bowled 4/125?
| SELECT COUNT("Player") FROM table_20893 WHERE "Best Bowling" = '4/125' | wikisql |
CREATE TABLE table_22455 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Township" FROM table_22455 WHERE "Land ( sqmi )" = '35.766' | wikisql |
CREATE TABLE table_name_88 (
lane INTEGER,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average lane that is called rebecca brown?
| SELECT AVG(lane) FROM table_name_88 WHERE name = "rebecca brown" | sql_create_context |
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 varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT credits FROM course WHERE department = 'EECS' AND number = 522 | advising |
CREATE TABLE table_30120547_1 (
barony VARCHAR,
townland VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the barony of the Gurraghy townland?
| SELECT barony FROM table_30120547_1 WHERE townland = "Gurraghy" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'urinostomy status nec') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admis... | mimic_iii |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '022-134034' AND STRFTIME('%y', patient.hospitaladmittime) >= '2105' ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '50213668459') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '50213668459') AND JCZBJGDL >= (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '50213668459') | css |
CREATE TABLE table_name_28 (
dates_active VARCHAR,
max_1_min_wind_mph__km_h_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the active Date that has a 65 (100) Max 1-min wind?
| SELECT dates_active FROM table_name_28 WHERE max_1_min_wind_mph__km_h_ = "65 (100)" | sql_create_context |
CREATE TABLE table_44160 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which nationality is Dick Walker?
| SELECT "Nationality" FROM table_44160 WHERE "Player" = 'dick walker' | wikisql |
CREATE TABLE table_21707 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the class of the verb whose part 1 is lesan?
| SELECT "Class" FROM table_21707 WHERE "Part 1" = 'lesan' | wikisql |
CREATE TABLE table_12137 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Portugal has how many total number of medals when there is 1 gold medal, and bronze medals a... | SELECT COUNT("Total") FROM table_12137 WHERE "Gold" = '1' AND "Nation" = 'portugal' AND "Bronze" > '0' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-76924' AND patient.wardid = 384 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
reg... | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 | restaurants |
CREATE TABLE table_name_92 (
year INTEGER,
film_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest year that Kim was nominated for Over the Rainbow?
| SELECT MAX(year) FROM table_name_92 WHERE film_series = "over the rainbow" | sql_create_context |
CREATE TABLE table_52348 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What w... | SELECT "Score" FROM table_52348 WHERE "Game" = '3' | wikisql |
CREATE TABLE table_name_86 (
votes INTEGER,
party VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of votes for the Party of Labour?
| SELECT MIN(votes) FROM table_name_86 WHERE party = "labour" | sql_create_context |
CREATE TABLE electoral_register (
electoral_register_id number,
cmi_cross_ref_id number
)
CREATE TABLE benefits_overpayments (
council_tax_id number,
cmi_cross_ref_id number
)
CREATE TABLE cmi_cross_references (
cmi_cross_ref_id number,
master_customer_id number,
source_system_code text
)
... | SELECT * FROM customer_master_index ORDER BY cmi_details DESC | spider |
CREATE TABLE table_17607663_1 (
date_withdrawn VARCHAR,
secr_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the withdraw date for secr no. 771?
| SELECT date_withdrawn FROM table_17607663_1 WHERE secr_no = 771 | sql_create_context |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
... | SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 | nvbench |
CREATE TABLE table_63873 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had a larger rank than 3, less than 6 lanes, and a time of 1:58.15?
| SELECT "Name" FROM table_63873 WHERE "Rank" > '3' AND "Lane" < '6' AND "Time" = '1:58.15' | wikisql |
CREATE TABLE qtb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT qtb.OUT_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '1586610' GROUP BY qtb.OUT_DIAG_DIS_NM UNION SELECT gyb.OUT_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '1586610' GROUP BY gyb.OUT_DIAG_DIS_NM UNION SELECT zyb.OUT_DIAG_DIS_NM, AVG(zyb.PERSON_AGE) FROM zyb WHERE... | css |
CREATE TABLE table_3771 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the origin... | SELECT "Original air date" FROM table_3771 WHERE "Directed by" = 'Alex Zakrzewski' | wikisql |
CREATE TABLE table_7598 (
"Mission name" text,
"Lunar lander" text,
"Lunar landing date" text,
"Lunar blastoff date" text,
"Lunar landing site" text,
"Duration on lunar surface" text,
"Crew" text,
"Number of s EVA" real,
"Total EVA Time (HH:MM)" text
)
-- Using valid SQLite, answer... | SELECT "Lunar landing site" FROM table_7598 WHERE "Duration on lunar surface" = '21:31' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | 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 = 'atrial fibrillation' AND DATETIME(diagnosis.... | eicu |
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARCHA... | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_name_35 (
qual VARCHAR,
laps VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the qualification with more than 162 laps in 1953?
| SELECT qual FROM table_name_35 WHERE laps > 162 AND year = "1953" | sql_create_context |
CREATE TABLE table_name_53 (
episode_no VARCHAR,
original_airdate VARCHAR,
production_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the episode number of the episode that originally aired on January 26, 2009 and had a production number smalle... | SELECT COUNT(episode_no) FROM table_name_53 WHERE original_airdate = "january 26, 2009" AND production_no < 38 | sql_create_context |
CREATE TABLE table_5334 (
"Specification" text,
"Gender" text,
"Junior High School (12\u201315 yrs)" text,
"Senior High School (15\u201318 yrs)" text,
"University students and Adults (18yrs+)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which jun... | SELECT "Junior High School (12\u201315 yrs)" FROM table_5334 WHERE "University students and Adults (18yrs+)" = '26mm' | wikisql |
CREATE TABLE table_24136814_3 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record for the Argonauts on September 7?
| SELECT record FROM table_24136814_3 WHERE date = "September 7" | sql_create_context |
CREATE TABLE table_25350 (
"County" text,
"Population" real,
"Unemployment Rate" text,
"Market Income Per Capita" text,
"Poverty Rate" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the market income per capita in a county... | SELECT "Market Income Per Capita" FROM table_25350 WHERE "Status" = 'Distressed' AND "Unemployment Rate" = '10.5%' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.