answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT position FROM table_name_85 WHERE affiliation = "ucla"
Which position did the drafted player affiliated with UCLA play?
CREATE TABLE table_name_85 (position VARCHAR, affiliation VARCHAR)
SELECT opponents FROM table_1964010_2 WHERE score = "6–4, 4–6, 7–6 (7–4)"
Who are the opponents of Mike Byron and partner in matches where the score was 6 4, 4 6, 7 6 (7 4)?
CREATE TABLE table_1964010_2 ( opponents VARCHAR, score VARCHAR )
SELECT candidates FROM table_2668199_2 WHERE district = "Pennsylvania 12"
Who were the candidates in districk Pennsylvania 12?
CREATE TABLE table_2668199_2 (candidates VARCHAR, district VARCHAR)
SELECT mls_team FROM table_name_29 WHERE affiliation = "university of california"
Which MLS tea, drafted a player affilaited with the university of california?
CREATE TABLE table_name_29 (mls_team VARCHAR, affiliation VARCHAR)
SELECT "Men's singles" FROM table_43145 WHERE "Women's doubles" = 'irena ferencová / yweta trminková'
Which men's singles had a women's doubles team of irena ferencov / yweta trminkov ?
CREATE TABLE table_43145 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
SELECT result FROM table_2668199_2 WHERE district = "Pennsylvania 6"
What is the result for district pennsylvania 6?
CREATE TABLE table_2668199_2 (result VARCHAR, district VARCHAR)
SELECT rank FROM table_name_65 WHERE active_service = "american civil war and indian wars"
What rank does the person participating in American Civil war and indian wars?
CREATE TABLE table_name_65 (rank VARCHAR, active_service VARCHAR)
SELECT team FROM table_15013825_8 WHERE copa_conmebol_1992 = "Round of 16"
Name the team for copa conmebol 1992 is round of 16
CREATE TABLE table_15013825_8 ( team VARCHAR, copa_conmebol_1992 VARCHAR )
SELECT incumbent FROM table_2668199_2 WHERE candidates = "John Banks (AM) 52.2% Samuel Power (J) 47.8%"
Who was the incumbent when the candidates were John banks (am) 52.2% samuel power (j) 47.8%?
CREATE TABLE table_2668199_2 (incumbent VARCHAR, candidates VARCHAR)
SELECT date FROM table_name_10 WHERE tournament = "the tour championship"
When did the Tournament of the Tour Championship take place?
CREATE TABLE table_name_10 (date VARCHAR, tournament VARCHAR)
SELECT MAX("Tonnage GRT") FROM table_77989 WHERE "Date" = '16 jan 16'
what is the most tonnage grt of any ship sunk or captured on 16 jan 16?
CREATE TABLE table_77989 ( "Date" text, "Ship" text, "Type" text, "Nationality" text, "Tonnage GRT" real )
SELECT COUNT(first_elected) FROM table_2668199_2 WHERE result = "Re-elected" AND party = "Anti-Masonic" AND district = "Pennsylvania 24"
How many times was the result was re-elected and the party was anti-masonic in the district Pennsylvania 24?
CREATE TABLE table_2668199_2 (first_elected VARCHAR, district VARCHAR, result VARCHAR, party VARCHAR)
SELECT AVG(number_of_seasons_in_top_division) FROM table_name_65 WHERE number_of_seasons_in_prva_hnl = 17
Name the average number of seasons for Prva HNL of 17
CREATE TABLE table_name_65 (number_of_seasons_in_top_division INTEGER, number_of_seasons_in_prva_hnl VARCHAR)
SELECT height FROM table_name_2 WHERE date_of_birth = "1976-12-27"
How tall is the person born on 1976-12-27?
CREATE TABLE table_name_2 ( height VARCHAR, date_of_birth VARCHAR )
SELECT candidates FROM table_2668199_2 WHERE result = "Re-elected" AND first_elected = "1832" AND party = "Jacksonian"
Who were all the candidates when the results were re-elected, first elected was 1832 and the party was jacksonian?
CREATE TABLE table_2668199_2 (candidates VARCHAR, party VARCHAR, result VARCHAR, first_elected VARCHAR)
SELECT MIN(number_of_seasons_in_top_division) FROM table_name_46 WHERE position_in_2012_13 = "001 1st"
Name the least number of seasons in top division with position in 2012-13 of 001 1st
CREATE TABLE table_name_46 (number_of_seasons_in_top_division INTEGER, position_in_2012_13 VARCHAR)
SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code
Display a bar chart for what is the code of each location and the number of documents in that location?
CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Document_Locations ( Document_ID INTEGER, Location_Code CHAR(15), Date_in_Location_From DATETIME, Date_in_Locaton_To DATETIME ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) )
SELECT MAX(rank_qualifying) FROM table_26681728_1 WHERE location = "Ghent" AND year = 2011 AND score_qualifying = "14.850"
In Ghent in 2011, what was the rank-qualifying value when the score-qualifying value was 14.850
CREATE TABLE table_26681728_1 (rank_qualifying INTEGER, score_qualifying VARCHAR, location VARCHAR, year VARCHAR)
SELECT first FROM table_name_30 WHERE dob = "5 february 1979"
Which first was born on 5 february 1979?
CREATE TABLE table_name_30 (first VARCHAR, dob VARCHAR)
SELECT MAX(round) FROM table_name_22 WHERE player = "paul mcdonald" AND overall > 109
In which round did Paul McDonald have an overall greater than 109?
CREATE TABLE table_name_22 ( round INTEGER, player VARCHAR, overall VARCHAR )
SELECT MAX(rank_final) FROM table_26681728_1 WHERE apparatus = "Floor Exercise"
What was the maximum rank-final score on the floor exercise?
CREATE TABLE table_26681728_1 (rank_final INTEGER, apparatus VARCHAR)
SELECT first FROM table_name_62 WHERE position = "c" AND bats = "l"
Which First has a Position of c, and Bats of l?
CREATE TABLE table_name_62 (first VARCHAR, position VARCHAR, bats VARCHAR)
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY)
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the average of salary bin hire_date by time, I want to sort in asc by the Y-axis.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) )
SELECT MAX(rank_final) FROM table_26681728_1 WHERE score_final = "14.975"
What was the maximum rank-final value for a score of 14.975?
CREATE TABLE table_26681728_1 (rank_final INTEGER, score_final VARCHAR)
SELECT first FROM table_name_42 WHERE surname = "searle"
Which First has a Surname of searle?
CREATE TABLE table_name_42 (first VARCHAR, surname VARCHAR)
SELECT municipality FROM table_216776_2 WHERE population__2010_ = 26839
What municipality had 26839 people living in it in 2010?
CREATE TABLE table_216776_2 ( municipality VARCHAR, population__2010_ VARCHAR )
SELECT location FROM table_26681728_1 WHERE score_final = "15.050"
Where did the event with a final score of 15.050 occur?
CREATE TABLE table_26681728_1 (location VARCHAR, score_final VARCHAR)
SELECT surname FROM table_name_64 WHERE throws = "r" AND position = "p" AND dob = "26 april 1989"
Which Surname has Throws of r, and a Position of p, and a DOB of 26 april 1989?
CREATE TABLE table_name_64 (surname VARCHAR, dob VARCHAR, throws VARCHAR, position VARCHAR)
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID
For those employees who was hired before 2002-06-21, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id by a bar chart.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) )
SELECT COUNT(party) FROM table_2668243_22 WHERE district = "South Carolina 2"
how many "Party" are in district south carolina 2?
CREATE TABLE table_2668243_22 (party VARCHAR, district VARCHAR)
SELECT dob FROM table_name_56 WHERE first = "david" AND throws = "l" AND position = "if"
Which DOB has a First of david, and Throws of l, and a Position of if?
CREATE TABLE table_name_56 (dob VARCHAR, position VARCHAR, first VARCHAR, throws VARCHAR)
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 500 AND 500 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = course_offering.semester AND semester.year = 2016
For the Spring or Summer term , are there any 500 -level classes ?
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 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 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 semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req 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 jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE area ( course_id int, area 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 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 ( 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 )
SELECT party FROM table_2668243_22 WHERE result = "Re-elected" AND district = "South Carolina 7"
What "party" was re-elected in district South Carolina 7?
CREATE TABLE table_2668243_22 (party VARCHAR, result VARCHAR, district VARCHAR)
SELECT throws FROM table_name_39 WHERE first = "pj"
How many throws does PJ have?
CREATE TABLE table_name_39 (throws VARCHAR, first VARCHAR)
SELECT COUNT(*) FROM table_204_801 WHERE "derby\nwinner" = 'galaxy'
how many times has galaxy won the derby ?
CREATE TABLE table_204_801 ( id number, "year" number, "derby\nwinner" text, "galaxy" number, "draw" number, "chivas" number )
SELECT candidates FROM table_2668243_22 WHERE district = "South Carolina 6"
who were the "candidate" of South Carolina 6?
CREATE TABLE table_2668243_22 (candidates VARCHAR, district VARCHAR)
SELECT SUM(draw) FROM table_name_24 WHERE televoting = 9 AND jury < 10
Televoting of 9, and a Jury smaller than 10 had what sum of draw?
CREATE TABLE table_name_24 (draw INTEGER, televoting VARCHAR, jury VARCHAR)
SELECT tournament FROM table_name_8 WHERE date = "may 29, 2010"
What tournament was played on May 29, 2010?
CREATE TABLE table_name_8 ( tournament VARCHAR, date VARCHAR )
SELECT incumbent FROM table_2668243_22 WHERE district = "South Carolina 7"
Who was the "incumbent" of district south carolina 7?
CREATE TABLE table_2668243_22 (incumbent VARCHAR, district VARCHAR)
SELECT SUM(points) FROM table_name_17 WHERE jury > 6 AND artist = "zhenya rasskazova" AND draw > 9
Jury larger than 6, and a Artist of zhenya rasskazova, and a Draw larger than 9 had what sum of points?
CREATE TABLE table_name_17 (points INTEGER, draw VARCHAR, jury VARCHAR, artist VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Atherosclerosis of native arteries of the extremities with intermittent claudication" AND lab.flag = "abnormal"
how many patients are diagnosed for atherosclerosis of native arteries of the extremities with intermittent claudication and had lab test abnormal status as abnormal?
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 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 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 )
SELECT COUNT(first_elected) FROM table_2668243_25 WHERE incumbent = "John Roane"
How many people were first elected when john roane was the incumbent?
CREATE TABLE table_2668243_25 (first_elected VARCHAR, incumbent VARCHAR)
SELECT MAX(draw) FROM table_name_25 WHERE televoting < 2
Televoting smaller than 2 had what highest draw?
CREATE TABLE table_name_25 (draw INTEGER, televoting INTEGER)
SELECT "Visitor" FROM table_49275 WHERE "Home" = 'minnesota'
Which visitor lives in Minnesota?
CREATE TABLE table_49275 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Points" real )
SELECT party FROM table_2668243_25 WHERE incumbent = "John S. Barbour"
What party did john s. barbour represent?
CREATE TABLE table_2668243_25 (party VARCHAR, incumbent VARCHAR)
SELECT opponent FROM table_name_1 WHERE loss = "hoeft (19-14)"
Who was the opponent when Hoeft (19-14) took the loss?
CREATE TABLE table_name_1 (opponent VARCHAR, loss 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
What are the offerings of upper level electives for CS majors ?
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip 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 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 offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req 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 semester ( semester_id int, semester varchar, year 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 ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE area ( course_id int, area varchar )
SELECT result FROM table_2668243_25 WHERE candidates = "Andrew Stevenson (J) 100%"
What was the result of the election featuring andrew stevenson (j) 100%?
CREATE TABLE table_2668243_25 (result VARCHAR, candidates VARCHAR)
SELECT score FROM table_name_82 WHERE record = "80-63"
What was the score of the game that led to an 80-63 record?
CREATE TABLE table_name_82 (score VARCHAR, record VARCHAR)
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-13959')) AND lab.labname = 'peep' AND STRFTIME('%y-%m', lab.labresulttime) >= '2104-06'
had a peep lab test patient 017-13959 received since 06/2104?
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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime 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 ) 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 )
SELECT candidates FROM table_2668243_25 WHERE incumbent = "Nathaniel H. Claiborne"
What candidate(s) ran for election when nathaniel h. claiborne was the incumbent?
CREATE TABLE table_2668243_25 (candidates VARCHAR, incumbent VARCHAR)
SELECT opponent FROM table_name_62 WHERE loss = "brown (9-5)"
Who was the opponent when Brown (9-5) took the loss?
CREATE TABLE table_name_62 (opponent VARCHAR, loss VARCHAR)
SELECT Team, COUNT(*) FROM technician GROUP BY Team
Show different teams of technicians and the number of technicians in each team in a pie chart.
CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text )
SELECT incumbent FROM table_2668254_17 WHERE first_elected = "1818"
Who was the ran as an incumbent leader first in 1818?
CREATE TABLE table_2668254_17 (incumbent VARCHAR, first_elected VARCHAR)
SELECT performer_1 FROM table_name_13 WHERE performer_3 = "sandi toksvig" AND performer_4 = "mike mcshane"
What was Performer 1's name who performed with Sandi Toksvig as Performer 3 and Mike McShane as Performer 4?
CREATE TABLE table_name_13 (performer_1 VARCHAR, performer_3 VARCHAR, performer_4 VARCHAR)
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26398) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 >= 2
what was the medication patient 26398 had been prescribed two or more times in the previous month?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) 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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location 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 d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
SELECT candidates FROM table_2668254_17 WHERE incumbent = "Joshua Sands"
Who were the running candidates when Joshua Sands was the incumbent?
CREATE TABLE table_2668254_17 (candidates VARCHAR, incumbent VARCHAR)
SELECT performer_4 FROM table_name_14 WHERE performer_3 = "ryan stiles" AND episode = 14
What was Performer 4's name when Performer 3 was Ryan Stiles on episode 14?
CREATE TABLE table_name_14 (performer_4 VARCHAR, performer_3 VARCHAR, episode VARCHAR)
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828 AND admissions.dischtime IS NULL)) AND transfers.wardid = 57 ORDER BY transfers.intime DESC LIMIT 1
how many hours has it passed since the last time that patient 5828 stayed in ward 57 during their current hospital visit?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom 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_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 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 )
SELECT result FROM table_2668264_17 WHERE party = "Adams-Clay Federalist" AND incumbent = "Stephen Van Rensselaer"
What was the result of the election where stephen van rensselaer was the incumbent and the party represented was the adams-clay federalist party?
CREATE TABLE table_2668264_17 (result VARCHAR, party VARCHAR, incumbent VARCHAR)
SELECT COUNT(points) FROM table_name_64 WHERE opponent = "@ new york islanders" AND game > 35
How many points have @ new york islanders as the opponent, with a game greater than 35?
CREATE TABLE table_name_64 (points VARCHAR, opponent VARCHAR, game VARCHAR)
SELECT success_rate FROM table_name_52 WHERE year = "2012"
What is the success rate for the year 2012?
CREATE TABLE table_name_52 ( success_rate VARCHAR, year VARCHAR )
SELECT COUNT(district) FROM table_2668254_25 WHERE first_elected = "1811"
How many district has a candidate that was first elected on 1811?
CREATE TABLE table_2668254_25 (district VARCHAR, first_elected VARCHAR)
SELECT record FROM table_name_40 WHERE december < 6 AND points < 38 AND opponent = "pittsburgh penguins"
What record has a december less than 6, points less than 38, and pittsburgh penguins as the opponent?
CREATE TABLE table_name_40 (record VARCHAR, opponent VARCHAR, december VARCHAR, points VARCHAR)
SELECT "Venue" FROM table_54151 WHERE "Away team score" = '13.16 (94)'
Where is the Venue that has an away team score of 13.16 (94) points?
CREATE TABLE table_54151 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT district FROM table_2668254_8 WHERE incumbent = "Charles A. Wickliffe"
In what district was the incumbent Charles A. Wickliffe?
CREATE TABLE table_2668254_8 (district VARCHAR, incumbent VARCHAR)
SELECT MIN(population) FROM table_name_50 WHERE county = "carroll"
When the county is Carroll what is the lowest population?
CREATE TABLE table_name_50 (population INTEGER, county VARCHAR)
SELECT MAX("Countries sampled") FROM table_2202 WHERE "Index (Year)" = 'Prosperity Index (2008)'
How many countries were sampled for the Prosperity Index (2008)?
CREATE TABLE table_2202 ( "Index (Year)" text, "Author / Editor / Source" text, "Year of publication" text, "Countries sampled" real, "World Ranking (1)" text, "Ranking L.A. (2)" text )
SELECT party FROM table_2668254_8 WHERE incumbent = "Thomas P. Moore"
What party did the incumbent Thomas P. Moore belong to?
CREATE TABLE table_2668254_8 (party VARCHAR, incumbent VARCHAR)
SELECT AVG(population) FROM table_name_70 WHERE per_capita_income = "$29,194"
When the Per capita income is $29,194, what is the average population?
CREATE TABLE table_name_70 (population INTEGER, per_capita_income VARCHAR)
SELECT population__2009_estimate_ FROM table_name_79 WHERE largest_city = "manaus"
What is the 2009 estimate population of the region with Manaus as the largest city?
CREATE TABLE table_name_79 ( population__2009_estimate_ VARCHAR, largest_city VARCHAR )
SELECT candidates FROM table_2668254_8 WHERE district = "Kentucky 9"
Who were the candidates in the Kentucky 9 district?
CREATE TABLE table_2668254_8 (candidates VARCHAR, district VARCHAR)
SELECT year FROM table_name_19 WHERE class = "250"
Which year has a railway class of 250?
CREATE TABLE table_name_19 (year VARCHAR, class VARCHAR)
SELECT "Main legion base" FROM table_26713 WHERE "Date disband" = '70 XX'
What is the main legion base that disbanded 70 xx?
CREATE TABLE table_26713 ( "Legion no and title" text, "Main legion base" text, "Emblem" text, "Date founded/ founder" text, "Date disband" text, "Castra legionaria (legion bases) * = main base. Start date 31 BC if unspecified" text, "Notes" text )
SELECT candidates FROM table_2668254_8 WHERE district = "Kentucky 5"
Who were the candidates in the Kentucky 5 district?
CREATE TABLE table_2668254_8 (candidates VARCHAR, district VARCHAR)
SELECT works_no FROM table_name_69 WHERE class = "15th" AND year = "1940"
Which works number has a class of 15th and year of 1940?
CREATE TABLE table_name_69 (works_no VARCHAR, class VARCHAR, year VARCHAR)
SELECT DISTINCT department FROM course WHERE name LIKE '%The Good Life%'
Which department does The Good Life Fall under ?
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 gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, area 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 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 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_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course ( 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 ta ( campus_job_id int, student_id int, location 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 instructor ( instructor_id int, name varchar, uniqname varchar )
SELECT incumbent FROM table_2668254_22 WHERE candidates = "William Drayton (J)"
Who was the incumbent when the candidate was william drayton (j)?
CREATE TABLE table_2668254_22 (incumbent VARCHAR, candidates VARCHAR)
SELECT builder FROM table_name_18 WHERE railway = "rhodesia railways"
Which builder has a railway of Rhodesia Railways?
CREATE TABLE table_name_18 (builder VARCHAR, railway VARCHAR)
SELECT problem_log_id, log_entry_description FROM problem_log
List all the log ids and their descriptions from the problem logs.
CREATE TABLE problem_log ( problem_log_id VARCHAR, log_entry_description VARCHAR )
SELECT party FROM table_2668254_22 WHERE candidates = "George McDuffie (J)"
What party did candidate george mcduffie (j) represent?
CREATE TABLE table_2668254_22 (party VARCHAR, candidates VARCHAR)
SELECT railway FROM table_name_76 WHERE class = "250" AND year = "1936"
Which railway has a class of 250 and year 1936?
CREATE TABLE table_name_76 (railway VARCHAR, class VARCHAR, year VARCHAR)
SELECT MAX(frequency) FROM table_name_79 WHERE website = "uncionfeypoder.com"
What is the highest frequency from uncionfeypoder.com?
CREATE TABLE table_name_79 ( frequency INTEGER, website VARCHAR )
SELECT party FROM table_2668264_8 WHERE incumbent = "Robert P. Letcher"
What party did robert p. letcher represent?
CREATE TABLE table_2668264_8 (party VARCHAR, incumbent VARCHAR)
SELECT COUNT(week) FROM table_name_43 WHERE attendance = "53,677"
which week had an attendance of 53,677?
CREATE TABLE table_name_43 (week VARCHAR, attendance VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.days_stay > "16"
provide the number of patients whose gender is f and days of hospital stay is greater than 16?
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 ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
SELECT district FROM table_2668264_8 WHERE incumbent = "Henry Clay"
What district(s) did henry clay represent?
CREATE TABLE table_2668264_8 (district VARCHAR, incumbent VARCHAR)
SELECT opponent FROM table_name_21 WHERE attendance = "bye"
which team had a bye week?
CREATE TABLE table_name_21 (opponent VARCHAR, attendance VARCHAR)
SELECT procedures.icd9_code, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Jonathan Wiggins"
what is procedure icd9 code and procedure long title of subject name jonathan wiggins?
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 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 )
SELECT candidates FROM table_2668264_8 WHERE result = "Retired Jacksonian gain"
Who were the candidates for election that had a result of a retired jacksonian gain?
CREATE TABLE table_2668264_8 (candidates VARCHAR, result VARCHAR)
SELECT date FROM table_name_36 WHERE points < 85 AND game__number = 74
Which Date has Points smaller than 85 and a Game # of 74?
CREATE TABLE table_name_36 (date VARCHAR, points VARCHAR, game__number VARCHAR)
SELECT zodiac_sign FROM table_20354_5 WHERE thai_name = "มกราคม"
What's the zodiac sign for the month with Thai name ?
CREATE TABLE table_20354_5 ( zodiac_sign VARCHAR, thai_name VARCHAR )
SELECT result FROM table_2668329_25 WHERE district = "Virginia 22"
What ended up happening in the district Virginia 22?
CREATE TABLE table_2668329_25 (result VARCHAR, district VARCHAR)
SELECT visitor FROM table_name_20 WHERE game__number < 67 AND home = "buffalo"
What is listed for Vistor that has a Game # that is smaller than 67 and has a Home listed as Buffalo?
CREATE TABLE table_name_20 (visitor VARCHAR, game__number VARCHAR, home VARCHAR)
SELECT MAX("Inflation % Annual (2012)") FROM table_75811 WHERE "Public Debt % of GDP (2013 Q1)" > '88.2' AND "GDP % of EU (2012)" = '2.9%'
What is the largest inflation % annual in 2012 of the country with a public debt % of GDP in 2013 Q1 greater than 88.2 and a GDP % of EU in 2012 of 2.9%?
CREATE TABLE table_75811 ( "Member State sorted by GDP" text, "GDP in s billion of USD (2012)" real, "GDP % of EU (2012)" text, "Annual change % of GDP (2012)" text, "GDP per capita in PPP US$ (2012)" real, "Public Debt % of GDP (2013 Q1)" real, "Deficit (-)/ Surplus (+) % of GDP (2012)" text, "Inflation % Annual (2012)" real, "Unemp. % 2013 M7" real )
SELECT party FROM table_2668329_25 WHERE district = "Virginia 4"
What party won the Virginia 4 district?
CREATE TABLE table_2668329_25 (party VARCHAR, district VARCHAR)
SELECT date FROM table_name_48 WHERE home = "calgary"
What Date has a Home listed as Calgary?
CREATE TABLE table_name_48 (date VARCHAR, home VARCHAR)
SELECT home_team FROM table_26847237_3 WHERE opposition = "East Coast"
what is the home team when the opposition is east coast?
CREATE TABLE table_26847237_3 ( home_team VARCHAR, opposition VARCHAR )
SELECT COUNT(result) FROM table_2668329_25 WHERE district = "Virginia 4"
How many people won the election in the district of Virginia 4?
CREATE TABLE table_2668329_25 (result VARCHAR, district VARCHAR)
SELECT score FROM table_name_65 WHERE record = "35-28-6"
What Score has a Record of 35-28-6?
CREATE TABLE table_name_65 (score VARCHAR, record VARCHAR)