instruction
stringlengths 20
309
| input
stringlengths 45
7.14k
| response
stringlengths 24
2.22k
| source
stringclasses 15
values | text
stringlengths 337
7.52k
|
---|---|---|---|---|
Which highest overall figure had Robert Alford as a name and a round of more than 2? | CREATE TABLE table_name_89 (
overall INTEGER,
name VARCHAR,
round VARCHAR
) | SELECT MAX(overall) FROM table_name_89 WHERE name = "robert alford" AND round > 2 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which highest overall figure had Robert Alford as a name and a round of more than 2? ### Input: CREATE TABLE table_name_89 (
overall INTEGER,
name VARCHAR,
round VARCHAR
) ### Response: SELECT MAX(overall) FROM table_name_89 WHERE name = "robert alford" AND round > 2 |
Name the total number of points for newell's old boys | CREATE TABLE table_17968282_1 (
points VARCHAR,
team VARCHAR
) | SELECT COUNT(points) FROM table_17968282_1 WHERE team = "Newell's Old Boys" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total number of points for newell's old boys ### Input: CREATE TABLE table_17968282_1 (
points VARCHAR,
team VARCHAR
) ### Response: SELECT COUNT(points) FROM table_17968282_1 WHERE team = "Newell's Old Boys" |
May I sign up for 100 -level classes in Spring or Summer term ? | CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE area (
course_id int,
area 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,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
) | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN (DERIVED_TABLEalias0.course_id) AND NOT COURSEalias0.course_id IN (SELECT DISTINCT COURSE_PREREQUISITEalias0.course_id FROM course_prerequisite AS COURSE_PREREQUISITEalias0 WHERE NOT COURSE_PREREQUISITEalias0.pre_course_id IN (DERIVED_TABLEalias0.course_id)) AND COURSEalias0.department = 'EECS' AND COURSEalias0.number BETWEEN 100 AND 100 + 100 AND SEMESTERalias0.semester IN ('SP', 'SS', 'SU') AND SEMESTERalias0.semester_id = COURSE_OFFERINGalias0.semester AND SEMESTERalias0.year = 2016 | advising | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: May I sign up for 100 -level classes in Spring or Summer term ? ### Input: CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE area (
course_id int,
area 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,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
) ### Response: SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN (DERIVED_TABLEalias0.course_id) AND NOT COURSEalias0.course_id IN (SELECT DISTINCT COURSE_PREREQUISITEalias0.course_id FROM course_prerequisite AS COURSE_PREREQUISITEalias0 WHERE NOT COURSE_PREREQUISITEalias0.pre_course_id IN (DERIVED_TABLEalias0.course_id)) AND COURSEalias0.department = 'EECS' AND COURSEalias0.number BETWEEN 100 AND 100 + 100 AND SEMESTERalias0.semester IN ('SP', 'SS', 'SU') AND SEMESTERalias0.semester_id = COURSE_OFFERINGalias0.semester AND SEMESTERalias0.year = 2016 |
What song was in french? | CREATE TABLE table_76347 (
"Draw" real,
"Language" text,
"Artist" text,
"Song" text,
"English translation" text,
"Place" real,
"Points" real
) | SELECT "Song" FROM table_76347 WHERE "Language" = 'french' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What song was in french? ### Input: CREATE TABLE table_76347 (
"Draw" real,
"Language" text,
"Artist" text,
"Song" text,
"English translation" text,
"Place" real,
"Points" real
) ### Response: SELECT "Song" FROM table_76347 WHERE "Language" = 'french' |
What's the name of the episode associated with Nick production number 342? | CREATE TABLE table_28767 (
"Season #" real,
"Series #" real,
"Episode title" text,
"Original air date" text,
"Nick prod. #" real
) | SELECT "Episode title" FROM table_28767 WHERE "Nick prod. #" = '342' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the name of the episode associated with Nick production number 342? ### Input: CREATE TABLE table_28767 (
"Season #" real,
"Series #" real,
"Episode title" text,
"Original air date" text,
"Nick prod. #" real
) ### Response: SELECT "Episode title" FROM table_28767 WHERE "Nick prod. #" = '342' |
What Leading scorer had a Score of 80 112? | CREATE TABLE table_name_98 (
leading_scorer VARCHAR,
score VARCHAR
) | SELECT leading_scorer FROM table_name_98 WHERE score = "80–112" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Leading scorer had a Score of 80 112? ### Input: CREATE TABLE table_name_98 (
leading_scorer VARCHAR,
score VARCHAR
) ### Response: SELECT leading_scorer FROM table_name_98 WHERE score = "80–112" |
was the value of patient 016-38131's bun last measured on the current hospital visit less than they were first measured on the current hospital visit? | 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 intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
) | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bun' ORDER BY lab.labresulttime DESC LIMIT 1) < (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bun' ORDER BY lab.labresulttime LIMIT 1) | eicu | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: was the value of patient 016-38131's bun last measured on the current hospital visit less than they were first measured on the current hospital visit? ### Input: 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 intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
) ### Response: SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bun' ORDER BY lab.labresulttime DESC LIMIT 1) < (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bun' ORDER BY lab.labresulttime LIMIT 1) |
What is on at 5pm on the channel where As the World Turns is on at 2pm? | CREATE TABLE table_61209 (
"7:00 am" text,
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"10:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"5:00 pm" text,
"6:30 pm" text
) | SELECT "5:00 pm" FROM table_61209 WHERE "2:00 pm" = 'as the world turns' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is on at 5pm on the channel where As the World Turns is on at 2pm? ### Input: CREATE TABLE table_61209 (
"7:00 am" text,
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"10:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"5:00 pm" text,
"6:30 pm" text
) ### Response: SELECT "5:00 pm" FROM table_61209 WHERE "2:00 pm" = 'as the world turns' |
Are there any sections of EECS 767 offered after 07:30 P.M. ? | 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 int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
) | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '07:30' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 767 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Are there any sections of EECS 767 offered after 07:30 P.M. ? ### Input: 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 int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
) ### Response: SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '07:30' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 767 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
Name the most interview for minnesota and average more than 7.901 | CREATE TABLE table_57084 (
"State" text,
"Interview" real,
"Swimsuit" real,
"Evening gown" real,
"Average" real
) | SELECT MAX("Interview") FROM table_57084 WHERE "State" = 'minnesota' AND "Average" > '7.901' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the most interview for minnesota and average more than 7.901 ### Input: CREATE TABLE table_57084 (
"State" text,
"Interview" real,
"Swimsuit" real,
"Evening gown" real,
"Average" real
) ### Response: SELECT MAX("Interview") FROM table_57084 WHERE "State" = 'minnesota' AND "Average" > '7.901' |
In the game where the Hornets were the home team and Clippers the visiting team, what is the score? | CREATE TABLE table_56666 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | SELECT "Score" FROM table_56666 WHERE "Home" = 'hornets' AND "Visitor" = 'clippers' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the game where the Hornets were the home team and Clippers the visiting team, what is the score? ### Input: CREATE TABLE table_56666 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) ### Response: SELECT "Score" FROM table_56666 WHERE "Home" = 'hornets' AND "Visitor" = 'clippers' |
Tag Usage - Presentation Frameworks. | CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
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 Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
) | SELECT t.TagName, COUNT(p.Id) AS Posts, SUM(CASE WHEN p.AnswerCount > 0 THEN 1 ELSE 0 END) AS Answered FROM Tags AS t INNER JOIN PostTags AS pta ON t.Id = pta.TagId INNER JOIN Posts AS p ON p.Id = pta.PostId AND p.PostTypeId = 1 WHERE t.TagName IN ('angular', 'ember.js', 'reactjs', 'vuejs2') GROUP BY t.TagName | sede | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tag Usage - Presentation Frameworks. ### Input: CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
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 Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
) ### Response: SELECT t.TagName, COUNT(p.Id) AS Posts, SUM(CASE WHEN p.AnswerCount > 0 THEN 1 ELSE 0 END) AS Answered FROM Tags AS t INNER JOIN PostTags AS pta ON t.Id = pta.TagId INNER JOIN Posts AS p ON p.Id = pta.PostId AND p.PostTypeId = 1 WHERE t.TagName IN ('angular', 'ember.js', 'reactjs', 'vuejs2') GROUP BY t.TagName |
What was the highest money when the score was 69-68-67-69=273? | CREATE TABLE table_62549 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | SELECT MAX("Money ( $ )") FROM table_62549 WHERE "Score" = '69-68-67-69=273' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the highest money when the score was 69-68-67-69=273? ### Input: CREATE TABLE table_62549 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) ### Response: SELECT MAX("Money ( $ )") FROM table_62549 WHERE "Score" = '69-68-67-69=273' |
Who were the opponents during week 14? | CREATE TABLE table_name_53 (
opponent VARCHAR,
week VARCHAR
) | SELECT opponent FROM table_name_53 WHERE week = 14 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who were the opponents during week 14? ### Input: CREATE TABLE table_name_53 (
opponent VARCHAR,
week VARCHAR
) ### Response: SELECT opponent FROM table_name_53 WHERE week = 14 |
tell me patient 10624's minimum bands value this month? | CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name 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_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
) | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bands') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') | mimic_iii | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me patient 10624's minimum bands value this month? ### Input: CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name 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_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
) ### Response: SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bands') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') |
After 1961, who as the Entrant when the engine was a Ferrari v8, and when the points were lower than 23? | CREATE TABLE table_name_64 (
entrant VARCHAR,
points VARCHAR,
year VARCHAR,
engine VARCHAR
) | SELECT entrant FROM table_name_64 WHERE year > 1961 AND engine = "ferrari v8" AND points < 23 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: After 1961, who as the Entrant when the engine was a Ferrari v8, and when the points were lower than 23? ### Input: CREATE TABLE table_name_64 (
entrant VARCHAR,
points VARCHAR,
year VARCHAR,
engine VARCHAR
) ### Response: SELECT entrant FROM table_name_64 WHERE year > 1961 AND engine = "ferrari v8" AND points < 23 |
What are the nationalities and the taotal ages of journalists. Visualize by a bar chart. | CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
) | SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the nationalities and the taotal ages of journalists. Visualize by a bar chart. ### Input: CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
) ### Response: SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality |
Which award was given for the role of Elphaba in 2009? | CREATE TABLE table_43430 (
"Year" text,
"Award" text,
"Production" text,
"Role" text,
"Result" text
) | SELECT "Award" FROM table_43430 WHERE "Role" = 'elphaba' AND "Year" = '2009' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which award was given for the role of Elphaba in 2009? ### Input: CREATE TABLE table_43430 (
"Year" text,
"Award" text,
"Production" text,
"Role" text,
"Result" text
) ### Response: SELECT "Award" FROM table_43430 WHERE "Role" = 'elphaba' AND "Year" = '2009' |
What was the result when incumbent Tom Steed was elected? | CREATE TABLE table_1342198_36 (
result VARCHAR,
incumbent VARCHAR
) | SELECT result FROM table_1342198_36 WHERE incumbent = "Tom Steed" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result when incumbent Tom Steed was elected? ### Input: CREATE TABLE table_1342198_36 (
result VARCHAR,
incumbent VARCHAR
) ### Response: SELECT result FROM table_1342198_36 WHERE incumbent = "Tom Steed" |
Term Ending smaller than 2018, and a Nationality of new zealand what is the name? | CREATE TABLE table_5255 (
"Name" text,
"Nationality" text,
"Position" text,
"Tenure Began" real,
"Term Ending" real
) | SELECT "Name" FROM table_5255 WHERE "Term Ending" < '2018' AND "Nationality" = 'new zealand' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Term Ending smaller than 2018, and a Nationality of new zealand what is the name? ### Input: CREATE TABLE table_5255 (
"Name" text,
"Nationality" text,
"Position" text,
"Tenure Began" real,
"Term Ending" real
) ### Response: SELECT "Name" FROM table_5255 WHERE "Term Ending" < '2018' AND "Nationality" = 'new zealand' |
What is the name of series episode 11-02's segment c? | CREATE TABLE table_15187735_11 (
segment_c VARCHAR,
series_ep VARCHAR
) | SELECT segment_c FROM table_15187735_11 WHERE series_ep = "11-02" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of series episode 11-02's segment c? ### Input: CREATE TABLE table_15187735_11 (
segment_c VARCHAR,
series_ep VARCHAR
) ### Response: SELECT segment_c FROM table_15187735_11 WHERE series_ep = "11-02" |
Can you tell me the High rebounds that has the Date of november 5? | CREATE TABLE table_name_16 (
high_rebounds VARCHAR,
date VARCHAR
) | SELECT high_rebounds FROM table_name_16 WHERE date = "november 5" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you tell me the High rebounds that has the Date of november 5? ### Input: CREATE TABLE table_name_16 (
high_rebounds VARCHAR,
date VARCHAR
) ### Response: SELECT high_rebounds FROM table_name_16 WHERE date = "november 5" |
A bar chart shows the number of appellations whose score is higher than 93, and ordered by Name. | CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
) | SELECT Appelation, COUNT(Appelation) FROM wine WHERE Score > 93 GROUP BY Appelation ORDER BY Name | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows the number of appellations whose score is higher than 93, and ordered by Name. ### Input: CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
) ### Response: SELECT Appelation, COUNT(Appelation) FROM wine WHERE Score > 93 GROUP BY Appelation ORDER BY Name |
what is minimum age of patients whose days of hospital stay is 29 and admission year is greater than or equal to 2107? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) | SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = "29" AND demographic.admityear >= "2107" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum age of patients whose days of hospital stay is 29 and admission year is greater than or equal to 2107? ### Input: CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = "29" AND demographic.admityear >= "2107" |
Which Surface has a Week of march 1? | CREATE TABLE table_8542 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner and score" text,
"Finalist" text,
"Semifinalists" text
) | SELECT "Surface" FROM table_8542 WHERE "Week" = 'march 1' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Surface has a Week of march 1? ### Input: CREATE TABLE table_8542 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner and score" text,
"Finalist" text,
"Semifinalists" text
) ### Response: SELECT "Surface" FROM table_8542 WHERE "Week" = 'march 1' |
Find the names of all the product characteristics. | CREATE TABLE CHARACTERISTICS (
characteristic_name VARCHAR
) | SELECT DISTINCT characteristic_name FROM CHARACTERISTICS | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the names of all the product characteristics. ### Input: CREATE TABLE CHARACTERISTICS (
characteristic_name VARCHAR
) ### Response: SELECT DISTINCT characteristic_name FROM CHARACTERISTICS |
on what date did the bears win by a difference of 27 points ? | CREATE TABLE table_204_207 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number,
"bye" text
) | SELECT "date" FROM table_204_207 WHERE "result" = 'w' AND "result" - "result" = 27 | squall | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: on what date did the bears win by a difference of 27 points ? ### Input: CREATE TABLE table_204_207 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number,
"bye" text
) ### Response: SELECT "date" FROM table_204_207 WHERE "result" = 'w' AND "result" - "result" = 27 |
Who was in 2nd leg when Boca Juniors was in home (1st leg)? | CREATE TABLE table_14219514_1 (
home__1st_leg_ VARCHAR
) | SELECT 2 AS nd_leg FROM table_14219514_1 WHERE home__1st_leg_ = "Boca Juniors" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was in 2nd leg when Boca Juniors was in home (1st leg)? ### Input: CREATE TABLE table_14219514_1 (
home__1st_leg_ VARCHAR
) ### Response: SELECT 2 AS nd_leg FROM table_14219514_1 WHERE home__1st_leg_ = "Boca Juniors" |
how many times did debbie black block | CREATE TABLE table_19722233_5 (
blocks VARCHAR,
player VARCHAR
) | SELECT blocks FROM table_19722233_5 WHERE player = "Debbie Black" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times did debbie black block ### Input: CREATE TABLE table_19722233_5 (
blocks VARCHAR,
player VARCHAR
) ### Response: SELECT blocks FROM table_19722233_5 WHERE player = "Debbie Black" |
Who had the decision goal when the record was 7-7-2? | CREATE TABLE table_name_83 (
decision VARCHAR,
record VARCHAR
) | SELECT decision FROM table_name_83 WHERE record = "7-7-2" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who had the decision goal when the record was 7-7-2? ### Input: CREATE TABLE table_name_83 (
decision VARCHAR,
record VARCHAR
) ### Response: SELECT decision FROM table_name_83 WHERE record = "7-7-2" |
what were the top four most common drugs that followed during the same hospital visit for the patients who were given lt heart angiocardiogram during the previous year? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
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,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
) | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'lt heart angiocardiogram') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 4 | mimic_iii | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the top four most common drugs that followed during the same hospital visit for the patients who were given lt heart angiocardiogram during the previous year? ### Input: CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
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,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
) ### Response: SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'lt heart angiocardiogram') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 4 |
Show the name, home city, and age for all drivers. | CREATE TABLE driver (
name VARCHAR,
home_city VARCHAR,
age VARCHAR
) | SELECT name, home_city, age FROM driver | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the name, home city, and age for all drivers. ### Input: CREATE TABLE driver (
name VARCHAR,
home_city VARCHAR,
age VARCHAR
) ### Response: SELECT name, home_city, age FROM driver |
how many patients are admitted urgently and lab tested for bilirubin,direct? | 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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Bilirubin, Direct" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients are admitted urgently and lab tested for bilirubin,direct? ### Input: 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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Bilirubin, Direct" |
what is the number of patients whose marital status is married and procedure long title is percutaneous [endoscopic] gastrostomy [peg]? | 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 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 text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Percutaneous [endoscopic] gastrostomy [PEG]" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose marital status is married and procedure long title is percutaneous [endoscopic] gastrostomy [peg]? ### Input: 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 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 text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: 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 = "Percutaneous [endoscopic] gastrostomy [PEG]" |
Which is the highest Rd 1 has a Province of utrecht and a Rd 4 larger than 0? | CREATE TABLE table_name_70 (
rd_1 INTEGER,
province VARCHAR,
rd_4 VARCHAR
) | SELECT MAX(rd_1) FROM table_name_70 WHERE province = "utrecht" AND rd_4 > 0 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which is the highest Rd 1 has a Province of utrecht and a Rd 4 larger than 0? ### Input: CREATE TABLE table_name_70 (
rd_1 INTEGER,
province VARCHAR,
rd_4 VARCHAR
) ### Response: SELECT MAX(rd_1) FROM table_name_70 WHERE province = "utrecht" AND rd_4 > 0 |
how old is the youngest person for each job?, and could you order x-axis from low to high order? | CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
) | SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how old is the youngest person for each job?, and could you order x-axis from low to high order? ### Input: CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
) ### Response: SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job |
what was the teams final record | CREATE TABLE table_204_123 (
id number,
"week" number,
"date" text,
"kickoff" text,
"opponent" text,
"results\nfinal score" text,
"results\nteam record" text,
"game site" text,
"attendance" number
) | SELECT "results\nteam record" FROM table_204_123 ORDER BY "week" DESC LIMIT 1 | squall | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the teams final record ### Input: CREATE TABLE table_204_123 (
id number,
"week" number,
"date" text,
"kickoff" text,
"opponent" text,
"results\nfinal score" text,
"results\nteam record" text,
"game site" text,
"attendance" number
) ### Response: SELECT "results\nteam record" FROM table_204_123 ORDER BY "week" DESC LIMIT 1 |
What is the average number in attendance on September 16? | CREATE TABLE table_name_23 (
attendance INTEGER,
date VARCHAR
) | SELECT AVG(attendance) FROM table_name_23 WHERE date = "september 16" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number in attendance on September 16? ### Input: CREATE TABLE table_name_23 (
attendance INTEGER,
date VARCHAR
) ### Response: SELECT AVG(attendance) FROM table_name_23 WHERE date = "september 16" |
What classes are required to declare a major in CLARCH ? | CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text 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,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
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_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
) | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%CLARCH%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What classes are required to declare a major in CLARCH ? ### Input: CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text 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,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
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_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%CLARCH%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id |
How many original air dates were there for the episode with production code 212? | CREATE TABLE table_23937219_3 (
original_air_date VARCHAR,
prod_code VARCHAR
) | SELECT COUNT(original_air_date) FROM table_23937219_3 WHERE prod_code = 212 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many original air dates were there for the episode with production code 212? ### Input: CREATE TABLE table_23937219_3 (
original_air_date VARCHAR,
prod_code VARCHAR
) ### Response: SELECT COUNT(original_air_date) FROM table_23937219_3 WHERE prod_code = 212 |
what is the capacity when the acceleration 1-100km/h is 11.1 s? | CREATE TABLE table_name_39 (
capacity VARCHAR,
acceleration_0_100km_h VARCHAR
) | SELECT capacity FROM table_name_39 WHERE acceleration_0_100km_h = "11.1 s" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the capacity when the acceleration 1-100km/h is 11.1 s? ### Input: CREATE TABLE table_name_39 (
capacity VARCHAR,
acceleration_0_100km_h VARCHAR
) ### Response: SELECT capacity FROM table_name_39 WHERE acceleration_0_100km_h = "11.1 s" |
Name the To par of payne stewart? | CREATE TABLE table_name_4 (
to_par VARCHAR,
player VARCHAR
) | SELECT to_par FROM table_name_4 WHERE player = "payne stewart" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the To par of payne stewart? ### Input: CREATE TABLE table_name_4 (
to_par VARCHAR,
player VARCHAR
) ### Response: SELECT to_par FROM table_name_4 WHERE player = "payne stewart" |
what is minimum age of patients whose primary disease is aortic insufficiency\re-do sternotomy; aortic valve replacement and days of hospital stay is 20? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.days_stay = "20" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum age of patients whose primary disease is aortic insufficiency\re-do sternotomy; aortic valve replacement and days of hospital stay is 20? ### Input: CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
) ### Response: SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.days_stay = "20" |
how many employees does vitol have ? | CREATE TABLE table_203_83 (
id number,
"ranking" number,
"company" text,
"industry" text,
"revenue (usd billions)" text,
"fy" text,
"capitalization (usd billions)" text,
"employees" number,
"listing" text,
"headquarters" text,
"ceo" text
) | SELECT "employees" FROM table_203_83 WHERE "company" = 'vitol' | squall | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many employees does vitol have ? ### Input: CREATE TABLE table_203_83 (
id number,
"ranking" number,
"company" text,
"industry" text,
"revenue (usd billions)" text,
"fy" text,
"capitalization (usd billions)" text,
"employees" number,
"listing" text,
"headquarters" text,
"ceo" text
) ### Response: SELECT "employees" FROM table_203_83 WHERE "company" = 'vitol' |
What was E.J. 'Dutch' Harrison's lowest To Par? | CREATE TABLE table_70516 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" text
) | SELECT MIN("To par") FROM table_70516 WHERE "Player" = 'e.j. "dutch" harrison' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was E.J. 'Dutch' Harrison's lowest To Par? ### Input: CREATE TABLE table_70516 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" text
) ### Response: SELECT MIN("To par") FROM table_70516 WHERE "Player" = 'e.j. "dutch" harrison' |
count the number of private health insurance patients who had transplant from cadaver. | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Transplant cadaver donor" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of private health insurance patients who had transplant from cadaver. ### Input: CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: 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 = "Transplant cadaver donor" |
Name the centennial for location | CREATE TABLE table_20448 (
"Information" text,
"Akimel A-al The name is Tohono Oodham for children of the river" text,
"Altade\u00f1a" text,
"Aprende" text,
"Centennial" text,
"Kyrene MS" text,
"del Pueblo" text
) | SELECT "Centennial" FROM table_20448 WHERE "Information" = 'Location' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the centennial for location ### Input: CREATE TABLE table_20448 (
"Information" text,
"Akimel A-al The name is Tohono Oodham for children of the river" text,
"Altade\u00f1a" text,
"Aprende" text,
"Centennial" text,
"Kyrene MS" text,
"del Pueblo" text
) ### Response: SELECT "Centennial" FROM table_20448 WHERE "Information" = 'Location' |
What are the invoice dates, order ids, and order details for all invoices? | CREATE TABLE financial_transactions (
transaction_id number,
account_id number,
invoice_number number,
transaction_type text,
transaction_date time,
transaction_amount number,
transaction_comment text,
other_transaction_details text
)
CREATE TABLE invoices (
invoice_number number,
order_id number,
invoice_date time
)
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_middle_initial text,
customer_last_name text,
gender text,
email_address text,
login_name text,
login_password text,
phone_number text,
town_city text,
state_county_province text,
country text
)
CREATE TABLE invoice_line_items (
order_item_id number,
invoice_number number,
product_id number,
product_title text,
product_quantity text,
product_price number,
derived_product_cost number,
derived_vat_payable number,
derived_total_cost number
)
CREATE TABLE accounts (
account_id number,
customer_id number,
date_account_opened time,
account_name text,
other_account_details text
)
CREATE TABLE product_categories (
production_type_code text,
product_type_description text,
vat_rating number
)
CREATE TABLE products (
product_id number,
parent_product_id number,
production_type_code text,
unit_price number,
product_name text,
product_color text,
product_size text
)
CREATE TABLE order_items (
order_item_id number,
order_id number,
product_id number,
product_quantity text,
other_order_item_details text
)
CREATE TABLE orders (
order_id number,
customer_id number,
date_order_placed time,
order_details text
) | SELECT T1.invoice_date, T1.order_id, T2.order_details FROM invoices AS T1 JOIN orders AS T2 ON T1.order_id = T2.order_id | spider | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the invoice dates, order ids, and order details for all invoices? ### Input: CREATE TABLE financial_transactions (
transaction_id number,
account_id number,
invoice_number number,
transaction_type text,
transaction_date time,
transaction_amount number,
transaction_comment text,
other_transaction_details text
)
CREATE TABLE invoices (
invoice_number number,
order_id number,
invoice_date time
)
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_middle_initial text,
customer_last_name text,
gender text,
email_address text,
login_name text,
login_password text,
phone_number text,
town_city text,
state_county_province text,
country text
)
CREATE TABLE invoice_line_items (
order_item_id number,
invoice_number number,
product_id number,
product_title text,
product_quantity text,
product_price number,
derived_product_cost number,
derived_vat_payable number,
derived_total_cost number
)
CREATE TABLE accounts (
account_id number,
customer_id number,
date_account_opened time,
account_name text,
other_account_details text
)
CREATE TABLE product_categories (
production_type_code text,
product_type_description text,
vat_rating number
)
CREATE TABLE products (
product_id number,
parent_product_id number,
production_type_code text,
unit_price number,
product_name text,
product_color text,
product_size text
)
CREATE TABLE order_items (
order_item_id number,
order_id number,
product_id number,
product_quantity text,
other_order_item_details text
)
CREATE TABLE orders (
order_id number,
customer_id number,
date_order_placed time,
order_details text
) ### Response: SELECT T1.invoice_date, T1.order_id, T2.order_details FROM invoices AS T1 JOIN orders AS T2 ON T1.order_id = T2.order_id |
give me the number of patients whose primary disease is newborn and lab test abnormal status is abnormal? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.flag = "abnormal" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose primary disease is newborn and lab test abnormal status is abnormal? ### Input: CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.flag = "abnormal" |
what is the home city for the stadion src mladost? | CREATE TABLE table_44912 (
"Team" text,
"Manager" text,
"Home city" text,
"Stadium" text,
"Capacity" real
) | SELECT "Home city" FROM table_44912 WHERE "Stadium" = 'stadion src mladost' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the home city for the stadion src mladost? ### Input: CREATE TABLE table_44912 (
"Team" text,
"Manager" text,
"Home city" text,
"Stadium" text,
"Capacity" real
) ### Response: SELECT "Home city" FROM table_44912 WHERE "Stadium" = 'stadion src mladost' |
How close am I to the sportsmanship badge?. | CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
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 SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
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 ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name 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 PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
) | WITH CandidatePosts AS (SELECT ParentId AS postId FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' AND p.PostTypeId = 2 AND p.Score > 0) SELECT p1.Id AS "post_link", p1.OwnerUserId AS "user_link", Body FROM Posts AS p1 JOIN CandidatePosts AS cp ON cp.postId = p1.ParentId WHERE p1.OwnerUserId != '##UserId##' ORDER BY p1.Score DESC | sede | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How close am I to the sportsmanship badge?. ### Input: CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
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 SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
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 ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name 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 PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
) ### Response: WITH CandidatePosts AS (SELECT ParentId AS postId FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' AND p.PostTypeId = 2 AND p.Score > 0) SELECT p1.Id AS "post_link", p1.OwnerUserId AS "user_link", Body FROM Posts AS p1 JOIN CandidatePosts AS cp ON cp.postId = p1.ParentId WHERE p1.OwnerUserId != '##UserId##' ORDER BY p1.Score DESC |
list ground transportation in BALTIMORE | CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
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_miles int,
pressurized varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
) | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BALTIMORE' AND ground_service.city_code = city.city_code | atis | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list ground transportation in BALTIMORE ### Input: CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
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_miles int,
pressurized varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
) ### Response: SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BALTIMORE' AND ground_service.city_code = city.city_code |
How many players are listed for the school/club team Washington? | CREATE TABLE table_20094 (
"Name" text,
"Position" text,
"Number" real,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
) | SELECT COUNT("Name") FROM table_20094 WHERE "School/Club Team" = 'Washington' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many players are listed for the school/club team Washington? ### Input: CREATE TABLE table_20094 (
"Name" text,
"Position" text,
"Number" real,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
) ### Response: SELECT COUNT("Name") FROM table_20094 WHERE "School/Club Team" = 'Washington' |
What type of chipset is in the Precision t3400 model with the PCI Express graphics? | CREATE TABLE table_name_97 (
chipset VARCHAR,
graphics VARCHAR,
model VARCHAR
) | SELECT chipset FROM table_name_97 WHERE graphics = "pci express" AND model = "precision t3400" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What type of chipset is in the Precision t3400 model with the PCI Express graphics? ### Input: CREATE TABLE table_name_97 (
chipset VARCHAR,
graphics VARCHAR,
model VARCHAR
) ### Response: SELECT chipset FROM table_name_97 WHERE graphics = "pci express" AND model = "precision t3400" |
Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100. | CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
) | SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100 | spider | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100. ### Input: CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
) ### Response: SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100 |
For those payments processed with Visa, bin the payment day into the Day of Week interval and compute the total amount payment as the Y-axis. | CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,
Amount_Payment INTEGER
)
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End_Date DATE
) | SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those payments processed with Visa, bin the payment day into the Day of Week interval and compute the total amount payment as the Y-axis. ### Input: CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,
Amount_Payment INTEGER
)
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End_Date DATE
) ### Response: SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' |
Tell me the highest total when the horse is spender s | CREATE TABLE table_name_99 (
total INTEGER,
horse VARCHAR
) | SELECT MAX(total) FROM table_name_99 WHERE horse = "spender s" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the highest total when the horse is spender s ### Input: CREATE TABLE table_name_99 (
total INTEGER,
horse VARCHAR
) ### Response: SELECT MAX(total) FROM table_name_99 WHERE horse = "spender s" |
What is the air date for 'there goes the bride'? | CREATE TABLE table_19608 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production Code" real,
"U.S. viewers (millions)" text
) | SELECT "Original air date" FROM table_19608 WHERE "Title" = 'There Goes the Bride' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the air date for 'there goes the bride'? ### Input: CREATE TABLE table_19608 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production Code" real,
"U.S. viewers (millions)" text
) ### Response: SELECT "Original air date" FROM table_19608 WHERE "Title" = 'There Goes the Bride' |
list the flights from ST. PAUL to SAN JOSE and from ST. PAUL to HOUSTON | CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
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_miles int,
pressurized varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
) | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN JOSE') OR (flight.to_airport = AIRPORT_SERVICE_2.airport_code AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'HOUSTON')) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ST. PAUL' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code | atis | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list the flights from ST. PAUL to SAN JOSE and from ST. PAUL to HOUSTON ### Input: CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
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_miles int,
pressurized varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN JOSE') OR (flight.to_airport = AIRPORT_SERVICE_2.airport_code AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'HOUSTON')) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ST. PAUL' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code |
Give me a bar chart about the number of platforms in different locations, and I want to list from high to low by the total number please. | CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train_station (
Train_ID int,
Station_ID int
) | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) DESC | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a bar chart about the number of platforms in different locations, and I want to list from high to low by the total number please. ### Input: CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train_station (
Train_ID int,
Station_ID int
) ### Response: SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) DESC |
what is the wins when the f/laps is test driver and team is lotus racing? | CREATE TABLE table_44077 (
"Season" text,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Pos." text
) | SELECT "Wins" FROM table_44077 WHERE "F/Laps" = 'test driver' AND "Team" = 'lotus racing' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the wins when the f/laps is test driver and team is lotus racing? ### Input: CREATE TABLE table_44077 (
"Season" text,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Pos." text
) ### Response: SELECT "Wins" FROM table_44077 WHERE "F/Laps" = 'test driver' AND "Team" = 'lotus racing' |
What was the final record for the game in which Dirk Nowitzki (19) had the high points? | CREATE TABLE table_21474 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | SELECT "Record" FROM table_21474 WHERE "High points" = 'Dirk Nowitzki (19)' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the final record for the game in which Dirk Nowitzki (19) had the high points? ### Input: CREATE TABLE table_21474 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) ### Response: SELECT "Record" FROM table_21474 WHERE "High points" = 'Dirk Nowitzki (19)' |
What is the record where high assists is pierce (6)? | CREATE TABLE table_17290 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | SELECT "Record" FROM table_17290 WHERE "High assists" = 'Pierce (6)' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the record where high assists is pierce (6)? ### Input: CREATE TABLE table_17290 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) ### Response: SELECT "Record" FROM table_17290 WHERE "High assists" = 'Pierce (6)' |
Which Chinese has a Pali of atappa? | CREATE TABLE table_45211 (
"English" text,
"Pali" text,
"Sanskrit" text,
"Chinese" text,
"Tibetan" text
) | SELECT "Chinese" FROM table_45211 WHERE "Pali" = 'atappa' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Chinese has a Pali of atappa? ### Input: CREATE TABLE table_45211 (
"English" text,
"Pali" text,
"Sanskrit" text,
"Chinese" text,
"Tibetan" text
) ### Response: SELECT "Chinese" FROM table_45211 WHERE "Pali" = 'atappa' |
what are the four most frequently ordered microbiology tests for patients who received glucose - d5ns earlier within 2 months since 2 years ago? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
) | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucose - d5ns' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 JOIN (SELECT patient.uniquepid, microlab.culturesite, microlab.culturetakentime FROM microlab JOIN patient ON microlab.patientunitstayid = patient.patientunitstayid WHERE DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.culturetakentime AND DATETIME(t2.culturetakentime) BETWEEN DATETIME(t1.treatmenttime) AND DATETIME(t1.treatmenttime, '+2 month') GROUP BY t2.culturesite) AS t3 WHERE t3.c1 <= 4 | eicu | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the four most frequently ordered microbiology tests for patients who received glucose - d5ns earlier within 2 months since 2 years ago? ### Input: CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
) ### Response: SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucose - d5ns' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 JOIN (SELECT patient.uniquepid, microlab.culturesite, microlab.culturetakentime FROM microlab JOIN patient ON microlab.patientunitstayid = patient.patientunitstayid WHERE DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.culturetakentime AND DATETIME(t2.culturetakentime) BETWEEN DATETIME(t1.treatmenttime) AND DATETIME(t1.treatmenttime, '+2 month') GROUP BY t2.culturesite) AS t3 WHERE t3.c1 <= 4 |
what was the number of aneurysm resection / repair procedures that were performed a year before? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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 (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
) | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'aneurysm resection / repair' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | eicu | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the number of aneurysm resection / repair procedures that were performed a year before? ### Input: CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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 (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
) ### Response: SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'aneurysm resection / repair' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
count the number of patients whose ethnicity is asian and diagnoses long title is suicide and self-inflicted injury by hanging? | 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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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 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
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.long_title = "Suicide and self-inflicted injury by hanging" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose ethnicity is asian and diagnoses long title is suicide and self-inflicted injury by hanging? ### Input: 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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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 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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.long_title = "Suicide and self-inflicted injury by hanging" |
What is the total number of losses for the Team of Montreal with Goals For larger than 29? | CREATE TABLE table_11770 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
) | SELECT COUNT("Losses") FROM table_11770 WHERE "Goals For" > '29' AND "Team" = 'montreal' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of losses for the Team of Montreal with Goals For larger than 29? ### Input: CREATE TABLE table_11770 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
) ### Response: SELECT COUNT("Losses") FROM table_11770 WHERE "Goals For" > '29' AND "Team" = 'montreal' |
what is the side-chain polarity for the amino acid with the 1-letter v? | CREATE TABLE table_55835 (
"Amino Acid" text,
"3-Letter" text,
"1-Letter" text,
"Side-chain polarity" text,
"Side-chain charge (pH 7.4)" text,
"Hydropathy index" text
) | SELECT "Side-chain polarity" FROM table_55835 WHERE "1-Letter" = 'v' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the side-chain polarity for the amino acid with the 1-letter v? ### Input: CREATE TABLE table_55835 (
"Amino Acid" text,
"3-Letter" text,
"1-Letter" text,
"Side-chain polarity" text,
"Side-chain charge (pH 7.4)" text,
"Hydropathy index" text
) ### Response: SELECT "Side-chain polarity" FROM table_55835 WHERE "1-Letter" = 'v' |
What is the average number of cuts made in events with fewer than 1 win and exactly 11 top-10s? | CREATE TABLE table_name_93 (
cuts_made INTEGER,
top_10 VARCHAR,
wins VARCHAR
) | SELECT AVG(cuts_made) FROM table_name_93 WHERE top_10 = 11 AND wins < 1 | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number of cuts made in events with fewer than 1 win and exactly 11 top-10s? ### Input: CREATE TABLE table_name_93 (
cuts_made INTEGER,
top_10 VARCHAR,
wins VARCHAR
) ### Response: SELECT AVG(cuts_made) FROM table_name_93 WHERE top_10 = 11 AND wins < 1 |
count the number of patients born before the year 2049. | 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
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2049" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients born before the year 2049. ### Input: 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
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2049" |
give me the number of patients whose primary disease is newborn and procedure icd9 code is 5361? | 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 (
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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND procedures.icd9_code = "5361" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose primary disease is newborn and procedure icd9 code is 5361? ### Input: 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 (
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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND procedures.icd9_code = "5361" |
What are the open dates and years for the shop named Apple? | CREATE TABLE device (
device_id number,
device text,
carrier text,
package_version text,
applications text,
software_platform text
)
CREATE TABLE stock (
shop_id number,
device_id number,
quantity number
)
CREATE TABLE shop (
shop_id number,
shop_name text,
location text,
open_date text,
open_year number
) | SELECT open_date, open_year FROM shop WHERE shop_name = "Apple" | spider | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the open dates and years for the shop named Apple? ### Input: CREATE TABLE device (
device_id number,
device text,
carrier text,
package_version text,
applications text,
software_platform text
)
CREATE TABLE stock (
shop_id number,
device_id number,
quantity number
)
CREATE TABLE shop (
shop_id number,
shop_name text,
location text,
open_date text,
open_year number
) ### Response: SELECT open_date, open_year FROM shop WHERE shop_name = "Apple" |
specify the type and route of administration of drug digoxin | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose 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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
) | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Digoxin" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: specify the type and route of administration of drug digoxin ### Input: CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose 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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
) ### Response: SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Digoxin" |
return me the paper after 2000 in VLDB conference with more than 200 citations . | CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE domain_conference (
cid int,
did int
)
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE author (
aid int,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE journal (
homepage varchar,
jid int,
name varchar
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE keyword (
keyword varchar,
kid int
)
CREATE TABLE domain (
did int,
name varchar
)
CREATE TABLE writes (
aid int,
pid int
)
CREATE TABLE domain_author (
aid int,
did int
)
CREATE TABLE domain_journal (
did int,
jid int
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE conference (
cid int,
homepage varchar,
name varchar
) | SELECT publication.title FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.citation_num > 200 AND publication.year > 2000 | academic | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: return me the paper after 2000 in VLDB conference with more than 200 citations . ### Input: CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE domain_conference (
cid int,
did int
)
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE author (
aid int,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE journal (
homepage varchar,
jid int,
name varchar
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE keyword (
keyword varchar,
kid int
)
CREATE TABLE domain (
did int,
name varchar
)
CREATE TABLE writes (
aid int,
pid int
)
CREATE TABLE domain_author (
aid int,
did int
)
CREATE TABLE domain_journal (
did int,
jid int
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE conference (
cid int,
homepage varchar,
name varchar
) ### Response: SELECT publication.title FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.citation_num > 200 AND publication.year > 2000 |
May I look at my transcript ? | CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score 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,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
) | SELECT DISTINCT course.department, course.name, course.number, semester.semester, semester.year, student_record.grade FROM course, semester, student_record WHERE student_record.course_id = course.course_id AND student_record.semester = semester.semester_id AND student_record.student_id = 1 | advising | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: May I look at my transcript ? ### Input: CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score 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,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
) ### Response: SELECT DISTINCT course.department, course.name, course.number, semester.semester, semester.year, student_record.grade FROM course, semester, student_record WHERE student_record.course_id = course.course_id AND student_record.semester = semester.semester_id AND student_record.student_id = 1 |
All questions with a *single* tag. | 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 Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
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 Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
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
) | SELECT Id AS "post_link", AnswerCount FROM Posts WHERE PostTypeId = 1 AND Tags = CONCAT('<', '##Tag:string##', '>') AND ClosedDate IS NULL ORDER BY CreationDate DESC | sede | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: All questions with a *single* tag. ### Input: 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 Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
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 Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
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
) ### Response: SELECT Id AS "post_link", AnswerCount FROM Posts WHERE PostTypeId = 1 AND Tags = CONCAT('<', '##Tag:string##', '>') AND ClosedDate IS NULL ORDER BY CreationDate DESC |
Show me a scatter plot of time of purchase and age for . | CREATE TABLE happy_hour (
HH_ID int,
Shop_ID int,
Month text,
Num_of_shaff_in_charge int
)
CREATE TABLE member (
Member_ID int,
Name text,
Membership_card text,
Age int,
Time_of_purchase int,
Level_of_membership int,
Address text
)
CREATE TABLE shop (
Shop_ID int,
Address text,
Num_of_staff text,
Score real,
Open_Year text
)
CREATE TABLE happy_hour_member (
HH_ID int,
Member_ID int,
Total_amount real
) | SELECT Time_of_purchase, Age FROM member | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a scatter plot of time of purchase and age for . ### Input: CREATE TABLE happy_hour (
HH_ID int,
Shop_ID int,
Month text,
Num_of_shaff_in_charge int
)
CREATE TABLE member (
Member_ID int,
Name text,
Membership_card text,
Age int,
Time_of_purchase int,
Level_of_membership int,
Address text
)
CREATE TABLE shop (
Shop_ID int,
Address text,
Num_of_staff text,
Score real,
Open_Year text
)
CREATE TABLE happy_hour_member (
HH_ID int,
Member_ID int,
Total_amount real
) ### Response: SELECT Time_of_purchase, Age FROM member |
actually what are the nonstop flights from LAS VEGAS to BURBANK on saturday 5 22 | CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
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_miles int,
pressurized varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
) | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BURBANK' AND date_day.day_number = 22 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LAS VEGAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.stops = 0 | atis | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: actually what are the nonstop flights from LAS VEGAS to BURBANK on saturday 5 22 ### Input: CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
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_miles int,
pressurized varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
) ### Response: SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BURBANK' AND date_day.day_number = 22 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LAS VEGAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.stops = 0 |
What shirt No has a Birth Date of April 12, 1986 (age27)? | CREATE TABLE table_name_63 (
shirt_no INTEGER,
birth_date VARCHAR
) | SELECT MIN(shirt_no) FROM table_name_63 WHERE birth_date = "april 12, 1986 (age27)" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What shirt No has a Birth Date of April 12, 1986 (age27)? ### Input: CREATE TABLE table_name_63 (
shirt_no INTEGER,
birth_date VARCHAR
) ### Response: SELECT MIN(shirt_no) FROM table_name_63 WHERE birth_date = "april 12, 1986 (age27)" |
What is the smallest lost when position is larger than 6, drawn is 7, and the points stat is less than 15? | CREATE TABLE table_34592 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | SELECT MIN("Lost") FROM table_34592 WHERE "Position" > '6' AND "Drawn" = '7' AND "Points" < '15' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest lost when position is larger than 6, drawn is 7, and the points stat is less than 15? ### Input: CREATE TABLE table_34592 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) ### Response: SELECT MIN("Lost") FROM table_34592 WHERE "Position" > '6' AND "Drawn" = '7' AND "Points" < '15' |
What was the grid for Bruno Junqueira for Dale Coyne Racing? | CREATE TABLE table_name_45 (
grid VARCHAR,
team VARCHAR,
driver VARCHAR
) | SELECT grid FROM table_name_45 WHERE team = "dale coyne racing" AND driver = "bruno junqueira" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the grid for Bruno Junqueira for Dale Coyne Racing? ### Input: CREATE TABLE table_name_45 (
grid VARCHAR,
team VARCHAR,
driver VARCHAR
) ### Response: SELECT grid FROM table_name_45 WHERE team = "dale coyne racing" AND driver = "bruno junqueira" |
what is the number of patients whose lab test fluid is urine? | 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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.fluid = "Urine" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose lab test fluid is urine? ### Input: 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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.fluid = "Urine" |
what is the number of patients with discharge location as snf diagnosed with primary disease hyperglycemia? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE 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 text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "HYPERGLYCEMIA" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients with discharge location as snf diagnosed with primary disease hyperglycemia? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE 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 text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "HYPERGLYCEMIA" |
what was the organism found in the last urine, catheter specimen microbiology test for patient 025-19271 in their last hospital visit? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
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 lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
) | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND microlab.culturesite = 'urine, catheter specimen' ORDER BY microlab.culturetakentime DESC LIMIT 1 | eicu | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the organism found in the last urine, catheter specimen microbiology test for patient 025-19271 in their last hospital visit? ### Input: CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
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 lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
) ### Response: SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND microlab.culturesite = 'urine, catheter specimen' ORDER BY microlab.culturetakentime DESC LIMIT 1 |
how many patients who have private insurance stayed in hospital for more than 9 days? | 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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 WHERE demographic.insurance = "Private" AND demographic.days_stay > "9" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients who have private insurance stayed in hospital for more than 9 days? ### Input: 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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.days_stay > "9" |
get data for inverted index assignment. | CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
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 ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
) | SELECT Id, Body, Tags FROM Posts WHERE CreationDate LIKE '%2018%' LIMIT 1000 | sede | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get data for inverted index assignment. ### Input: CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
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 ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
) ### Response: SELECT Id, Body, Tags FROM Posts WHERE CreationDate LIKE '%2018%' LIMIT 1000 |
In what year was Yauco, which had over 42,043 people in 2010, founded? | CREATE TABLE table_65006 (
"Municipality" text,
"FIPS code" real,
"Founded" real,
"Population (2010)" real,
"Area" text
) | SELECT AVG("Founded") FROM table_65006 WHERE "Municipality" = 'yauco' AND "Population (2010)" > '42,043' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what year was Yauco, which had over 42,043 people in 2010, founded? ### Input: CREATE TABLE table_65006 (
"Municipality" text,
"FIPS code" real,
"Founded" real,
"Population (2010)" real,
"Area" text
) ### Response: SELECT AVG("Founded") FROM table_65006 WHERE "Municipality" = 'yauco' AND "Population (2010)" > '42,043' |
Return a histogram on what are the first names and ids for customers who have two or more accounts? | CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(19,4),
product_name VARCHAR(80),
product_color VARCHAR(20),
product_size VARCHAR(20)
)
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4)
)
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(50),
product_price DECIMAL(19,4),
derived_product_cost DECIMAL(19,4),
derived_vat_payable DECIMAL(19,4),
derived_total_cost DECIMAL(19,4)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(50),
customer_middle_initial VARCHAR(1),
customer_last_name VARCHAR(50),
gender VARCHAR(1),
email_address VARCHAR(255),
login_name VARCHAR(80),
login_password VARCHAR(20),
phone_number VARCHAR(255),
town_city VARCHAR(50),
state_county_province VARCHAR(50),
country VARCHAR(50)
) | SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a histogram on what are the first names and ids for customers who have two or more accounts? ### Input: CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(19,4),
product_name VARCHAR(80),
product_color VARCHAR(20),
product_size VARCHAR(20)
)
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4)
)
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(50),
product_price DECIMAL(19,4),
derived_product_cost DECIMAL(19,4),
derived_vat_payable DECIMAL(19,4),
derived_total_cost DECIMAL(19,4)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(50),
customer_middle_initial VARCHAR(1),
customer_last_name VARCHAR(50),
gender VARCHAR(1),
email_address VARCHAR(255),
login_name VARCHAR(80),
login_password VARCHAR(20),
phone_number VARCHAR(255),
town_city VARCHAR(50),
state_county_province VARCHAR(50),
country VARCHAR(50)
) ### Response: SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id |
what was the name of the organism found during the first other microbiology examination of patient 031-23724 in their last hospital encounter? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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 (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
) | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND microlab.culturesite = 'other' ORDER BY microlab.culturetakentime LIMIT 1 | eicu | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the organism found during the first other microbiology examination of patient 031-23724 in their last hospital encounter? ### Input: CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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 (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
) ### Response: SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1)) AND microlab.culturesite = 'other' ORDER BY microlab.culturetakentime LIMIT 1 |
what number of patients primarily diagnosed for coronary artery disease were given drug by inhalation? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
)
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND prescriptions.route = "INHALATION" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what number of patients primarily diagnosed for coronary artery disease were given drug by inhalation? ### Input: CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND prescriptions.route = "INHALATION" |
What is the home team with scarborough as the away team? | CREATE TABLE table_name_50 (
home_team VARCHAR,
away_team VARCHAR
) | SELECT home_team FROM table_name_50 WHERE away_team = "scarborough" | sql_create_context | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the home team with scarborough as the away team? ### Input: CREATE TABLE table_name_50 (
home_team VARCHAR,
away_team VARCHAR
) ### Response: SELECT home_team FROM table_name_50 WHERE away_team = "scarborough" |
What upper level electives are offered for CS majors ? | CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
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,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
) | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What upper level electives are offered for CS majors ? ### Input: CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
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,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
) ### Response: SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id |
For the 2nd string of Do and an Accord du 1st string of FA what is the Depart de la main gauche? | CREATE TABLE table_76895 (
"Mode" text,
"D\u00e9part de la main gauche" text,
"Accord du 1st string" text,
"2nd string" text,
"3rd string" text
) | SELECT "D\u00e9part de la main gauche" FROM table_76895 WHERE "2nd string" = 'do' AND "Accord du 1st string" = 'fa' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the 2nd string of Do and an Accord du 1st string of FA what is the Depart de la main gauche? ### Input: CREATE TABLE table_76895 (
"Mode" text,
"D\u00e9part de la main gauche" text,
"Accord du 1st string" text,
"2nd string" text,
"3rd string" text
) ### Response: SELECT "D\u00e9part de la main gauche" FROM table_76895 WHERE "2nd string" = 'do' AND "Accord du 1st string" = 'fa' |
Find the total number of students for each department with a bar chart, and could you list y axis in descending order? | CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min numeric(2)
) | SELECT T1.dept_name, COUNT(DISTINCT T2.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T2.ID) DESC | nvbench | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the total number of students for each department with a bar chart, and could you list y axis in descending order? ### Input: CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min numeric(2)
) ### Response: SELECT T1.dept_name, COUNT(DISTINCT T2.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T2.ID) DESC |
does toronto 's population grow more or less than hamilton 's ? | CREATE TABLE table_204_113 (
id number,
"rank" number,
"area" text,
"state/\nprovince" text,
"csa/cma\n2009 population" number,
"projected\n2025 population" number,
"projected increase\n2009-2025" number
) | SELECT (SELECT "projected increase\n2009-2025" FROM table_204_113 WHERE "area" = 'toronto') > (SELECT "projected increase\n2009-2025" FROM table_204_113 WHERE "area" = 'hamilton') | squall | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: does toronto 's population grow more or less than hamilton 's ? ### Input: CREATE TABLE table_204_113 (
id number,
"rank" number,
"area" text,
"state/\nprovince" text,
"csa/cma\n2009 population" number,
"projected\n2025 population" number,
"projected increase\n2009-2025" number
) ### Response: SELECT (SELECT "projected increase\n2009-2025" FROM table_204_113 WHERE "area" = 'toronto') > (SELECT "projected increase\n2009-2025" FROM table_204_113 WHERE "area" = 'hamilton') |
provide the number of patients whose marital status is married and admission year is less than 2108? | 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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2108" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose marital status is married and admission year is less than 2108? ### Input: 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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2108" |
What is the draw number that has 59 points? | CREATE TABLE table_54761 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" text
) | SELECT AVG("Draw") FROM table_54761 WHERE "Points" = '59' | wikisql | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the draw number that has 59 points? ### Input: CREATE TABLE table_54761 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" text
) ### Response: SELECT AVG("Draw") FROM table_54761 WHERE "Points" = '59' |
what is maximum age of patients whose language is engl and primary disease is hypertension;rule out coronary artery disease\cardiac cath? | 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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
) | SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" | mimicsql_data | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is maximum age of patients whose language is engl and primary disease is hypertension;rule out coronary artery disease\cardiac cath? ### Input: 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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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
) ### Response: SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" |
what was patient 025-30850's weight the last time in 06/2105? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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 (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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 time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
) | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-30850') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) = '2105-06' ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was patient 025-30850's weight the last time in 06/2105? ### Input: CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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 (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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 time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
) ### Response: SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-30850') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) = '2105-06' ORDER BY patient.unitadmittime DESC LIMIT 1 |