table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_17330069_1 ( fin_pos VARCHAR, points VARCHAR )
If the points is 15, what is the fin. pos?
SELECT COUNT(fin_pos) FROM table_17330069_1 WHERE points = "15"
CREATE TABLE table_name_68 ( percent_yes VARCHAR, jurisdiction VARCHAR, percent_no VARCHAR )
What is the percent yes of Alberta, which had a percent no larger than 60.2?
SELECT COUNT(percent_yes) FROM table_name_68 WHERE jurisdiction = "alberta" AND percent_no > 60.2
CREATE TABLE table_37099 ( "Title" text, "Date" text, "Theatre" text, "Role" text, "Dance Partner" text, "Director" text, "Lyrics" text, "Music" text )
Which Title has a Dance Partner of adele astaire, and Lyrics of ira gershwin, and a Director of felix edwardes?
SELECT "Title" FROM table_37099 WHERE "Dance Partner" = 'adele astaire' AND "Lyrics" = 'ira gershwin' AND "Director" = 'felix edwardes'
CREATE TABLE table_28499 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real, "Nickname" text )
How many joined when the enrollment was 1150 in Sioux City, Iowa?
SELECT "Joined" FROM table_28499 WHERE "Enrollment" = '1150' AND "Location" = 'Sioux City, Iowa'
CREATE TABLE table_name_44 ( year_opened VARCHAR, arena_venue VARCHAR )
What year did the San Agustin gym open?
SELECT year_opened FROM table_name_44 WHERE arena_venue = "san agustin gym"
CREATE TABLE table_23398 ( "No. in series" text, "No. in season" real, "Family/families" text, "Location(s)" text, "Original air date" text )
What episode in the season was episode us18 in the series?
SELECT COUNT("No. in season") FROM table_23398 WHERE "No. in series" = 'US18'
CREATE TABLE tryout ( enr INTEGER, cName VARCHAR, pPos VARCHAR ) CREATE TABLE college ( enr INTEGER, cName VARCHAR, pPos VARCHAR )
What is the total number of enrollment of schools that do not have any goalie player?
SELECT SUM(enr) FROM college WHERE NOT cName IN (SELECT cName FROM tryout WHERE pPos = "goalie")
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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 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 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 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_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 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 patients ( row_id number, subject_id number, gender text, dob time, dod 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
what is the maximum monthly number of patients who have had chro kidney dis stage ii since 2102?
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'chro kidney dis stage ii') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2102' GROUP BY STRFTIME('%y-%m', diagnoses_icd.charttime)) AS t1
CREATE TABLE table_4195 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
How many seasons are there for the 3rd position?
SELECT COUNT("Season") FROM table_4195 WHERE "Position" = '3rd'
CREATE TABLE table_23285849_10 ( game VARCHAR, team VARCHAR )
When the clippers are the team how many games are there?
SELECT COUNT(game) FROM table_23285849_10 WHERE team = "Clippers"
CREATE TABLE table_204_109 ( id number, "district" text, "incumbent" text, "party" text, "first\nelected" text, "result" text, "candidates" text )
what are the number of times re elected is listed as the result ?
SELECT COUNT(*) FROM table_204_109 WHERE "result" = 're-elected'
CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number ) CREATE TABLE race ( race_id number, name text, class text, date text, track_id text )
What are the names and seatings for all tracks opened after 2000, ordered by seating?
SELECT name, seating FROM track WHERE year_opened > 2000 ORDER BY seating
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar )
papers from 2014
SELECT DISTINCT paperid FROM paper WHERE year = 2014
CREATE TABLE table_name_69 ( visitor VARCHAR, date VARCHAR )
Which team was the visitor on January 10?
SELECT visitor FROM table_name_69 WHERE date = "january 10"
CREATE TABLE table_2192 ( "Year(s)" real, "Commentator" text, "Dual Commentator" text, "Spokesperson" text, "Channel" text )
state all spokesperson for the channel where dual commentator was elena batinova
SELECT "Spokesperson" FROM table_2192 WHERE "Dual Commentator" = 'Elena Batinova'
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 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 )
list the number of patients who were admitted before the year 2107.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < "2107"
CREATE TABLE table_43083 ( "Usage" text, "Sn/Sb (%)" text, "Liquid at (\u00b0C)" text, "Casting at (\u00b0C)" text, "Remelting at (\u00b0C)" text, "Hardness" text )
What is the remelting temperature for the alloy that has a Sn/Sb ratio of 9.5/15?
SELECT "Remelting at (\u00b0C)" FROM table_43083 WHERE "Sn/Sb (%)" = '9.5/15'
CREATE TABLE table_2697 ( "Year" real, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
Name the total number for report july 23
SELECT COUNT("Report") FROM table_2697 WHERE "Date" = 'July 23'
CREATE TABLE table_14962316_9 ( recopa_sudamericana_1998 VARCHAR, team VARCHAR )
Did Flamengo play in the Recopa Sudamericana in 1998
SELECT recopa_sudamericana_1998 FROM table_14962316_9 WHERE team = "Flamengo"
CREATE TABLE table_1612760_1 ( line VARCHAR, service_pattern VARCHAR )
Which line offers Fast to Norwood Junction?
SELECT line FROM table_1612760_1 WHERE service_pattern = "Fast to Norwood Junction"
CREATE TABLE Addresses ( city VARCHAR, address_id VARCHAR ) CREATE TABLE Staff ( staff_address_id VARCHAR )
Which city lives most of staffs? List the city name and number of staffs.
SELECT T1.city, COUNT(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_21429 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "FLaps" real, "Podiums" real, "Points" real, "Position" text )
Which season did he have 0 points and 31st position?
SELECT MAX("Season") FROM table_21429 WHERE "Points" = '0' AND "Position" = '31st'
CREATE TABLE table_204_55 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
what date is after october 1st ?
SELECT "date" FROM table_204_55 WHERE "date" > (SELECT "date" FROM table_204_55 WHERE "date" = 'october 1, 2005') ORDER BY "date" LIMIT 1
CREATE TABLE table_name_47 ( year INTEGER, position VARCHAR )
What's the average Year for the Position of 7th (sf)?
SELECT AVG(year) FROM table_name_47 WHERE position = "7th (sf)"
CREATE TABLE table_name_4 ( against INTEGER, played INTEGER )
What is the lowest Against when the played is more than 10?
SELECT MIN(against) FROM table_name_4 WHERE played > 10
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text )
What is the number of films of each director? Return a bar chart, and could you display by the how many directed by in asc?
SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by ORDER BY COUNT(Directed_by)
CREATE TABLE table_1057262_2 ( tasmania VARCHAR, new_south_wales VARCHAR )
what's the total number of tasmania with new south wales crop of 190 kilotonnes
SELECT COUNT(tasmania) FROM table_1057262_2 WHERE new_south_wales = 190
CREATE TABLE table_27922491_8 ( wickets INTEGER )
What is the least amount of wickets?
SELECT MIN(wickets) FROM table_27922491_8
CREATE TABLE table_202_179 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number )
who were the top 3 finishers in the 2005 belgian grand prix ?
SELECT "driver" FROM table_202_179 ORDER BY "points" DESC LIMIT 3
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 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 )
what is drug type of drug name nafcillin?
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Nafcillin"
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 ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
how many patients with infected right thigh graft were of american indian/alaska native ethnicty?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.diagnosis = "INFECTED RIGHT THIGH GRAFT"
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 Document_Locations ( Document_ID INTEGER, Location_Code CHAR(15), Date_in_Location_From DATETIME, Date_in_Locaton_To DATETIME ) CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description 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 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 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) )
Show the number of documents in different ending date Bin ending date by weekday and group by location code with a stacked bar chart, could you display in descending by the y axis please?
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(Date_in_Locaton_To) DESC
CREATE TABLE table_name_45 ( position VARCHAR, round VARCHAR, player VARCHAR )
Which Position has a Round larger than 4, and a Player of patrick johnson?
SELECT position FROM table_name_45 WHERE round > 4 AND player = "patrick johnson"
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom 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 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_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom 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 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_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 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
when was the last time that patient 31482 had a minimum calcium, total on their current hospital encounter?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31482 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') ORDER BY labevents.valuenum, labevents.charttime DESC LIMIT 1
CREATE TABLE table_66332 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
Who was the fight against when loss was the result at the Gladiator Challenge 87: Collision Course event?
SELECT "Opponent" FROM table_66332 WHERE "Res." = 'loss' AND "Event" = 'gladiator challenge 87: collision course'
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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime 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 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 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 medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
when was the last time patient 010-1155 had a drug intake of volume (ml) magnesium sulfate since 01/16/2105?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-1155')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'volume (ml) magnesium sulfate' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) >= '2105-01-16' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1
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 ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
What is the primary disease and drug route of Albers Bauer?
SELECT demographic.diagnosis, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Albert Bauer"
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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
did patient 006-171217 suffer from any type of allergy in the previous year?
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-171217')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
CREATE TABLE table_12963 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
Which venue had an against smaller than 7?
SELECT "Venue" FROM table_12963 WHERE "Against" < '7'
CREATE TABLE table_77498 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner-up" text )
What was the to par of the tournament that had Ken Duke as a runner-up?
SELECT "To par" FROM table_77498 WHERE "Runner-up" = 'ken duke'
CREATE TABLE table_name_52 ( november VARCHAR, year VARCHAR, october VARCHAR )
Who is in November after 1988 when Prinzzess is in October?
SELECT november FROM table_name_52 WHERE year > 1988 AND october = "prinzzess"
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE gsi ( course_offering_id int, student_id 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 semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname 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 course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college 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 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 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 program_course ( program_id int, course_id int, workload int, category varchar )
What time do NATIVEAM 311 lectures start next semester ?
SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'NATIVEAM' AND course.number = 311 AND semester.semester = 'FA' AND semester.year = 2016
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) 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 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 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 area ( course_id int, area varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, 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 offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category 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_prerequisite ( pre_course_id int, course_id int )
COMP 416 requires me to take what classes before I can take it ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT_RECORDalias0.student_id = 1) AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'COMP' AND COURSE_1.number = 416
CREATE TABLE table_204_48 ( id number, "date" text, "race name" text, "location" text, "uci rating" text, "winner" text, "team" text )
what is the name of the first race in the year ?
SELECT "race name" FROM table_204_48 ORDER BY "date" LIMIT 1
CREATE TABLE player_award ( player_id TEXT, award_id TEXT, year INTEGER, league_id TEXT, tie TEXT, notes TEXT ) CREATE TABLE team_half ( year INTEGER, league_id TEXT, team_id TEXT, half INTEGER, div_id TEXT, div_win TEXT, rank INTEGER, g INTEGER, w INTEGER, l INTEGER ) CREATE TABLE pitching_postseason ( player_id TEXT, year INTEGER, round TEXT, team_id TEXT, league_id TEXT, w INTEGER, l INTEGER, g INTEGER, gs INTEGER, cg INTEGER, sho INTEGER, sv INTEGER, ipouts INTEGER, h INTEGER, er INTEGER, hr INTEGER, bb INTEGER, so INTEGER, baopp TEXT, era NUMERIC, ibb NUMERIC, wp NUMERIC, hbp NUMERIC, bk NUMERIC, bfp NUMERIC, gf INTEGER, r INTEGER, sh NUMERIC, sf NUMERIC, g_idp NUMERIC ) CREATE TABLE manager_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won INTEGER, points_max INTEGER, votes_first INTEGER ) CREATE TABLE all_star ( player_id TEXT, year INTEGER, game_num INTEGER, game_id TEXT, team_id TEXT, league_id TEXT, gp NUMERIC, starting_pos NUMERIC ) CREATE TABLE player ( player_id TEXT, birth_year NUMERIC, birth_month NUMERIC, birth_day NUMERIC, birth_country TEXT, birth_state TEXT, birth_city TEXT, death_year NUMERIC, death_month NUMERIC, death_day NUMERIC, death_country TEXT, death_state TEXT, death_city TEXT, name_first TEXT, name_last TEXT, name_given TEXT, weight NUMERIC, height NUMERIC, bats TEXT, throws TEXT, debut TEXT, final_game TEXT, retro_id TEXT, bbref_id TEXT ) CREATE TABLE postseason ( year INTEGER, round TEXT, team_id_winner TEXT, league_id_winner TEXT, team_id_loser TEXT, league_id_loser TEXT, wins INTEGER, losses INTEGER, ties INTEGER ) CREATE TABLE college ( college_id TEXT, name_full TEXT, city TEXT, state TEXT, country TEXT ) CREATE TABLE appearances ( year INTEGER, team_id TEXT, league_id TEXT, player_id TEXT, g_all NUMERIC, gs NUMERIC, g_batting INTEGER, g_defense NUMERIC, g_p INTEGER, g_c INTEGER, g_1b INTEGER, g_2b INTEGER, g_3b INTEGER, g_ss INTEGER, g_lf INTEGER, g_cf INTEGER, g_rf INTEGER, g_of INTEGER, g_dh NUMERIC, g_ph NUMERIC, g_pr NUMERIC ) CREATE TABLE fielding ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, pos TEXT, g INTEGER, gs NUMERIC, inn_outs NUMERIC, po NUMERIC, a NUMERIC, e NUMERIC, dp NUMERIC, pb NUMERIC, wp NUMERIC, sb NUMERIC, cs NUMERIC, zr NUMERIC ) CREATE TABLE pitching ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, w INTEGER, l INTEGER, g INTEGER, gs INTEGER, cg INTEGER, sho INTEGER, sv INTEGER, ipouts NUMERIC, h INTEGER, er INTEGER, hr INTEGER, bb INTEGER, so INTEGER, baopp NUMERIC, era NUMERIC, ibb NUMERIC, wp NUMERIC, hbp NUMERIC, bk INTEGER, bfp NUMERIC, gf NUMERIC, r INTEGER, sh NUMERIC, sf NUMERIC, g_idp NUMERIC ) CREATE TABLE manager_half ( player_id TEXT, year INTEGER, team_id TEXT, league_id TEXT, inseason INTEGER, half INTEGER, g INTEGER, w INTEGER, l INTEGER, rank INTEGER ) CREATE TABLE hall_of_fame ( player_id TEXT, yearid INTEGER, votedby TEXT, ballots NUMERIC, needed NUMERIC, votes NUMERIC, inducted TEXT, category TEXT, needed_note TEXT ) CREATE TABLE batting_postseason ( year INTEGER, round TEXT, player_id TEXT, team_id TEXT, league_id TEXT, g INTEGER, ab INTEGER, r INTEGER, h INTEGER, double INTEGER, triple INTEGER, hr INTEGER, rbi INTEGER, sb INTEGER, cs NUMERIC, bb INTEGER, so INTEGER, ibb NUMERIC, hbp NUMERIC, sh NUMERIC, sf NUMERIC, g_idp NUMERIC ) CREATE TABLE manager_award ( player_id TEXT, award_id TEXT, year INTEGER, league_id TEXT, tie TEXT, notes NUMERIC ) CREATE TABLE park ( park_id TEXT, park_name TEXT, park_alias TEXT, city TEXT, state TEXT, country TEXT ) CREATE TABLE team ( year INTEGER, league_id TEXT, team_id TEXT, franchise_id TEXT, div_id TEXT, rank INTEGER, g INTEGER, ghome NUMERIC, w INTEGER, l INTEGER, div_win TEXT, wc_win TEXT, lg_win TEXT, ws_win TEXT, r INTEGER, ab INTEGER, h INTEGER, double INTEGER, triple INTEGER, hr INTEGER, bb INTEGER, so NUMERIC, sb NUMERIC, cs NUMERIC, hbp NUMERIC, sf NUMERIC, ra INTEGER, er INTEGER, era NUMERIC, cg INTEGER, sho INTEGER, sv INTEGER, ipouts INTEGER, ha INTEGER, hra INTEGER, bba INTEGER, soa INTEGER, e INTEGER, dp NUMERIC, fp NUMERIC, name TEXT, park TEXT, attendance NUMERIC, bpf INTEGER, ppf INTEGER, team_id_br TEXT, team_id_lahman45 TEXT, team_id_retro TEXT ) CREATE TABLE home_game ( year INTEGER, league_id TEXT, team_id TEXT, park_id TEXT, span_first TEXT, span_last TEXT, games INTEGER, openings INTEGER, attendance INTEGER ) CREATE TABLE salary ( year INTEGER, team_id TEXT, league_id TEXT, player_id TEXT, salary INTEGER ) CREATE TABLE player_college ( player_id TEXT, college_id TEXT, year INTEGER ) CREATE TABLE batting ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, g INTEGER, ab NUMERIC, r NUMERIC, h NUMERIC, double NUMERIC, triple NUMERIC, hr NUMERIC, rbi NUMERIC, sb NUMERIC, cs NUMERIC, bb NUMERIC, so NUMERIC, ibb NUMERIC, hbp NUMERIC, sh NUMERIC, sf NUMERIC, g_idp NUMERIC ) CREATE TABLE player_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won NUMERIC, points_max INTEGER, votes_first NUMERIC ) CREATE TABLE fielding_postseason ( player_id TEXT, year INTEGER, team_id TEXT, league_id TEXT, round TEXT, pos TEXT, g INTEGER, gs NUMERIC, inn_outs NUMERIC, po INTEGER, a INTEGER, e INTEGER, dp INTEGER, tp INTEGER, pb NUMERIC, sb NUMERIC, cs NUMERIC ) CREATE TABLE manager ( player_id TEXT, year INTEGER, team_id TEXT, league_id TEXT, inseason INTEGER, g INTEGER, w INTEGER, l INTEGER, rank NUMERIC, plyr_mgr TEXT ) CREATE TABLE fielding_outfield ( player_id TEXT, year INTEGER, stint INTEGER, glf NUMERIC, gcf NUMERIC, grf NUMERIC ) CREATE TABLE team_franchise ( franchise_id TEXT, franchise_name TEXT, active TEXT, na_assoc TEXT )
For each year, bin the year into day of the week interval, and return the average of the number of times the team Boston Red Stockings won in the postseasons using a line chart, order X in desc order please.
SELECT year, AVG(COUNT(*)) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY year DESC
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) 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 ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name 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 CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE VoteTypes ( Id number, Name 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount 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 PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( 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 )
Reasonable quality old posts with spelling errors.
SELECT P.Id AS "post_link", P.CreationDate, P.Score, P.PostTypeId, p.LastEditDate, p.LastActivityDate FROM Posts AS P WHERE p.LastEditDate < DATEADD(month, -6, p.LastActivityDate) AND Score >= 5 AND (Title LIKE '%dinamic%' OR Title LIKE '%sintax%' OR Title LIKE '%programatically%') ORDER BY P.Score, P.CreationDate
CREATE TABLE table_30241 ( "Entrant" text, "Constructor" text, "Car" text, "Driver" text, "Co-driver" text, "Rounds" text )
who is the person that is part of the belgian vw club that works with fr d ric miclotte
SELECT "Driver" FROM table_30241 WHERE "Entrant" = 'Belgian VW Club' AND "Co-driver" = 'Frédéric Miclotte'
CREATE TABLE table_15187735_19 ( segment_a VARCHAR, episode VARCHAR )
What is the segment A on episode 237?
SELECT segment_a FROM table_15187735_19 WHERE episode = 237
CREATE TABLE pilot ( Pilot_ID int, Pilot_name text, Rank int, Age int, Nationality text, Position text, Join_Year int, Team text ) CREATE TABLE pilot_record ( Record_ID int, Pilot_ID int, Aircraft_ID int, Date text ) CREATE TABLE aircraft ( Aircraft_ID int, Order_Year int, Manufacturer text, Model text, Fleet_Series text, Powertrain text, Fuel_Propulsion text )
What are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality.
SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality
CREATE TABLE ReviewTaskStates ( 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 PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) 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 PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount 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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment 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 VoteTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) 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 PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 PostHistoryTypes ( Id number, Name text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
Percent of closed answered negative-scored questions over time.
SELECT MAX(h.t), h.pc AS "Percent of closed answered negative-scored questions over time" FROM (SELECT q.t AS t, NTILE(100) OVER (ORDER BY q.t) AS pc FROM (SELECT ClosedDate - CreationDate AS t FROM Posts WHERE PostTypeId = 1 AND AnswerCount > 0 AND Score < 0 AND NOT ClosedDate IS NULL) AS q) AS h WHERE h.t <= '23:59:59' GROUP BY h.pc ORDER BY h.pc
CREATE TABLE table_name_68 ( first_airdate VARCHAR, episodes VARCHAR, nielsen_ranking VARCHAR )
What was the first airdate or the season that had less than 24 episodes and a Nielsen ranking of #38?
SELECT first_airdate FROM table_name_68 WHERE episodes < 24 AND nielsen_ranking = "#38"
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 ) 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime 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 ) 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 microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
when was the first time patient 022-187132 had a gastric (ng) output during the previous day?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-187132')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'gastric (ng)' AND DATETIME(intakeoutput.intakeoutputtime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-1 day') ORDER BY intakeoutput.intakeoutputtime LIMIT 1
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 d_items ( row_id number, itemid number, label text, linksto 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 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) 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 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 )
did in 2105 patient 71689 visit the hospital?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 71689 AND STRFTIME('%y', admissions.admittime) = '2105'
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) 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_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
has patient 24921 undergone any medical procedure on their first hospital encounter?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24921 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)
CREATE TABLE table_66089 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text )
What is the location for the game with a score of w 106-81?
SELECT "Location/Attendance" FROM table_66089 WHERE "Score" = 'w 106-81'
CREATE TABLE table_name_55 ( area__km²_ INTEGER, population__2010_ VARCHAR )
Where is the lowest area with a population of 7,616?
SELECT MIN(area__km²_) FROM table_name_55 WHERE population__2010_ = 7 OFFSET 616
CREATE TABLE table_16588 ( "#" real, "Episode" text, "Air Date" text, "Timeslot (EST)" text, "Season" text, "Rating" text, "Share" real, "18\u201349" text, "Viewers (m)" text, "Rank (#)" text )
What is the number of rank with the viewership of 5.96 million?
SELECT COUNT("Rank (#)") FROM table_16588 WHERE "Viewers (m)" = '5.96'
CREATE TABLE table_6104 ( "Celebrity" text, "Known for" text, "Entered" text, "Exited" text, "Finished" text )
What day did the person who finished in 12th place leave on?
SELECT "Exited" FROM table_6104 WHERE "Finished" = '12th'
CREATE TABLE book_club ( publisher VARCHAR, YEAR VARCHAR )
Show all publishers which do not have a book in 1989.
SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR = 1989
CREATE TABLE table_name_47 ( overall INTEGER, pick__number VARCHAR, position VARCHAR, round VARCHAR )
Position of defensive tackle, and a Round of 4, and a Pick # smaller than 36 has what overall average?
SELECT AVG(overall) FROM table_name_47 WHERE position = "defensive tackle" AND round = 4 AND pick__number < 36
CREATE TABLE table_name_24 ( record VARCHAR, visitor VARCHAR )
What was the Record of the game in which the Trail Blazers was the visiting team?
SELECT record FROM table_name_24 WHERE visitor = "trail blazers"
CREATE TABLE table_name_99 ( date VARCHAR, decision VARCHAR, home VARCHAR, points VARCHAR )
Which Date has a Home of montreal canadiens, and Points larger than 9, and a Decision of price?
SELECT date FROM table_name_99 WHERE home = "montreal canadiens" AND points > 9 AND decision = "price"
CREATE TABLE semester ( semester_id int, semester varchar, year 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 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 instructor ( instructor_id int, name varchar, uniqname 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 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 area ( course_id int, area varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id 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 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 offering_instructor ( offering_instructor_id int, offering_id int, instructor_id 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 )
What classes next semester are being taught by Dr. Scott Baron ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Scott Baron%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
CREATE TABLE Albums ( label VARCHAR )
What are all the labels?
SELECT DISTINCT label FROM Albums
CREATE TABLE table_name_72 ( driver VARCHAR, points VARCHAR )
Which river had 26 points?
SELECT driver FROM table_name_72 WHERE points = 26
CREATE TABLE table_70184 ( "Week" real, "Issue Date" text, "Artist" text, "Single" text, "Download" text, "Title" text )
What's the Issue Date for an Eric Prydz song with a no available Download information?
SELECT "Issue Date" FROM table_70184 WHERE "Download" = 'no available' AND "Artist" = 'eric prydz'
CREATE TABLE customer_orders ( order_id number, customer_id number, order_date time, order_status_code text ) CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE customers ( customer_id number, payment_method_code text, customer_number text, customer_name text, customer_address text, customer_phone text, customer_email text ) CREATE TABLE order_items ( order_item_id number, order_id number, product_id number, order_quantity text ) CREATE TABLE customer_address_history ( customer_id number, address_id number, date_from time, date_to time ) CREATE TABLE products ( product_id number, product_type_code text, product_name text, product_price number ) CREATE TABLE contacts ( contact_id number, customer_id number, gender text, first_name text, last_name text, contact_phone text )
Show each state and the number of addresses in each state.
SELECT state_province_county, COUNT(*) FROM addresses GROUP BY state_province_county
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 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 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
what were the allergies that patient 006-153198 has had since 119 months ago?
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-153198')) AND DATETIME(allergy.allergytime) >= DATETIME(CURRENT_TIME(), '-119 month')
CREATE TABLE table_name_59 ( december INTEGER, opponent VARCHAR, game VARCHAR )
What is the sum for December against the vancouver canucks earlier than game 33?
SELECT SUM(december) FROM table_name_59 WHERE opponent = "vancouver canucks" AND game < 33
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) 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 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 days ( days_code varchar, day_name varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) 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 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 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 date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE state ( state_code text, state_name text, country_name 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_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 ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant 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 month ( month_number int, month_name text )
list the flights arriving in BALTIMORE from DENVER on 8 3
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, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 2 AND date_day.month_number = 8 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 = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND state.state_code = CITY_0.state_code AND state.state_name = 'state_name0'
CREATE TABLE table_name_96 ( cuts_made INTEGER, wins VARCHAR, top_5 VARCHAR )
How many vuts made for a player with 2 wins and under 7 top 5s?
SELECT AVG(cuts_made) FROM table_name_96 WHERE wins = 2 AND top_5 < 7
CREATE TABLE table_name_47 ( result VARCHAR, opponent VARCHAR, attendance VARCHAR )
When the opponent was Brechin City and the attendance was 656, what was the Result?
SELECT result FROM table_name_47 WHERE opponent = "brechin city" AND attendance = 656
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId 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 PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 ReviewTaskTypes ( Id number, Name text, Description text ) 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 FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId 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 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description 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 ) CREATE TABLE ReviewTaskResultTypes ( 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 )
Monthly active users in StackOverflow / StackExchange.
SELECT COUNT(*) AS ActivePosters5 FROM Posts AS p WHERE p.Score >= 0 AND DATEDIFF(day, p.CreationDate, GETDATE()) <= 30 GROUP BY p.OwnerUserId HAVING COUNT(p.Id) >= 5
CREATE TABLE table_11224 ( "Name" text, "Area (km 2 )" real, "Population Estimate 2005" real, "Population Census 2010" real, "Capital" text )
what is the population estimate 2005 for the with the area (km2) 3,034.08?
SELECT AVG("Population Estimate 2005") FROM table_11224 WHERE "Area (km 2 )" = '3,034.08'
CREATE TABLE table_name_75 ( name VARCHAR, rank VARCHAR, year VARCHAR )
I want the name for rank less than 6 and year more than 1974
SELECT name FROM table_name_75 WHERE rank < 6 AND year > 1974
CREATE TABLE table_26156 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text )
What is the lowest numbered division Cleveland played in?
SELECT MIN("Division") FROM table_26156
CREATE TABLE table_name_50 ( attendance INTEGER, result VARCHAR )
What is the highest Attendance with a Result that is w 24-21?
SELECT MAX(attendance) FROM table_name_50 WHERE result = "w 24-21"
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 procedures_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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value 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 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_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 )
how many times did patient 3929 come to icu during their current hospital visit?
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929 AND admissions.dischtime IS NULL)
CREATE TABLE table_10885 ( "Model number" text, "Frequency" text, "L2 cache" text, "FPU width" text, "Multiplier 1" text, "Socket" text, "Release date" text, "Order part number" text )
what is the frequency of part number tmn550dcr23gm?
SELECT "Frequency" FROM table_10885 WHERE "Order part number" = 'tmn550dcr23gm'
CREATE TABLE table_57294 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text )
Name the speed for andy reynolds
SELECT "Speed" FROM table_57294 WHERE "Rider" = 'andy reynolds'
CREATE TABLE table_2402209_1 ( no_of_barangays VARCHAR, area_coordinator VARCHAR )
How many Barangays lived in the municipality with area coordinator of 110.95?
SELECT no_of_barangays FROM table_2402209_1 WHERE area_coordinator = "110.95"
CREATE TABLE table_41530 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" text, "Province / Club" text )
What is Caps, when Province / Club is DRFC, and when Position is Center?
SELECT "Caps" FROM table_41530 WHERE "Province / Club" = 'drfc' AND "Position" = 'center'
CREATE TABLE table_train_107 ( "id" int, "systolic_blood_pressure_sbp" int, "body_weight" float, "modified_hachinski_ischemia_scale" int, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "clinical_dementia_rating_cdr" float, "NOUSE" float )
modified hachinski less than or equal to 4
SELECT * FROM table_train_107 WHERE modified_hachinski_ischemia_scale <= 4
CREATE TABLE table_train_277 ( "id" int, "gender" string, "cholesterol" float, "blood_platelet_counts" int, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "severe_dyslipidemia" bool, "fasting_triglyceride" int, "body_mass_index_bmi" float, "triglyceride_tg" float, "NOUSE" float )
creatinine level ( a measure of kidney function is greater than 1.4 mg / dl ( for female ) or greater than 1.5 mg / dl ( for male ) or your estimated gfr is under 60 .
SELECT * FROM table_train_277 WHERE (creatinine_clearance_cl > 1.4 AND gender = 'female') OR (creatinine_clearance_cl > 1.5 AND gender = 'male') OR estimated_glomerular_filtration_rate_egfr < 60
CREATE TABLE table_20963074_1 ( result VARCHAR, original_title VARCHAR )
Name the total number of results for octubre
SELECT COUNT(result) FROM table_20963074_1 WHERE original_title = "Octubre"
CREATE TABLE table_name_22 ( launched VARCHAR, commissioned VARCHAR, bow_number VARCHAR )
When did the ship that was commissioned July 1948 with a bow number of ps-31 launch?
SELECT launched FROM table_name_22 WHERE commissioned = "july 1948" AND bow_number = "ps-31"
CREATE TABLE table_44259 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Team points" real, "Opponent score" real, "Record" text, "Streak" text )
Which streak before game 12 had a team points larger than 113 on November 16?
SELECT "Streak" FROM table_44259 WHERE "Team points" > '113' AND "Game" < '12' AND "Date" = 'november 16'
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 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 cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
what are the new prescriptions of patient 021-111547 of today compared to the prescription yesterday?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '021-111547') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '021-111547') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-1 day')
CREATE TABLE table_18600760_13 ( ansi_code INTEGER )
What is the smallest ansi code?
SELECT MIN(ansi_code) FROM table_18600760_13
CREATE TABLE table_27359 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
What are the NFL Teams in College North Texas State?
SELECT "NFL Team" FROM table_27359 WHERE "College" = 'North Texas State'
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime 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 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 microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
since 2102 patient 003-50177 has undergone antibiotics - cephalosporin in other hospitals?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '003-50177' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '003-50177' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentname = 'antibiotics - cephalosporin' AND STRFTIME('%y', treatment.treatmenttime) >= '2102'
CREATE TABLE table_51165 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
WHAT DATE HAD A GAME SMALLER THAN 58, AND FROM BOSTON?
SELECT "Date" FROM table_51165 WHERE "Game" < '58' AND "Team" = 'boston'
CREATE TABLE table_40927 ( "From" real, "Goal" text, "Round 1" text, "Round 2" text, "Round 3" text, "Round 4" text, "Round 5" text, "Round 6+" text )
What is Round 4 when Round 6+ is triple, Round 5 is triple and Round 3 is single?
SELECT "Round 4" FROM table_40927 WHERE "Round 6+" = 'triple' AND "Round 5" = 'triple' AND "Round 3" = 'single'
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress 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 PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE 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 VoteTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name 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 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 PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, 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 PostTypes ( Id number, Name text )
Top 200 users from Iran. Lists the top 200 users (ranked by reputation) that are located in Iran according to their profile information.
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Iran%' ORDER BY Reputation DESC LIMIT 200
CREATE TABLE trip ( id number, duration number, start_date text, start_station_name text, start_station_id number, end_date text, end_station_name text, end_station_id number, bike_id number, subscription_type text, zip_code number ) CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE weather ( date text, max_temperature_f number, mean_temperature_f number, min_temperature_f number, max_dew_point_f number, mean_dew_point_f number, min_dew_point_f number, max_humidity number, mean_humidity number, min_humidity number, max_sea_level_pressure_inches number, mean_sea_level_pressure_inches number, min_sea_level_pressure_inches number, max_visibility_miles number, mean_visibility_miles number, min_visibility_miles number, max_wind_speed_mph number, mean_wind_speed_mph number, max_gust_speed_mph number, precipitation_inches number, cloud_cover number, events text, wind_dir_degrees number, zip_code number ) CREATE TABLE status ( station_id number, bikes_available number, docks_available number, time text )
What are all the different start station names for a trip that lasted less than 100?
SELECT DISTINCT start_station_name FROM trip WHERE duration < 100
CREATE TABLE table_10432 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the date when Richmond was the home team?
SELECT "Date" FROM table_10432 WHERE "Home team" = 'richmond'
CREATE TABLE table_279 ( "car plates (since 1937)" text, "Voivodeship Separate city" text, "Capital" text, "Area in 1000km\u00b2 (1930)" text, "Population in 1000 (1931)" text )
List all areas within 1000 km in the city of Lubelskie?
SELECT "Area in 1000km\u00b2 (1930)" FROM table_279 WHERE "Voivodeship Separate city" = 'lubelskie'
CREATE TABLE table_name_60 ( events INTEGER, player VARCHAR, earnings___$__ VARCHAR )
Which Events have a Player of tom kite, and Earnings ($) smaller than 760,405?
SELECT AVG(events) FROM table_name_60 WHERE player = "tom kite" AND earnings___$__ < 760 OFFSET 405
CREATE TABLE table_1637981_7 ( detroit__dtw_ VARCHAR, grand_rapids__grr_ VARCHAR )
When Grand Rapids's fare was $377.29, what is the fare to Detroit?
SELECT detroit__dtw_ FROM table_1637981_7 WHERE grand_rapids__grr_ = "$377.29"
CREATE TABLE table_name_3 ( surface VARCHAR, opponent VARCHAR )
What was the surface for the opponent Marcos Baghdatis?
SELECT surface FROM table_name_3 WHERE opponent = "marcos baghdatis"