instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62983) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year') | mimic_iii |
CREATE TABLE table_name_53 (
productions VARCHAR,
rose VARCHAR,
herbie VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What production had Angela Lansbury as Rose and Barrie Ingham as Herbie?
| SELECT productions FROM table_name_53 WHERE rose = "angela lansbury" AND herbie = "barrie ingham" | sql_create_context |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2172" AND diagnoses.long_title = "Contact dermatitis and other eczema, unspecified cause" | mimicsql_data |
CREATE TABLE table_65853 (
"Season" real,
"Level" text,
"Division" text,
"Section" text,
"Administration" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the administration when the division was Ykk nen (first division), ... | SELECT "Administration" FROM table_65853 WHERE "Division" = 'ykkönen (first division)' AND "Position" = '1st' AND "Season" = '1996' | wikisql |
CREATE TABLE Product (
product_id INTEGER,
product_name VARCHAR(80),
product_details VARCHAR(255)
)
CREATE TABLE Problems (
problem_id INTEGER,
product_id INTEGER,
closure_authorised_by_staff_id INTEGER,
reported_by_staff_id INTEGER,
date_problem_reported DATETIME,
date_problem_clos... | SELECT log_entry_description, COUNT(log_entry_description) FROM Problem_Log GROUP BY log_entry_description ORDER BY COUNT(log_entry_description) DESC | nvbench |
CREATE TABLE table_37585 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was home with a record of 7 5 2?
| SELECT "Home" FROM table_37585 WHERE "Record" = '7–5–2' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-6959' AND patient.hospitaldis... | eicu |
CREATE TABLE table_2698 (
"Constituency" text,
"Winner" text,
"Party" text,
"Margin" real,
"Runner-up a" text,
"Party a" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party won with a margin of 105731?
| SELECT "Party" FROM table_2698 WHERE "Margin" = '105731' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "85" AND lab.itemid = "51274" | mimicsql_data |
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 demographic (
subject_id text,
hadm_id t... | SELECT demographic.dob, demographic.expire_flag FROM demographic WHERE demographic.name = "Jesse Ran" | mimicsql_data |
CREATE TABLE table_68679 (
"Year" text,
"Title" text,
"( Title in English )" text,
"Director" text,
"Character" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the year of the TV series that has a character of Leiloon Bala Barareh?
| SELECT "Year" FROM table_68679 WHERE "Character" = 'leiloon bala barareh' | wikisql |
CREATE TABLE table_name_5 (
large_end VARCHAR,
taper VARCHAR,
ft VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Large end has a Taper/ft smaller than 0.6000000000000001?
| SELECT COUNT(large_end) FROM table_name_5 WHERE taper / ft < 0.6000000000000001 | sql_create_context |
CREATE TABLE table_68006 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average round for te position?
| SELECT AVG("Round") FROM table_68006 WHERE "Position" = 'te' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arriv... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, da... | atis |
CREATE TABLE table_38340 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a Loss of buehrle (7-2)?
| SELECT "Score" FROM table_38340 WHERE "Loss" = 'buehrle (7-2)' | 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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '01374197' AND MED_SER_ORG_NO = '5447381' AND NOT IN_DIAG_DIS_NM LIKE '%紫癜%' | css |
CREATE TABLE table_name_45 (
race_1 INTEGER,
race_3 VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many race 1's have 5 as the race 3, with points less than 59?
| SELECT SUM(race_1) FROM table_name_45 WHERE race_3 = "5" AND points < 59 | sql_create_context |
CREATE TABLE table_16669 (
"Rd." real,
"Grand Prix" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ... | SELECT "Pole Position" FROM table_16669 WHERE "Grand Prix" = 'German Grand Prix' | wikisql |
CREATE TABLE table_46538 (
"Name" text,
"Country" text,
"Loan Club" text,
"Started" text,
"Ended" text,
"Start Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country named feeney with a bbc sport start source?
| SELECT "Country" FROM table_46538 WHERE "Start Source" = 'bbc sport' AND "Name" = 'feeney' | wikisql |
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_... | SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY Document_Type_Code | nvbench |
CREATE TABLE table_1329532_2 (
date_of_election VARCHAR,
appointed_successor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the election date for H. Brent Coles?
| SELECT date_of_election FROM table_1329532_2 WHERE appointed_successor = "H. Brent Coles" | sql_create_context |
CREATE TABLE table_20134 (
"Condition" text,
"Prothrombin time" text,
"Partial thromboplastin time" text,
"Bleeding time" text,
"Platelet count" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which condition(s) is bleeding time prolonged and prot... | SELECT "Condition" FROM table_20134 WHERE "Bleeding time" = 'Prolonged' AND "Prothrombin time" = 'Unaffected' | 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 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 WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "SYNCOPE;TELEMETRY" | mimicsql_data |
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 wdmzjzjlb.JZZDBM, wdmzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '赵怡宁' UNION SELECT bdmzjzjlb.JZZDBM, bdmzjzjlb.JZZDSM FROM person_info JOIN... | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year < "2158.0" | mimicsql_data |
CREATE TABLE table_69808 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the competition that has a score of 2-0?
| SELECT "Competition" FROM table_69808 WHERE "Score" = '2-0' | wikisql |
CREATE TABLE furniture (
Furniture_ID int,
Name text,
Num_of_Component int,
Market_Rate real
)
CREATE TABLE furniture_manufacte (
Manufacturer_ID int,
Furniture_ID int,
Price_in_Dollar real
)
CREATE TABLE manufacturer (
Manufacturer_ID int,
Open_Year real,
Name text,
Num_of... | SELECT Name, Price_in_Dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID ORDER BY Name | nvbench |
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,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Annette Masson%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id ... | advising |
CREATE TABLE table_49856 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of To par for Lee Trevino?
| SELECT COUNT("To par") FROM table_49856 WHERE "Player" = 'lee trevino' | wikisql |
CREATE TABLE gwyjzb (
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 SUM(t_kc24.MED_AMOUT) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '7756841' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-06-17' AND '2018-12-02' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE f... | css |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
... | SELECT rate.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS Rank, rate.Rate AS Questions FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate > DATEADD(Month, -1, GETDATE()) AND TagName IN ('angularjs', 'ember.j... | sede |
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name... | SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY facility_code | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.admityear < "2155" | mimicsql_data |
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 demographic.days_stay, demographic.admission_location FROM demographic WHERE demographic.name = "Troy Friedman" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Therapeutic drug monitor" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_name_11 (
paper_type VARCHAR,
first_day_cover_cancellation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Paper Type with a First Day Cover Cancellation with ottawa, on?
| SELECT paper_type FROM table_name_11 WHERE first_day_cover_cancellation = "ottawa, on" | sql_create_context |
CREATE TABLE table_25265 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For week number of the top 40, what was the results?
| SELECT "Result" FROM table_25265 WHERE "Week #" = 'Top 40' | wikisql |
CREATE TABLE table_name_99 (
result VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result where the opponent is Columbus Destroyers?
| SELECT result FROM table_name_99 WHERE opponent = "columbus destroyers" | sql_create_context |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE ref_detention_type (
detention_type_code text,
detention_type_description text
)
CREATE TABLE student_addresses (
student_id number,
address_id number,
date_address_from time,
date_address_to time,
monthly_rental number,
other_details text
)
CREATE TABLE behavior_incident ... | SELECT first_name FROM teachers WHERE email_address LIKE '%man%' | spider |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),... | SELECT EMPLOYEE_ID, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_name_19 (
time_retired VARCHAR,
laps VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time/retired with 60 laps and a grid 19?
| SELECT time_retired FROM table_name_19 WHERE laps = 60 AND grid = 19 | sql_create_context |
CREATE TABLE table_26525 (
"Episode" real,
"Contest" text,
"Original airdate" text,
"Challengers (Female)" text,
"Challengers (Male)" text,
"Events" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what episode did heat 1 take place?
| SELECT "Episode" FROM table_26525 WHERE "Contest" = 'Heat 1' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY SUM(Revenue) DESC | nvbench |
CREATE TABLE table_256286_19 (
passed VARCHAR,
no_votes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the passing result for the measure with 61307 no votes?
| SELECT passed FROM table_256286_19 WHERE no_votes = 61307 | sql_create_context |
CREATE TABLE table_28286 (
"Year" real,
"Population" real,
"Total" real,
"Violent" real,
"Property Crimes" real,
"Forcible rape" real,
"Robbery" real,
"Aggravated assault" real,
"Burglary" real,
"Larceny Theft" real,
"Vehicle Theft" real
)
-- Using valid SQLite, answer the ... | SELECT COUNT("Vehicle Theft") FROM table_28286 WHERE "Population" = '4465430' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-9230' AND patient.hospitaldischargetime IS N... | eicu |
CREATE TABLE table_19055 (
"Call sign" text,
"Frequency MHz" text,
"City of license" text,
"ERP W" real,
"Height m ( ft )" text,
"FCC info" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the fcc info with call sign being... | SELECT "FCC info" FROM table_19055 WHERE "Call sign" = 'W221AW' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "51889" | mimicsql_data |
CREATE TABLE table_name_84 (
designation VARCHAR,
quantity VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Designation has a Quantity of 52?
| SELECT designation FROM table_name_84 WHERE quantity = 52 | sql_create_context |
CREATE TABLE table_name_94 (
case_suffix__case_ VARCHAR,
postposition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Case Suffix (Case), when Postposition is '-mde (drops d)'?
| SELECT case_suffix__case_ FROM table_name_94 WHERE postposition = "-mde (drops d)" | sql_create_context |
CREATE TABLE broadcast_share (
Channel_ID int,
Program_ID int,
Date text,
Share_in_percent real
)
CREATE TABLE broadcast (
Channel_ID int,
Program_ID int,
Time_of_day text
)
CREATE TABLE channel (
Channel_ID int,
Name text,
Owner text,
Share_in_percent real,
Rating_in_p... | SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE DATETIME(microlab.culturetakentime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5 | eicu |
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 DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE | nvbench |
CREATE TABLE table_53713 (
"engine name" text,
"engine code(s)" text,
"valvetrain" text,
"displacement" text,
"max. power at rpm" text,
"max. torque at rpm" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum torque at rpm for the... | SELECT "max. torque at rpm" FROM table_53713 WHERE "engine code(s)" = 'bmm' | wikisql |
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '40200914' AND t_kc22.STA_DATE BETWEEN '2007-11-20' AND '2017-11-08' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE artist (
Ar... | SELECT Category, COUNT(*) FROM music_festival GROUP BY Category ORDER BY COUNT(*) | nvbench |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "56" AND prescriptions.formulary_drug_cd = "SW100MLG" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "GASTROINTESTINAL BLEED" AND demographic.days_stay = "17" | mimicsql_data |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby i... | SELECT DISTINCT paperkeyphrase.paperid FROM keyphrase, paperkeyphrase WHERE keyphrase.keyphrasename IN ('Multiuser Receiver', 'Decision Feedback') GROUP BY paperkeyphrase.paperid HAVING COUNT(DISTINCT keyphrase.keyphraseid) = 1 | scholar |
CREATE TABLE table_77931 (
"String" text,
"Scientific pitch" text,
"Helmholtz pitch" text,
"Interval from middle C" text,
"Frequency ( Hz )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the scientific pitch when the Helmholtz pitch is D?
| SELECT "Scientific pitch" FROM table_77931 WHERE "Helmholtz pitch" = 'd' | wikisql |
CREATE TABLE table_326 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT "Title" FROM table_326 WHERE "Written by" = 'John A. Norris' | wikisql |
CREATE TABLE table_204_799 (
id number,
"name" text,
"built" text,
"listed" text,
"location" text,
"county" text,
"type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which of these bridges was the first one built ?
| SELECT "name" FROM table_204_799 ORDER BY "built" LIMIT 1 | squall |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "76525" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_28820 (
"Hydrographic Basin" text,
"Surface Area (km 2 )" real,
"Rainfall totals (million m 3 )" real,
"Evapotranspiration (million m 3 )" real,
"Surface water runoff (million m 3 )" real,
"Groundwater discharge (million m 3 )" real
)
-- Using valid SQLite, answer the follow... | SELECT "Rainfall totals (million m 3 )" FROM table_28820 WHERE "Hydrographic Basin" = 'Martha Brae, River' | wikisql |
CREATE TABLE table_203_782 (
id number,
"year" number,
"actor" text,
"award" text,
"category" text,
"role" text,
"episode" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of wins for hank azaria ?
| SELECT COUNT(*) FROM table_203_782 WHERE "actor" = 'hank azaria' AND "result" = 'won' | squall |
CREATE TABLE table_name_62 (
record VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the record when the attendance was 28,531?
| SELECT record FROM table_name_62 WHERE attendance = "28,531" | sql_create_context |
CREATE TABLE table_76988 (
"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 To par of the 4 Place Player?
| SELECT "To par" FROM table_76988 WHERE "Place" = '4' | wikisql |
CREATE TABLE table_69742 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is Home of chicago black hawks has a Record of 0 1?
| SELECT "Date" FROM table_69742 WHERE "Home" = 'chicago black hawks' AND "Record" = '0–1' | wikisql |
CREATE TABLE table_name_41 (
location VARCHAR,
wrestler VARCHAR,
reign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did the wrestler, super parka, with the title with a reign of 2?
| SELECT location FROM table_name_41 WHERE wrestler = "super parka" AND reign = "2" | sql_create_context |
CREATE TABLE table_26394 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title of the e... | SELECT "Title" FROM table_26394 WHERE "Directed by" = 'Rowan Woods' | wikisql |
CREATE TABLE table_2895 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did they play the Florida Panthers?
| SELECT "Date" FROM table_2895 WHERE "Opponent" = 'Florida Panthers' | wikisql |
CREATE TABLE table_name_35 (
manufacturer VARCHAR,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which manufacturer has a Time/Retired of +15.665?
| SELECT manufacturer FROM table_name_35 WHERE time_retired = "+15.665" | sql_create_context |
CREATE TABLE table_18775 (
"Serial & Branch" real,
"Seaman" text,
"Mechanical" text,
"Secretariat" text,
"Supply" text,
"Electrical" text,
"Radio Electrical" text,
"Regulating" text,
"Medical" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT COUNT("Serial & Branch") FROM table_18775 WHERE "Radio Electrical" = 'Hon S Lt(R)' | wikisql |
CREATE TABLE entrepreneur (
Company VARCHAR,
Investor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the companies and the investors of entrepreneurs.
| SELECT Company, Investor FROM entrepreneur | sql_create_context |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number ... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... | advising |
CREATE TABLE table_57948 (
"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.
-- On the match where the away team scored 16.16 (1... | SELECT AVG("Crowd") FROM table_57948 WHERE "Away team score" = '16.16 (112)' | wikisql |
CREATE TABLE table_20722 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Area" text,
"Population" real,
"Density" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the traditional for population 74779
| SELECT "Traditional" FROM table_20722 WHERE "Population" = '74779' | wikisql |
CREATE TABLE table_name_61 (
team VARCHAR,
points_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team has 102 Points against?
| SELECT team FROM table_name_61 WHERE points_against = "102" | sql_create_context |
CREATE TABLE table_2668378_13 (
candidates VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was running in the section pennsylvania 5
| SELECT candidates FROM table_2668378_13 WHERE district = "Pennsylvania 5" | sql_create_context |
CREATE TABLE table_18826 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the follo... | SELECT "Club" FROM table_18826 WHERE "Tries for" = '83' | wikisql |
CREATE TABLE table_23256 (
"School" text,
"Baseball stadium" text,
"Softball stadium" text,
"Basketball arena" text,
"Capacity" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many basketball arenas are there that belong to a school with a capaci... | SELECT COUNT("Basketball arena") FROM table_23256 WHERE "Capacity" = '3,000' | wikisql |
CREATE TABLE customers (
id INTEGER,
first_name VARCHAR(40),
last_name VARCHAR(20),
company VARCHAR(80),
address VARCHAR(70),
city VARCHAR(40),
state VARCHAR(40),
country VARCHAR(40),
postal_code VARCHAR(10),
phone VARCHAR(24),
fax VARCHAR(24),
email VARCHAR(60),
supp... | SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state | nvbench |
CREATE TABLE table_19632 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Packers points" real,
"Opponents" real,
"First Downs" real,
"Record" text,
"Streak" text,
"Venue" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the ta... | SELECT "Venue" FROM table_19632 WHERE "Opponents" = '51' | wikisql |
CREATE TABLE tryout (
cName VARCHAR,
decision VARCHAR
)
CREATE TABLE college (
state VARCHAR,
enr VARCHAR,
cName VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the state and enrollment of the colleges where have any students who got acce... | SELECT DISTINCT T1.state, T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' | sql_create_context |
CREATE TABLE table_1512 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What draft pick was Chris Brewer?
| SELECT MIN("Pick #") FROM table_1512 WHERE "Player" = 'Chris Brewer' | wikisql |
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 MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc21 WHERE MED_CLINIC_ID = '09914835736' | css |
CREATE TABLE table_12104319_1 (
mens_singles VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mens singles of 2008?
| SELECT mens_singles FROM table_12104319_1 WHERE year = 2008 | sql_create_context |
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults... | SELECT adults FROM reservations WHERE checkin = "2010-10-23" AND firstname = "CONRAD" AND lastname = "SELBIG" | spider |
CREATE TABLE table_79437 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- From what school was the linebacker that had a pick less than 245 and was drafted in round 6?
| SELECT "School" FROM table_79437 WHERE "Position" = 'linebacker' AND "Pick" < '245' AND "Round" = '6' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT demographic.dischtime FROM demographic WHERE demographic.name = "Caren Obrien" | mimicsql_data |
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.insurance = "Private" AND procedures.short_title = "Attach pedicle graft NEC" | mimicsql_data |
CREATE TABLE table_26733129_1 (
musical_performance VARCHAR,
air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What musical performances aired on 5 April 2010?
| SELECT musical_performance FROM table_26733129_1 WHERE air_date = "5 April 2010" | sql_create_context |
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 Score, COUNT(Score) AS Number FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '<##Tag##>' GROUP BY Score ORDER BY Score | sede |
CREATE TABLE Invoices (
Invoice_ID INTEGER,
Order_ID INTEGER,
payment_method_code CHAR(15),
Product_ID INTEGER,
Order_Quantity VARCHAR(288),
Other_Item_Details VARCHAR(255),
Order_Item_ID INTEGER
)
CREATE TABLE Invoice_Items (
Invoice_Item_ID INTEGER,
Invoice_ID INTEGER,
Order_I... | SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Bookings ORDER BY Actual_Delivery_Date | nvbench |
CREATE TABLE table_37140 (
"Year [A ]" real,
"Pick" text,
"Player name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was a linebacker at Tennessee?
| SELECT "Player name" FROM table_37140 WHERE "Position" = 'linebacker' AND "College" = 'tennessee' | wikisql |
CREATE TABLE table_name_58 (
hand VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What does full house have as a 5 credits?
| SELECT 5 AS _credits FROM table_name_58 WHERE hand = "full house" | sql_create_context |
CREATE TABLE table_name_95 (
replaced_by VARCHAR,
outgoing_manager VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of Replaced has a Outgoing manager of guillermo sanguinetti?
| SELECT replaced_by FROM table_name_95 WHERE outgoing_manager = "guillermo sanguinetti" | sql_create_context |
CREATE TABLE table_35188 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team did carlos cardus drive for in 1983 when he got less than 21 points?
| SELECT "Team" FROM table_35188 WHERE "Points" < '21' AND "Year" = '1983' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,
... | SELECT SG, TZ, TW, SSY, SZY, XL, HXPLC, ML FROM mzjzjlb WHERE JZLSH = '28831691932' | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.