instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | SELECT DISTINCT city.city_code FROM airport, airport_service, city WHERE airport.airport_code = 'MCO' AND airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code | atis |
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, Num_of_Component FROM furniture WHERE Num_of_Component > 10 ORDER BY Name | nvbench |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CR... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61003 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY procedures_icd.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_64958 (
"Year" real,
"League Champion" text,
"Best Blocker" text,
"Rookie of the Year" text,
"C.A.N.T.S.L.E.E.P. Award" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the rookie of the year for the year that had the Brookl... | SELECT "Rookie of the Year" FROM table_64958 WHERE "League Champion" = 'brooklyn bombshells' | wikisql |
CREATE TABLE table_40427 (
"Season" text,
"Conference" text,
"Division" text,
"Finish" text,
"Wins" text,
"Losses" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Conference for the 1967 68 season?
| SELECT "Conference" FROM table_40427 WHERE "Season" = '1967–68' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicatio... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'tracheal suctioning' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') AS t1 JOIN (SELECT patient.uniqu... | eicu |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE gsi (
c... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | advising |
CREATE TABLE table_name_72 (
name VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is at rank 9?
| SELECT name FROM table_name_72 WHERE rank = 9 | sql_create_context |
CREATE TABLE table_name_18 (
runner_up VARCHAR,
third_place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the runner up when yevgeny kafelnikov was third place and the score was 3 6, 6 4, [10 3]?
| SELECT runner_up FROM table_name_18 WHERE third_place = "yevgeny kafelnikov" AND score = "3–6, 6–4, [10–3]" | sql_create_context |
CREATE TABLE table_204_575 (
id number,
"place" number,
"position" text,
"number" number,
"name" text,
"league one" number,
"fa cup" number,
"league cup" number,
"football league trophy" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT "name" FROM table_204_575 WHERE id = (SELECT id FROM table_204_575 WHERE "name" = 'jon taylor') + 1 | squall |
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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Milk of Magnesia" | mimicsql_data |
CREATE TABLE gas_station (
station_id number,
open_year number,
location text,
manager_name text,
vice_manager_name text,
representative_name text
)
CREATE TABLE station_company (
station_id number,
company_id number,
rank_of_the_year number
)
CREATE TABLE company (
company_id ... | SELECT location, COUNT(*) FROM gas_station GROUP BY location ORDER BY COUNT(*) | spider |
CREATE TABLE table_14989 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many deciles have an Authority of state and a Name of chertsey schoo... | SELECT COUNT("Decile") FROM table_14989 WHERE "Authority" = 'state' AND "Name" = 'chertsey school' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM ... | SELECT mzjzjlb.JZKSRQ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '26180794898' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ISOS10" | mimicsql_data |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimme... | SELECT meter_600, ID FROM swimmer ORDER BY ID DESC | nvbench |
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 DATE(CreationDate), COUNT(DATE(CreationDate)) FROM Posts WHERE PostTypeId = 1 GROUP BY DATE(CreationDate) ORDER BY DATE(CreationDate) | sede |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road | 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 instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester... | advising |
CREATE TABLE Electoral_Register (
electoral_register_id INTEGER,
cmi_cross_ref_id INTEGER
)
CREATE TABLE Parking_Fines (
council_tax_id INTEGER,
cmi_cross_ref_id INTEGER
)
CREATE TABLE CMI_Cross_References (
cmi_cross_ref_id INTEGER,
master_customer_id INTEGER,
source_system_code CHAR(15)
... | SELECT cmi_details, COUNT(cmi_details) FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax' GROUP BY cmi_details ORDER BY COUNT(cmi_details) | nvbench |
CREATE TABLE table_19900792_1 (
birth_date VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was Alexey Kuleshov born?
| SELECT birth_date FROM table_19900792_1 WHERE player = "Alexey Kuleshov" | sql_create_context |
CREATE TABLE table_15346009_1 (
date VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day did Bernhard Langer (2) win?
| SELECT date FROM table_15346009_1 WHERE winner = "Bernhard Langer (2)" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE R... | SELECT DownVotes FROM Users WHERE Id = @UserId | sede |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
air... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food... | atis |
CREATE TABLE table_66974 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the runner(s)-up for the Feb 18, 1996 tournament?
| SELECT "Runner(s)-up" FROM table_66974 WHERE "Date" = 'feb 18, 1996' | wikisql |
CREATE TABLE table_62078 (
"Companion (in order from star)" text,
"Mass" text,
"Semimajor axis ( AU )" text,
"Orbital period ( s day )" text,
"Eccentricity" text,
"Inclination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Companion (in or... | SELECT "Companion (in order from star)" FROM table_62078 WHERE "Semimajor axis ( AU )" = '0.1886 +0.083 −0.0104' | wikisql |
CREATE TABLE table_name_69 (
opponent VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent at the game with a result of w 20-17?
| SELECT opponent FROM table_name_69 WHERE result = "w 20-17" | sql_create_context |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND fare_basis.economy = 'YES' AND fare.fare_basis... | atis |
CREATE TABLE table_39911 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Home with a Time that is 12:00?
| SELECT "Home" FROM table_39911 WHERE "Time" = '12:00' | wikisql |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varcha... | SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE | nvbench |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description... | SELECT p.OwnerUserId AS "user_link", COUNT(p.Id) AS Acceptances FROM Posts AS p WHERE NOT p.AcceptedAnswerId IS NULL GROUP BY p.OwnerUserId HAVING COUNT(p.Id) >= '##acceptances##' ORDER BY COUNT(p.Id) DESC | sede |
CREATE TABLE table_21436373_5 (
date_year VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date/s has attendance been 45010?
| SELECT date_year FROM table_21436373_5 WHERE attendance = 45010 | sql_create_context |
CREATE TABLE table_2869837_1 (
runners_up VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the number of runners up for Royal School Dungannon?
| SELECT runners_up FROM table_2869837_1 WHERE school = "Royal school Dungannon" | sql_create_context |
CREATE TABLE table_1341663_44 (
result VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the result when the incumbent was george h. mahon
| SELECT result FROM table_1341663_44 WHERE incumbent = "George H. Mahon" | sql_create_context |
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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'glucose - d10w' AND STRFTIME('%y', treatment.treatmenttime) <= '2101') GROUP BY patient.uniquepid) AS t1 W... | eicu |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_name_45 (
name VARCHAR,
position VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the cornerback from Wisconsin college?
| SELECT name FROM table_name_45 WHERE position = "cornerback" AND college = "wisconsin" | sql_create_context |
CREATE TABLE table_64473 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the September 21, 1980 game?
| SELECT AVG("Attendance") FROM table_64473 WHERE "Date" = 'september 21, 1980' | wikisql |
CREATE TABLE laptimes (
raceid number,
driverid number,
lap number,
position number,
time text,
milliseconds number
)
CREATE TABLE driverstandings (
driverstandingsid number,
raceid number,
driverid number,
points number,
position number,
positiontext text,
wins numb... | SELECT MAX(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix" | spider |
CREATE TABLE table_48050 (
"Month" text,
"Births" text,
"Deaths" text,
"Rate (%)" text,
"Sort restore" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of sort values associated with 389 births?
| SELECT COUNT("Sort restore") FROM table_48050 WHERE "Births" = '389' | wikisql |
CREATE TABLE table_204_883 (
id number,
"pos." text,
"name" text,
"place of birth" text,
"date of birth" text,
"previous club" text,
"date joined" text,
"fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which team was ray price on bef... | SELECT "previous club" FROM table_204_883 WHERE "name" = 'ray price' | squall |
CREATE TABLE table_11677691_4 (
player VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player's hometown was Pewaukee, Wisconsin?
| SELECT player FROM table_11677691_4 WHERE hometown = "Pewaukee, Wisconsin" | sql_create_context |
CREATE TABLE table_48195 (
"Test flight" text,
"Date" text,
"Speed" text,
"Altitude" text,
"Crew" text,
"Duration" text,
"Comment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Date, when Comment is Tailcone On, Lakebed Landing, and... | SELECT "Date" FROM table_48195 WHERE "Comment" = 'tailcone on, lakebed landing' AND "Duration" = '5min 34 s' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT COUNT(*) FROM t_kc21 WHERE PERSON_ID = '62013127' AND IN_HOSP_DATE BETWEEN '2000-03-07' AND '2015-06-01' AND CLINIC_TYPE = '住院' | css |
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 jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '44774327755' | css |
CREATE TABLE table_77449 (
"Game" text,
"Date" text,
"Opponent" text,
"Result" text,
"Dolphins' points" text,
"Opponents' Points" text,
"Record" text,
"Streak" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is... | SELECT "Streak" FROM table_77449 WHERE "Game" = '2' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | 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 = 'digoxin' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME()... | eicu |
CREATE TABLE table_79792 (
"Nation" text,
"Winners" real,
"Runners-up" real,
"3rd Place" real,
"4th Place" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average 3rd place with winners of 0, 4th place of 0 and nation of pahang fa
| SELECT AVG("3rd Place") FROM table_79792 WHERE "Winners" = '0' AND "4th Place" = '0' AND "Nation" = 'pahang fa' | wikisql |
CREATE TABLE table_4709 (
"Tournament" text,
"1943" text,
"1944" text,
"1945" text,
"1948" text,
"1949" text,
"1951" text,
"1954" text,
"1956\u20131968" text,
"1969" text,
"Career SR" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "1956\u20131968" FROM table_4709 WHERE "1969" = 'qf' | wikisql |
CREATE TABLE gyb (
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.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '孙永安' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 6580.96) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '孙永安' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT... | css |
CREATE TABLE table_36554 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what AAAAA class has the school year of 1990-91?
| SELECT "Class AAAAA" FROM table_36554 WHERE "School Year" = '1990-91' | wikisql |
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 diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "E9301" | mimicsql_data |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | SELECT zyjybgb.BGDH FROM zyjybgb WHERE zyjybgb.JZLSH = '05667360222' AND NOT zyjybgb.KSMC LIKE '%皮肤科%' UNION SELECT mzjybgb.BGDH FROM mzjybgb WHERE mzjybgb.JZLSH = '05667360222' AND NOT mzjybgb.KSMC LIKE '%皮肤科%' | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE d... | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... | eicu |
CREATE TABLE table_name_63 (
tournament VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Tournament was against Daniel Elsner?
| SELECT tournament FROM table_name_63 WHERE opponent = "daniel elsner" | sql_create_context |
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Nu... | SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Dates_active DESC | nvbench |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
chartt... | SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'trauma com... | mimic_iii |
CREATE TABLE table_21469 (
"Athlete" text,
"Event" text,
"Round of 64" text,
"Round of 32" text,
"Round of 16" text,
"Quarterfinals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the quarterfinals in the round of 32 was S williams / V... | SELECT "Quarterfinals" FROM table_21469 WHERE "Round of 32" = 'S Williams / V Williams ( USA ) L 6–4, 5–7, 1–6' | wikisql |
CREATE TABLE table_name_35 (
to_par VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the To par of the Player with a Score of 73-70-71-72=286?
| SELECT to_par FROM table_name_35 WHERE score = 73 - 70 - 71 - 72 = 286 | sql_create_context |
CREATE TABLE table_31713 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the opponent of week 14
| SELECT "Opponent" FROM table_31713 WHERE "Week" = '14' | wikisql |
CREATE TABLE table_name_52 (
name VARCHAR,
date_of_reclassification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Whose Name has a Date of reclassification of 2003-04-01 (merge into shizuoka )?
| SELECT name FROM table_name_52 WHERE date_of_reclassification = "2003-04-01 (merge into shizuoka )" | sql_create_context |
CREATE TABLE table_21955 (
"Country / Region" text,
"Name" text,
"Host(s)" text,
"Channel" text,
"Premiere / Aired" text,
"Seasons" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many seasons did the show run in Poland?
| SELECT "Seasons" FROM table_21955 WHERE "Country / Region" = 'Poland' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
... | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006... | eicu |
CREATE TABLE pilot (
Pilot_Id int(11),
Name varchar(50),
Age int(11)
)
CREATE TABLE aircraft (
Aircraft_ID int(11),
Aircraft varchar(50),
Description varchar(50),
Max_Gross_Weight varchar(50),
Total_disk_area varchar(50),
Max_disk_Loading varchar(50)
)
CREATE TABLE airport_aircraft... | SELECT Aircraft, COUNT(Aircraft) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY Aircraft | nvbench |
CREATE TABLE table_1341663_33 (
first_elected INTEGER,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was Stephen J. Solarz first elected?
| SELECT MIN(first_elected) FROM table_1341663_33 WHERE incumbent = "Stephen J. Solarz" | sql_create_context |
CREATE TABLE list (
classroom VARCHAR,
grade VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For each grade 0 classroom, report the total number of students.
| SELECT classroom, COUNT(*) FROM list WHERE grade = "0" GROUP BY classroom | sql_create_context |
CREATE TABLE table_16330 (
"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 a... | SELECT MAX("No. in season") FROM table_16330 WHERE "Production code" = 'E4423' | 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 T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue DESC | nvbench |
CREATE TABLE table_204_177 (
id number,
"player" text,
"years played" text,
"total w-l" text,
"singles w-l" text,
"doubles w-l" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many players went 0-1 in total w l ?
| SELECT COUNT("player") FROM table_204_177 WHERE "total w-l" = '0-1' | squall |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE table_25244 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Average Speed (mph)" FROM table_25244 WHERE "Year" = '1964' | wikisql |
CREATE TABLE table_name_90 (
title VARCHAR,
notes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which title had Notes of 8 episodes?
| SELECT title FROM table_name_90 WHERE notes = "8 episodes" | sql_create_context |
CREATE TABLE table_52397 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the total number of Grid for Bob Evans and Laps less than 68
| SELECT COUNT("Grid") FROM table_52397 WHERE "Driver" = 'bob evans' AND "Laps" < '68' | wikisql |
CREATE TABLE table_204_785 (
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.
-- did peru win more or less gold medals than chile ?
| SELECT (SELECT "gold" FROM table_204_785 WHERE "nation" = 'peru') > (SELECT "gold" FROM table_204_785 WHERE "nation" = 'chile') | squall |
CREATE TABLE table_23757 (
"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.
-- What is the status of platelet counts for conditions wher... | SELECT "Platelet count" FROM table_23757 WHERE "Bleeding time" = 'Prolonged' AND "Partial thromboplastin time" = 'Unaffected' | wikisql |
CREATE TABLE table_name_90 (
general_classification VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the General classification when Pascal Richard was the winner?
| SELECT general_classification FROM table_name_90 WHERE winner = "pascal richard" | sql_create_context |
CREATE TABLE table_54558 (
"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 is the Crowd number for the Away team whose... | SELECT SUM("Crowd") FROM table_54558 WHERE "Away team score" = '14.18 (102)' | wikisql |
CREATE TABLE table_203_359 (
id number,
"outcome" text,
"year" number,
"championship" text,
"surface" text,
"opponent" text,
"score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times was the championship in miami ?
| SELECT COUNT(*) FROM table_203_359 WHERE "championship" = 'miami' | 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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Calculus of bile duct without mention of cholecystitis, without mention of obstruction" | mimicsql_data |
CREATE TABLE order_items (
order_item_id number,
order_id number,
product_id number,
product_quantity text,
other_order_item_details text
)
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_middle_initial text,
customer_last_name text,
gender text,
... | SELECT T2.product_name, SUM(T1.product_quantity) FROM order_items AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name | spider |
CREATE TABLE table_65891 (
"Year" real,
"Class" text,
"Team" text,
"Machine" text,
"Points" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the class that team Honda Britain was in with points higher than 0?
| SELECT "Class" FROM table_65891 WHERE "Team" = 'honda britain' AND "Points" > '0' | wikisql |
CREATE TABLE table_name_73 (
airing_date VARCHAR,
number_of_episodes VARCHAR,
genre VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the airing date when the number of episodes was larger than 20 and had the genre of costume action?
| SELECT airing_date FROM table_name_73 WHERE number_of_episodes > 20 AND genre = "costume action" | sql_create_context |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_zone (
time_zone_code tex... | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = '72S' | atis |
CREATE TABLE table_4220 (
"Seed" real,
"Rank" real,
"Player" text,
"Points" real,
"Points defending" real,
"Points won" real,
"New points" real,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the status for seed 14
| SELECT "Status" FROM table_4220 WHERE "Seed" = '14' | wikisql |
CREATE TABLE table_69406 (
"Distance" text,
"Time" text,
"Date" text,
"Location" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Hein Vergeer have a distance of 5,000m?
| SELECT "Date" FROM table_69406 WHERE "Distance" = '5,000m' | wikisql |
CREATE TABLE table_name_26 (
episodes__tv VARCHAR,
extra__2 VARCHAR,
broadcasts__tv__1 VARCHAR,
directors VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Episodes (TV+extra) 2, when Broadcasts (TV) 1 is less than 13, and when Directors is 'Shi... | SELECT episodes__tv + extra__2 FROM table_name_26 WHERE broadcasts__tv__1 < 13 AND directors = "shigehito takayanagi" | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Votes (
Id number,
PostId number,
... | SELECT TIME_TO_STR(CreationDate, '%W'), COUNT(Id) FROM Posts AS P WHERE P.PostTypeId = 1 GROUP BY TIME_TO_STR(CreationDate, '%W') ORDER BY TIME_TO_STR(CreationDate, '%W') | sede |
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 mzjzjlb JOIN jybgb JOIN 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.person_i... | css |
CREATE TABLE ftxmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.JZKSBM = '310' AND txmzjzjlb.JZKSRQ BETWEEN '2000-11-09' AND '2015-03-17' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZKSBM = '310' AND ftxmzjzjlb.JZKSRQ BETWEEN '2000-11-09' AND '2015-03-17' | css |
CREATE TABLE table_name_64 (
against INTEGER,
status VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average against for a test match?
| SELECT AVG(against) FROM table_name_64 WHERE status = "test match" | sql_create_context |
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE enroll (
class_code text,
stu_n... | SELECT T2.emp_fname, T1.crs_code FROM class AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num | spider |
CREATE TABLE table_14928423_1 (
result VARCHAR,
original_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- is nominated for anything?
| SELECT result FROM table_14928423_1 WHERE original_title = "Γолемата Вода" | sql_create_context |
CREATE TABLE table_66544 (
"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 date where the result was L 27-10 in a week before week 9?
| SELECT "Date" FROM table_66544 WHERE "Week" < '9' AND "Result" = 'l 27-10' | 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 AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_SER_ORG_NO = '体检科' AND zyb.IN_HOSP_DAYS BETWEEN '2011-06-26' AND '2012-02-08' AND zyb.IN_HOSP_DATE = '腔隙性脑梗死' | css |
CREATE TABLE table_38219 (
"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 score of the match with a 4-0 result?
| SELECT "Score" FROM table_38219 WHERE "Result" = '4-0' | wikisql |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
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,
g... | SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ORALHEAL' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE table_name_30 (
rider VARCHAR,
grid VARCHAR,
time VARCHAR,
laps VARCHAR,
manufacturer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the rider who had less than 30 laps, ended in an accident with a car manufactured by yamaha ... | SELECT rider FROM table_name_30 WHERE laps < 30 AND manufacturer = "yamaha" AND time = "accident" AND grid > 3 | sql_create_context |
CREATE TABLE table_59494 (
"Name" text,
"Residence" text,
"Party" text,
"Years in Assembly" text,
"Years in Senate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During what years was Christine Kehoe in Assembly?
| SELECT "Years in Assembly" FROM table_59494 WHERE "Name" = 'christine kehoe' | 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 IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '5333311' GROUP BY IN_DIAG_DIS_CD | css |
CREATE TABLE table_1744 (
"Official Name" text,
"Status" text,
"Area km 2" text,
"Population" real,
"Census Ranking" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the census ranking for the Perth parish?
| SELECT "Census Ranking" FROM table_1744 WHERE "Official Name" = 'Perth' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.