schema
stringlengths
28
5.65k
question
stringlengths
0
990
rejected
stringlengths
2
4.44k
chosen
stringlengths
4
9.17k
weight
float64
0
8.95
CREATE TABLE table_name_74 (week_2 VARCHAR, week_3 VARCHAR)
Which week 2 had a week 3 of Cidney Carson?
SELECT week_2 FROM table_name_74 WHERE week_3 = "cidney carson"
SELECT "week_2" FROM "table_name_74" WHERE "cidney carson" = "week_3"
0.067383
CREATE TABLE table_name_21 (run_2 INT, run_1 VARCHAR, athlete VARCHAR)
What was john farrow's run 2 associated with a run 1 of greater than 52.25?
SELECT MAX(run_2) FROM table_name_21 WHERE run_1 > 52.25 AND athlete = "john farrow"
SELECT MAX("run_2") FROM "table_name_21" WHERE "athlete" = "john farrow" AND "run_1" > 52.25
0.089844
CREATE TABLE table_57478 ("Name" TEXT, "Block" TEXT, "Launch date/time ( UTC ) " TEXT, "COSPAR ID" TEXT, "Rocket" TEXT)
What name has a Rocket of titan iv(401)b and a Block of block i/ii hybrid?
SELECT "Name" FROM table_57478 WHERE "Rocket" = 'titan iv(401)b' AND "Block" = 'block i/ii hybrid'
SELECT "Name" FROM "table_57478" WHERE "Block" = 'block i/ii hybrid' AND "Rocket" = 'titan iv(401)b'
0.097656
CREATE TABLE table_22007 ("Team" TEXT, "Outgoing manage" TEXT, "Manner" TEXT, "Date of vacancy" TEXT, "Incoming manager" TEXT, "Date of appointment" TEXT)
What team(s) had an outgoing manager of jo o alves?
SELECT "Team" FROM table_22007 WHERE "Outgoing manage" = 'João Alves'
SELECT "Team" FROM "table_22007" WHERE "Outgoing manage" = 'João Alves'
0.069336
CREATE TABLE table_name_80 (home_team VARCHAR, away_team VARCHAR)
What is the Home team at the Lincoln City Away game?
SELECT home_team FROM table_name_80 WHERE away_team = "lincoln city"
SELECT "home_team" FROM "table_name_80" WHERE "away_team" = "lincoln city"
0.072266
CREATE TABLE table_name_47 (result VARCHAR, category VARCHAR, year VARCHAR)
What is the Result with a Category of album of the year in a Year that is 2011?
SELECT result FROM table_name_47 WHERE category = "album of the year" AND year = 2011
SELECT "result" FROM "table_name_47" WHERE "album of the year" = "category" AND "year" = 2011
0.09082
CREATE TABLE table_name_85 (high_assists VARCHAR, game VARCHAR)
Who had the high assists in Game 22?
SELECT high_assists FROM table_name_85 WHERE game = 22
SELECT "high_assists" FROM "table_name_85" WHERE "game" = 22
0.058594
CREATE TABLE table_204_981 (id DECIMAL, "ep#" DECIMAL, "title" TEXT, "broadcast date" TEXT, "written by" TEXT, "directed by" TEXT)
which episode aired first -- birth of a legend or skeletons in the closest ?
SELECT "title" FROM table_204_981 WHERE "title" IN ('"birth of a legend"', '"skeletons in the closet"') ORDER BY "broadcast date" LIMIT 1
SELECT "title" FROM "table_204_981" WHERE "title" IN ('"birth of a legend"', '"skeletons in the closet"') ORDER BY "broadcast date" NULLS FIRST LIMIT 1
0.147461
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
provide the number of patients whose ethnicity is black/cape verdean and days of hospital stay is greater than 9?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay > "9"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "9" < "demographic"."days_stay" AND "BLACK/CAPE VERDEAN" = "demographic"."ethnicity"
0.155273
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
what was the last time patient 78086 was prescribed medication?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78086) ORDER BY prescriptions.startdate DESC LIMIT 1
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 78086 GROUP BY "hadm_id") SELECT "prescriptions"."startdate" FROM "prescriptions" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE NOT "_u_0"."" IS NULL ORDER BY "prescriptions"."startdate" DESC NULLS LAST LIMIT 1
0.328125
CREATE TABLE table_26353 ("2009 general election" TEXT, "party" TEXT, "Manhattan" TEXT, "The Bronx" TEXT, "Brooklyn" TEXT, "Queens" TEXT, "Staten Island" TEXT, "Total" FLOAT, "%" TEXT)
what percentage is brooklyn when manhattan is 15.5%?
SELECT "Brooklyn" FROM table_26353 WHERE "Manhattan" = '15.5%'
SELECT "Brooklyn" FROM "table_26353" WHERE "Manhattan" = '15.5%'
0.0625
CREATE TABLE table_18813 ("Specification" TEXT, "Gender" TEXT, "Junior High School ( 12\\u201315 yrs ) " TEXT, "Senior High School ( 15\\u201318 yrs ) " TEXT, "University students and Adults ( 18yrs+ ) " TEXT)
What is the specification where senior high school is 25mm?
SELECT "Specification" FROM table_18813 WHERE "Senior High School (15\u201318 yrs)" = '25mm'
SELECT "Specification" FROM "table_18813" WHERE "Senior High School (15\u201318 yrs)" = '25mm'
0.091797
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME) CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT) CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME) CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
since 6 years ago how many patients were prescribed prednisone 50 mg po tabs within 2 months after being diagnosed with pain - moderate?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pain - moderate' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-6 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'prednisone 50 mg po tabs' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-6 year')) AS t2 WHERE t1.diagnosistime < t2.drugstarttime AND DATETIME(t2.drugstarttime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month')
SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "medication" ON "diagnosis"."diagnosistime" < "medication"."drugstarttime" AND "medication"."drugname" = 'prednisone 50 mg po tabs' AND DATETIME("diagnosis"."diagnosistime") <= DATETIME("medication"."drugstarttime") AND DATETIME("diagnosis"."diagnosistime", '+2 month') >= DATETIME("medication"."drugstarttime") AND DATETIME("medication"."drugstarttime") >= DATETIME(CURRENT_TIME(), '-6 year') JOIN "patient" AS "patient_2" ON "medication"."patientunitstayid" = "patient_2"."patientunitstayid" WHERE "diagnosis"."diagnosisname" = 'pain - moderate' AND DATETIME("diagnosis"."diagnosistime") >= DATETIME(CURRENT_TIME(), '-6 year')
0.758789
CREATE TABLE table_56692 ("Year" FLOAT, "Champion" TEXT, "Score" TEXT, "Runner-Up" TEXT, "Location" TEXT, "Semi-Finalist #1" TEXT, "Semi-Finalist #2" TEXT)
Which champion got a score of 12-1?
SELECT "Champion" FROM table_56692 WHERE "Score" = '12-1'
SELECT "Champion" FROM "table_56692" WHERE "Score" = '12-1'
0.057617
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
has the 'arterial bp mean' level of patient 19412 remained normal today?
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19412)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' AND d_items.linksto = 'chartevents') AND chartevents.valuenum BETWEEN mean_bp_lower AND mean_bp_upper AND DATETIME(chartevents.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day')
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 19412 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'arterial bp mean' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT COUNT(*) > 0 FROM "chartevents" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE "chartevents"."valuenum" <= "mean_bp_upper" AND "chartevents"."valuenum" >= "mean_bp_lower" AND DATETIME("chartevents"."charttime", 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') AND NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL
0.864258
CREATE TABLE table_name_9 (draft VARCHAR, pick VARCHAR)
In which year was the Pick #46?
SELECT draft FROM table_name_9 WHERE pick = "46"
SELECT "draft" FROM "table_name_9" WHERE "46" = "pick"
0.052734
CREATE TABLE journal (journalid INT, journalname VARCHAR) CREATE TABLE paperfield (fieldid INT, paperid INT) CREATE TABLE field (fieldid INT) CREATE TABLE keyphrase (keyphraseid INT, keyphrasename VARCHAR) CREATE TABLE venue (venueid INT, venuename VARCHAR) CREATE TABLE writes (paperid INT, authorid INT) CREATE TABLE paperdataset (paperid INT, datasetid INT) CREATE TABLE cite (citingpaperid INT, citedpaperid INT) CREATE TABLE dataset (datasetid INT, datasetname VARCHAR) CREATE TABLE author (authorid INT, authorname VARCHAR) CREATE TABLE paperkeyphrase (paperid INT, keyphraseid INT) CREATE TABLE paper (paperid INT, title VARCHAR, venueid INT, year INT, numciting INT, numcitedby INT, journalid INT)
What are keyphrases by Christof Dallermassl in 2000 ?
SELECT DISTINCT paperkeyphrase.keyphraseid FROM author, paper, paperkeyphrase, writes WHERE author.authorname = 'Christof Dallermassl' AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2000 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
SELECT DISTINCT "paperkeyphrase"."keyphraseid" FROM "author" JOIN "writes" ON "author"."authorid" = "writes"."authorid" JOIN "paper" ON "paper"."paperid" = "writes"."paperid" AND "paper"."year" = 2000 JOIN "paperkeyphrase" ON "paper"."paperid" = "paperkeyphrase"."paperid" WHERE "author"."authorname" = 'Christof Dallermassl'
0.317383
CREATE TABLE table_73381 ("Round" FLOAT, "Circuit" TEXT, "Date" TEXT, "Pole Position" TEXT, "Fastest Lap" TEXT, "Winning Driver" TEXT, "Winning Team" TEXT)
What was the earlier round where Takashi Kogure got the fastest lap?
SELECT MIN("Round") FROM table_73381 WHERE "Fastest Lap" = 'Takashi Kogure'
SELECT MIN("Round") FROM "table_73381" WHERE "Fastest Lap" = 'Takashi Kogure'
0.075195
CREATE TABLE table_9264 ("Year" FLOAT, "Championship" TEXT, "Winning score" TEXT, "Margin" TEXT, "Runner ( s ) -up" TEXT)
Which Year has a Runner(s)-up of tammie green?
SELECT MIN("Year") FROM table_9264 WHERE "Runner(s)-up" = 'tammie green'
SELECT MIN("Year") FROM "table_9264" WHERE "Runner(s)-up" = 'tammie green'
0.072266
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT) CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR) CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT) CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR) CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT) CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT) CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR) CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT) CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR) CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR) CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR) CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT) CREATE TABLE area (course_id INT, area VARCHAR) 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 gsi (course_offering_id INT, student_id INT) CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text 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)
Other than Prof. Mark Villacorta , is 598 taught by others ?
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 598 AND NOT instructor.name LIKE '%Mark Villacorta%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id
SELECT DISTINCT "instructor"."name" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "offering_instructor" ON "course_offering"."offering_id" = "offering_instructor"."offering_id" JOIN "instructor" ON "instructor"."instructor_id" = "offering_instructor"."instructor_id" AND NOT "instructor"."name" LIKE '%Mark Villacorta%' WHERE "course"."department" = 'EECS' AND "course"."number" = 598
0.425781
CREATE TABLE table_203_473 (id DECIMAL, "no." DECIMAL, "date" TEXT, "tournament" TEXT, "winning score" TEXT, "margin\ of victory" TEXT, "runner ( s ) -up" TEXT)
what were the total number of times the u.s. open was the tournament ?
SELECT COUNT(*) FROM table_203_473 WHERE "tournament" = 'u.s. open'
SELECT COUNT(*) FROM "table_203_473" WHERE "tournament" = 'u.s. open'
0.067383
CREATE TABLE table_name_49 (country VARCHAR, score VARCHAR)
Which Country has a Score of 79-68-74=212?
SELECT country FROM table_name_49 WHERE score = 79 - 68 - 74 = 212
SELECT "country" FROM "table_name_49" WHERE "score" = FALSE
0.057617
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) 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 number of patients born before the year 1837 had lab test item id as 50885?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1837" AND lab.itemid = "50885"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "50885" = "lab"."itemid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "1837" > "demographic"."dob_year"
0.188477
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
how many patients whose year of death is less than or equal to 2180?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2180.0"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2180.0" >= "demographic"."dod_year"
0.108398
CREATE TABLE table_13003460_1 (english_translation VARCHAR, word_number VARCHAR)
Name the english translation of 219
SELECT english_translation FROM table_13003460_1 WHERE word_number = "219"
SELECT "english_translation" FROM "table_13003460_1" WHERE "219" = "word_number"
0.078125
CREATE TABLE domain_keyword (did INT, kid INT) CREATE TABLE cite (cited INT, citing INT) CREATE TABLE publication (abstract VARCHAR, cid INT, citation_num INT, jid INT, pid INT, reference_num INT, title VARCHAR, year INT) CREATE TABLE domain (did INT, name VARCHAR) CREATE TABLE writes (aid INT, pid INT) CREATE TABLE author (aid INT, homepage VARCHAR, name VARCHAR, oid INT) CREATE TABLE organization (continent VARCHAR, homepage VARCHAR, name VARCHAR, oid INT) CREATE TABLE domain_author (aid INT, did INT) CREATE TABLE domain_journal (did INT, jid INT) CREATE TABLE domain_conference (cid INT, did INT) CREATE TABLE publication_keyword (kid INT, pid INT) CREATE TABLE conference (cid INT, homepage VARCHAR, name VARCHAR) CREATE TABLE journal (homepage VARCHAR, jid INT, name VARCHAR) CREATE TABLE domain_publication (did INT, pid INT) CREATE TABLE keyword (keyword VARCHAR, kid INT)
return me the number of papers after 2000 .
SELECT COUNT(DISTINCT (title)) FROM publication WHERE year > 2000
SELECT COUNT(DISTINCT "title") FROM "publication" WHERE "year" > 2000
0.067383
CREATE TABLE table_name_2 (away_team VARCHAR, venue VARCHAR)
Who was the away team at Junction Oval?
SELECT away_team FROM table_name_2 WHERE venue = "junction oval"
SELECT "away_team" FROM "table_name_2" WHERE "junction oval" = "venue"
0.068359
CREATE TABLE table_3808 ("Sd" FLOAT, "Rk" FLOAT, "Player" TEXT, "Points" FLOAT, "Points defending" FLOAT, "Points won" FLOAT, "New points" FLOAT, "Status" TEXT)
How many new points were earned by rk 26?
SELECT "New points" FROM table_3808 WHERE "Rk" = '26'
SELECT "New points" FROM "table_3808" WHERE "Rk" = '26'
0.053711
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) 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)
what is the minimum age of patients who got admitted in emergency and gangrene as the primary disease?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "GANGRENE"
SELECT MIN("demographic"."age") FROM "demographic" WHERE "EMERGENCY" = "demographic"."admission_type" AND "GANGRENE" = "demographic"."diagnosis"
0.140625
CREATE TABLE table_34725 ("Country" TEXT, "Skip" TEXT, "Third" TEXT, "Second" TEXT, "Lead" TEXT)
Which second's third is Jean-Michel Arsenault?
SELECT "Second" FROM table_34725 WHERE "Third" = 'jean-michel arsenault'
SELECT "Second" FROM "table_34725" WHERE "Third" = 'jean-michel arsenault'
0.072266
CREATE TABLE table_name_69 (bask VARCHAR, indoor_track VARCHAR, school VARCHAR)
What is the basketball status for Valparaiso who has an indoor track status of yes?
SELECT bask FROM table_name_69 WHERE indoor_track = "yes" AND school = "valparaiso"
SELECT "bask" FROM "table_name_69" WHERE "indoor_track" = "yes" AND "school" = "valparaiso"
0.088867
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 gsi (course_offering_id INT, student_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 program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR) CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT) CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR) CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR) CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT) CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR) CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT) CREATE TABLE area (course_id INT, area VARCHAR) CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR) CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR) CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT) CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR) CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR) CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
Are there any labs in 381 ?
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 381
SELECT COUNT(*) > 0 FROM "course" WHERE "department" = 'EECS' AND "has_lab" = 'Y' AND "number" = 381
0.097656
CREATE TABLE table_name_63 (college VARCHAR, pick__number VARCHAR, player VARCHAR)
Which College has Player Mark Brown and a Pick # greater than 195?
SELECT college FROM table_name_63 WHERE pick__number > 195 AND player = "mark brown"
SELECT "college" FROM "table_name_63" WHERE "mark brown" = "player" AND "pick__number" > 195
0.089844
CREATE TABLE table_79459 ("Title" TEXT, "Series" TEXT, "Director" TEXT, "Production Number" FLOAT, "Release date" TEXT)
What is the title with the production number greater than 1334 released on 1955-08-27?
SELECT "Title" FROM table_79459 WHERE "Production Number" > '1334' AND "Release date" = '1955-08-27'
SELECT "Title" FROM "table_79459" WHERE "Production Number" > '1334' AND "Release date" = '1955-08-27'
0.099609
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL) CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR) CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL) CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL) CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR) CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL) CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id by a bar chart, could you order x axis in desc order?
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
SELECT "JOB_ID", AVG("MANAGER_ID") FROM "employees" WHERE ("COMMISSION_PCT" <> "null" OR "DEPARTMENT_ID" <> 40) AND ("DEPARTMENT_ID" <> 40 OR "SALARY" <= 12000) AND ("DEPARTMENT_ID" <> 40 OR "SALARY" >= 8000) GROUP BY "JOB_ID" ORDER BY "JOB_ID" DESC NULLS LAST
0.253906
CREATE TABLE table_40821 ("Season" TEXT, "League Apps ( sub ) " TEXT, "League Goals" TEXT, "Cup Apps ( sub ) " TEXT, "Cup Goals" TEXT, "Total Apps ( Sub ) " TEXT, "Total Goals" TEXT)
Which Cup Apps (sub) had 2 goals?
SELECT "Cup Apps (sub)" FROM table_40821 WHERE "Cup Goals" = '2'
SELECT "Cup Apps (sub)" FROM "table_40821" WHERE "Cup Goals" = '2'
0.064453
CREATE TABLE ship (ship_id DECIMAL, name TEXT, type TEXT, built_year DECIMAL, class TEXT, flag TEXT) CREATE TABLE captain (captain_id DECIMAL, name TEXT, ship_id DECIMAL, age TEXT, class TEXT, rank TEXT)
How many different captain ranks are there?
SELECT COUNT(DISTINCT rank) FROM captain
SELECT COUNT(DISTINCT "rank") FROM "captain"
0.042969
CREATE TABLE table_29201 ("model" TEXT, "Speed ( GHz ) " TEXT, "L3 Cache ( MB ) " FLOAT, "QPI speed ( GT/s ) " TEXT, "DDR3 Clock ( MHz ) " FLOAT, "TDP ( W ) " FLOAT, "Cores" FLOAT, "Threads" FLOAT, "Turbo-Boost" TEXT)
What is the speed of the model whose number is W3540?
SELECT "Speed (GHz)" FROM table_29201 WHERE "model" = 'W3540'
SELECT "Speed (GHz)" FROM "table_29201" WHERE "model" = 'W3540'
0.061523
CREATE TABLE table_76015 ("Outcome" TEXT, "Date" FLOAT, "Championship" TEXT, "Opponent in the final" TEXT, "Score in the final" TEXT)
What was the final score with Guillermo Vilas as the opponent in the final, that happened after 1972?
SELECT "Score in the final" FROM table_76015 WHERE "Opponent in the final" = 'guillermo vilas' AND "Date" > '1972'
SELECT "Score in the final" FROM "table_76015" WHERE "Date" > '1972' AND "Opponent in the final" = 'guillermo vilas'
0.113281
CREATE TABLE table_name_83 (tries VARCHAR, player VARCHAR)
How many tries does Fakahau Valu have?
SELECT tries FROM table_name_83 WHERE player = "fakahau valu"
SELECT "tries" FROM "table_name_83" WHERE "fakahau valu" = "player"
0.06543
CREATE TABLE table_11256021_1 (extroverted VARCHAR, _relationship_oriented VARCHAR, moderate VARCHAR)
what's the extroverted, relationship-oriented where moderate is introverted sanguine
SELECT extroverted, _relationship_oriented FROM table_11256021_1 WHERE moderate = "Introverted Sanguine"
SELECT "extroverted", "_relationship_oriented" FROM "table_11256021_1" WHERE "Introverted Sanguine" = "moderate"
0.109375
CREATE TABLE Manufacturers (Code INT, Name VARCHAR, Headquarter VARCHAR, Founder VARCHAR, Revenue FLOAT) CREATE TABLE Products (Code INT, Name VARCHAR, Price DECIMAL, Manufacturer INT)
Create a bar chart showing maximal revenue across headquarter, sort from high to low by the y axis.
SELECT Headquarter, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY MAX(Revenue) DESC
SELECT "Headquarter", MAX("Revenue") FROM "Manufacturers" GROUP BY "Headquarter" ORDER BY MAX("Revenue") DESC NULLS LAST
0.117188
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE 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)
calculate the total number of patients who had extracorporeal circulation auxiliary to open heart surgery and remained admitted in hospital for more than 4 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "4" AND procedures.long_title = "Extracorporeal circulation auxiliary to open heart surgery"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Extracorporeal circulation auxiliary to open heart surgery" = "procedures"."long_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "4" < "demographic"."days_stay"
0.262695
CREATE TABLE table_name_60 (assembled VARCHAR, dissolved VARCHAR, elected VARCHAR)
What is the assembled date of the parliament dissolved on 9 February 1611 and elected in 1606?
SELECT assembled FROM table_name_60 WHERE dissolved = "9 february 1611" AND elected = "1606"
SELECT "assembled" FROM "table_name_60" WHERE "1606" = "elected" AND "9 february 1611" = "dissolved"
0.097656
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
provide the number of patients whose primary disease is colangitis and lab test fluid is blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "COLANGITIS" AND lab.fluid = "Blood"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Blood" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "COLANGITIS" = "demographic"."diagnosis"
0.194336
CREATE TABLE table_76189 ("Player" TEXT, "Country" TEXT, "Year ( s ) won" TEXT, "Total" FLOAT, "To par" FLOAT)
What is the total that South Africa had a par greater than 14
SELECT SUM("Total") FROM table_76189 WHERE "Country" = 'south africa' AND "To par" > '14'
SELECT SUM("Total") FROM "table_76189" WHERE "Country" = 'south africa' AND "To par" > '14'
0.088867
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)
semantic parsing papers later than 2010
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year > 2010
SELECT DISTINCT "paper"."paperid" FROM "keyphrase" JOIN "paperkeyphrase" ON "keyphrase"."keyphraseid" = "paperkeyphrase"."keyphraseid" JOIN "paper" ON "paper"."paperid" = "paperkeyphrase"."paperid" AND "paper"."year" > 2010 WHERE "keyphrase"."keyphrasename" = 'semantic parsing'
0.271484
CREATE TABLE table_name_42 (finish VARCHAR, start VARCHAR)
What is the finish of the year with start 5?
SELECT finish FROM table_name_42 WHERE start = "5"
SELECT "finish" FROM "table_name_42" WHERE "5" = "start"
0.054688
CREATE TABLE table_29921 ("Game" FLOAT, "Date" TEXT, "Team" TEXT, "Score" TEXT, "High points" TEXT, "High rebounds" TEXT, "High assists" TEXT, "Location Attendance" TEXT, "Record" TEXT)
Who had the most assists agains New Orleans?
SELECT "High assists" FROM table_29921 WHERE "Team" = 'New Orleans'
SELECT "High assists" FROM "table_29921" WHERE "Team" = 'New Orleans'
0.067383
CREATE TABLE table_203_758 (id DECIMAL, "no." DECIMAL, "dub no." DECIMAL, "english dubbed title / english subbed title\ original japanese title" TEXT, "original air date" TEXT, "english air date" TEXT)
how many episodes aired originally but not in english ?
SELECT COUNT("english dubbed title / english subbed title\noriginal japanese title") FROM table_203_758 WHERE NOT "original air date" IS NULL AND "english air date" IS NULL
SELECT COUNT("english dubbed title / english subbed title\noriginal japanese title") FROM "table_203_758" WHERE "english air date" IS NULL AND NOT "original air date" IS NULL
0.169922
CREATE TABLE table_17102076_5 (team VARCHAR, location_attendance VARCHAR)
Name the team for arco arena 13,685
SELECT team FROM table_17102076_5 WHERE location_attendance = "ARCO Arena 13,685"
SELECT "team" FROM "table_17102076_5" WHERE "ARCO Arena 13,685" = "location_attendance"
0.084961
CREATE TABLE table_26908 ("Codename ( main article ) " TEXT, "Brand name ( list ) " TEXT, "Cores" FLOAT, "L3 Cache" TEXT, "Socket" TEXT, "TDP" TEXT, "I/O Bus" TEXT)
What i/o buses are associated with the brand name Core i3-21xxt?
SELECT "I/O Bus" FROM table_26908 WHERE "Brand name (list)" = 'Core i3-21xxT'
SELECT "I/O Bus" FROM "table_26908" WHERE "Brand name (list)" = 'Core i3-21xxT'
0.077148
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
What is your current position in terms on number of questions answered in your city.
WITH test1 AS (SELECT DISTINCT u.Id, DisplayName, Reputation, Location, COUNT(p.Id) OVER (PARTITION BY u.Id) AS "questions_answered" FROM Users AS u LEFT JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE LOWER(Location) LIKE '%visak%') /* Select row_number() over(order by 'questions_answered' desc) as rownum,*,sum(reputation) over() as 'total_stackoverflow_reputation_in_your_city' from test1 order by 'questions_answered' desc */ SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY 'questions_answered' DESC) AS "your_position", *, SUM('questions_answered') OVER () AS "total_stackoverflow_questions_answered_in_your_city" FROM test1) AS t1 WHERE Id = 1415739
WITH "test1" AS (SELECT DISTINCT "u"."Id", "DisplayName", "Reputation", "Location", COUNT("p"."Id") OVER (PARTITION BY "u"."Id") AS "questions_answered" FROM "Users" AS "u" LEFT JOIN "Posts" AS "p" ON "p"."OwnerUserId" = "u"."Id" WHERE LOWER("Location") LIKE '%visak%') /* Select row_number() over(order by 'questions_answered' desc) as rownum,*,sum(reputation) over() as 'total_stackoverflow_reputation_in_your_city' from test1 order by 'questions_answered' desc */, "t1" AS (SELECT ROW_NUMBER() OVER (ORDER BY 'questions_answered' DESC NULLS LAST) AS "your_position", *, SUM('questions_answered') OVER () AS "total_stackoverflow_questions_answered_in_your_city" FROM "test1") SELECT * FROM "t1" AS "t1" WHERE "Id" = 1415739
0.708008
CREATE TABLE table_204_917 (id DECIMAL, "date" TEXT, "opponent#" TEXT, "rank#" TEXT, "site" TEXT, "result" TEXT, "attendance" DECIMAL)
in how many games were than more than 80,000 people attending
SELECT COUNT(*) FROM table_204_917 WHERE "attendance" > 80000
SELECT COUNT(*) FROM "table_204_917" WHERE "attendance" > 80000
0.061523
CREATE TABLE table_204_459 (id DECIMAL, "date" TEXT, "time" TEXT, "opponent" TEXT, "site" TEXT, "tv" TEXT, "result" TEXT, "attendance" DECIMAL, "record" TEXT)
what was the total attendance of the 11/09/2013 game ?
SELECT "attendance" FROM table_204_459 WHERE "date" = '11/09/2013'
SELECT "attendance" FROM "table_204_459" WHERE "date" = '11/09/2013'
0.066406
CREATE TABLE table_10081 ("Institution" TEXT, "Location" TEXT, "Team Nickname" TEXT, "Joined TSCHL" FLOAT, "Home Arena" TEXT, "Capacity" FLOAT, "Team Website" TEXT)
what is the team nickname when joined tschl is 2010 and home arena is kettering rec center and the team website is dayton hockey?
SELECT "Team Nickname" FROM table_10081 WHERE "Joined TSCHL" = '2010' AND "Home Arena" = 'kettering rec center' AND "Team Website" = 'dayton hockey'
SELECT "Team Nickname" FROM "table_10081" WHERE "Home Arena" = 'kettering rec center' AND "Joined TSCHL" = '2010' AND "Team Website" = 'dayton hockey'
0.146484
CREATE TABLE table_18207285_2 (opponent VARCHAR, attendance VARCHAR)
Who was the game attended by 60425 people played against?
SELECT opponent FROM table_18207285_2 WHERE attendance = 60425
SELECT "opponent" FROM "table_18207285_2" WHERE "attendance" = 60425
0.066406
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
Top Android users in Morocco.
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE LOWER(Location) LIKE '%morocco%' AND TagName = 'android' GROUP BY u.Id, TagName) SELECT * FROM USER_BY_TAG WHERE rank <= 1000 ORDER BY UpVotes DESC
WITH "USER_BY_TAG" AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "Rank", "u"."Id" AS "user_link", COUNT(*) AS "UpVotes" FROM "Tags" AS "t" JOIN "PostTags" AS "pt" ON "pt"."TagId" = "t"."Id" JOIN "Posts" AS "p" ON "p"."ParentId" = "pt"."PostId" JOIN "Users" AS "u" ON "p"."OwnerUserId" = "u"."Id" JOIN "Votes" AS "v" ON "VoteTypeId" = 2 AND "p"."Id" = "v"."PostId" WHERE "TagName" = 'android' AND LOWER("Location") LIKE '%morocco%' GROUP BY "u"."Id", "TagName") SELECT * FROM "USER_BY_TAG" WHERE "rank" <= 1000 ORDER BY "UpVotes" DESC NULLS LAST
0.552734
CREATE TABLE table_15200 ("Tournament" TEXT, "2007" TEXT, "2008" TEXT, "2009" TEXT, "2010" TEXT, "2011" TEXT, "2012" TEXT)
Name the 2008 for 2012 being a and tournament of australian open
SELECT "2008" FROM table_15200 WHERE "2012" = 'a' AND "Tournament" = 'australian open'
SELECT "2008" FROM "table_15200" WHERE "2012" = 'a' AND "Tournament" = 'australian open'
0.085938
CREATE TABLE Course (CID VARCHAR, CName VARCHAR, Credits INT, Instructor INT, Days VARCHAR, Hours VARCHAR, DNO INT) CREATE TABLE Student (StuID INT, LName VARCHAR, Fname VARCHAR, Age INT, Sex VARCHAR, Major INT, Advisor INT, city_code VARCHAR) CREATE TABLE Minor_in (StuID INT, DNO INT) CREATE TABLE Gradeconversion (lettergrade VARCHAR, gradepoint FLOAT) CREATE TABLE Member_of (FacID INT, DNO INT, Appt_Type VARCHAR) CREATE TABLE Department (DNO INT, Division VARCHAR, DName VARCHAR, Room VARCHAR, Building VARCHAR, DPhone INT) CREATE TABLE Enrolled_in (StuID INT, CID VARCHAR, Grade VARCHAR) CREATE TABLE Faculty (FacID INT, Lname VARCHAR, Fname VARCHAR, Rank VARCHAR, Sex VARCHAR, Phone INT, Room VARCHAR, Building VARCHAR)
Show me about the distribution of Days and the sum of Instructor , and group by attribute Days in a bar chart.
SELECT Days, SUM(Instructor) FROM Course GROUP BY Days ORDER BY Credits
SELECT "Days", SUM("Instructor") FROM "Course" GROUP BY "Days" ORDER BY "Credits" NULLS FIRST
0.09082
CREATE TABLE table_62582 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" FLOAT, "Money ( $ ) " FLOAT)
What score has money ($) greater than 400, with gene sarazen as the player?
SELECT "Score" FROM table_62582 WHERE "Money ( $ )" > '400' AND "Player" = 'gene sarazen'
SELECT "Score" FROM "table_62582" WHERE "Money ( $ )" > '400' AND "Player" = 'gene sarazen'
0.088867
CREATE TABLE table_name_88 (lose INT, name VARCHAR, point VARCHAR)
What was the highest number of lose for a player named Santos with more than 45 points?
SELECT MAX(lose) FROM table_name_88 WHERE name = "santos" AND point > 45
SELECT MAX("lose") FROM "table_name_88" WHERE "name" = "santos" AND "point" > 45
0.078125
CREATE TABLE table_11900378_1 (doubles_champions VARCHAR, tournament VARCHAR)
How many doubles champions were there for the Serbia f6 Futures tournament?
SELECT COUNT(doubles_champions) FROM table_11900378_1 WHERE tournament = "Serbia F6 Futures"
SELECT COUNT("doubles_champions") FROM "table_11900378_1" WHERE "Serbia F6 Futures" = "tournament"
0.095703
CREATE TABLE table_53772 ("Group name" TEXT, "English abbr." TEXT, "French abbr." TEXT, "Formal European Parliament name" TEXT, "From" TEXT)
What is the group name on the date of 20 July 1999?
SELECT "Group name" FROM table_53772 WHERE "From" = '20 july 1999'
SELECT "Group name" FROM "table_53772" WHERE "From" = '20 july 1999'
0.066406
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL) CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR) CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL) CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL) CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL) CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR) CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the sum of department_id , and group by attribute job_id in a bar chart, and sort by the total number in asc.
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID)
SELECT "JOB_ID", SUM("DEPARTMENT_ID") FROM "employees" WHERE "FIRST_NAME" LIKE '%D%' OR "FIRST_NAME" LIKE '%S%' GROUP BY "JOB_ID" ORDER BY SUM("DEPARTMENT_ID") NULLS FIRST
0.166992
CREATE TABLE table_56489 ("Driver" TEXT, "Constructor" TEXT, "Laps" FLOAT, "Time/Retired" TEXT, "Grid" FLOAT)
Who constructed the car that has a Time/Retired of +2:06.0?
SELECT "Constructor" FROM table_56489 WHERE "Time/Retired" = '+2:06.0'
SELECT "Constructor" FROM "table_56489" WHERE "Time/Retired" = '+2:06.0'
0.070313
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL) CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR) CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL) CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL) CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR) CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL) CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
Give me a bar chart to compare the number of departments located in different cities, sort bars from high to low order.
SELECT CITY, COUNT(CITY) FROM locations GROUP BY CITY ORDER BY CITY DESC
SELECT "CITY", COUNT("CITY") FROM "locations" GROUP BY "CITY" ORDER BY "CITY" DESC NULLS LAST
0.09082
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME) CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME) CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME) CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
retrieve patient ids of individuals who have been diagnosed with s/p cabg < 7 days in this year.
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 's/p cabg < 7 days' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
WITH "_u_0" AS (SELECT "diagnosis"."patientunitstayid" FROM "diagnosis" WHERE "diagnosis"."diagnosisname" = 's/p cabg < 7 days' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY "patientunitstayid") SELECT "patient"."uniquepid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL
0.405273
CREATE TABLE table_name_81 (score VARCHAR, visitor VARCHAR, leading_scorer VARCHAR)
What is the Score with a Visitor of bucks, and a Leading scorer with maurice williams (25)?
SELECT score FROM table_name_81 WHERE visitor = "bucks" AND leading_scorer = "maurice williams (25)"
SELECT "score" FROM "table_name_81" WHERE "bucks" = "visitor" AND "leading_scorer" = "maurice williams (25)"
0.105469
CREATE TABLE table_10602294_1 (dates_active VARCHAR, deaths VARCHAR)
What were the active dates for the storm that had 185km/h (115mph) deaths?
SELECT dates_active FROM table_10602294_1 WHERE deaths = "185km/h (115mph)"
SELECT "dates_active" FROM "table_10602294_1" WHERE "185km/h (115mph)" = "deaths"
0.079102
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
what is the admission time and discharge time for the patient name charles nilsson?
SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.name = "Charles Nilsson"
SELECT "demographic"."admittime", "demographic"."dischtime" FROM "demographic" WHERE "Charles Nilsson" = "demographic"."name"
0.12207
CREATE TABLE table_name_44 (time__behind VARCHAR, jockey VARCHAR)
What is the Time/ Behind, when Jockey is 'Jose Lezcano'?
SELECT time__behind FROM table_name_44 WHERE jockey = "jose lezcano"
SELECT "time__behind" FROM "table_name_44" WHERE "jockey" = "jose lezcano"
0.072266
CREATE TABLE table_204_933 (id DECIMAL, "year" DECIMAL, "competition" TEXT, "date" TEXT, "location" TEXT, "opponent" TEXT, "score" TEXT, "result" TEXT, "bye" TEXT)
did the austria davis cup team score more than 10 goals in 1990 ?
SELECT (SELECT SUM("score") FROM table_204_933 WHERE "year" = 1990) > 10
SELECT (SELECT SUM("score") FROM "table_204_933" WHERE "year" = 1990) > 10
0.072266
CREATE TABLE table_204_898 (id DECIMAL, "seed" TEXT, "school" TEXT, "conf ( overall ) " TEXT, "tiebreaker" TEXT)
what is the number of games that depaul won during this season ?
SELECT "conf (overall)" FROM table_204_898 WHERE "school" = 'depaul'
SELECT "conf (overall)" FROM "table_204_898" WHERE "school" = 'depaul'
0.068359
CREATE TABLE table_name_41 (date VARCHAR, game_site VARCHAR)
What is the date of the game that took place at the Resch Center?
SELECT date FROM table_name_41 WHERE game_site = "resch center"
SELECT "date" FROM "table_name_41" WHERE "game_site" = "resch center"
0.067383
CREATE TABLE table_20424140_3 (place INT)
What's the highest number a couple has ranked at?
SELECT MAX(place) FROM table_20424140_3
SELECT MAX("place") FROM "table_20424140_3"
0.041992
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
Most viewed questions with a tag converted to a synonym since then.
SELECT Posts.Id AS "post_link", Posts.ViewCount, TagSynonyms.SourceTagName AS "Its tag...", TagSynonyms.TargetTagName AS "...is a synonym of" FROM TagSynonyms, Tags, PostTags, Posts WHERE Tags.TagName = TagSynonyms.SourceTagName AND PostTags.TagId = Tags.Id AND Posts.Id = PostTags.PostId ORDER BY Posts.ViewCount DESC, Posts.Id DESC LIMIT 100
SELECT "Posts"."Id" AS "post_link", "Posts"."ViewCount", "TagSynonyms"."SourceTagName" AS "Its tag...", "TagSynonyms"."TargetTagName" AS "...is a synonym of" FROM "TagSynonyms" JOIN "Tags" ON "TagSynonyms"."SourceTagName" = "Tags"."TagName" JOIN "PostTags" ON "PostTags"."TagId" = "Tags"."Id" JOIN "Posts" ON "PostTags"."PostId" = "Posts"."Id" ORDER BY "Posts"."ViewCount" DESC NULLS LAST, "Posts"."Id" DESC NULLS LAST LIMIT 100
0.417969
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
when has patient 18677 been given a microbiology test for the last time this month?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18677) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY microbiologyevents.charttime DESC LIMIT 1
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 18677 GROUP BY "hadm_id") SELECT "microbiologyevents"."charttime" FROM "microbiologyevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "microbiologyevents"."hadm_id" WHERE DATETIME("microbiologyevents"."charttime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND NOT "_u_0"."" IS NULL ORDER BY "microbiologyevents"."charttime" DESC NULLS LAST LIMIT 1
0.466797
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
how many times when they visited the hospital last time has patient 62298 been in the icu?
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62298 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)
SELECT COUNT(DISTINCT "icustays"."icustay_id") FROM "icustays" WHERE "icustays"."hadm_id" IN (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 62298 AND NOT "admissions"."dischtime" IS NULL ORDER BY "admissions"."admittime" DESC NULLS LAST LIMIT 1)
0.274414
CREATE TABLE table_38794 ("Season" TEXT, "Team" TEXT, "Wins" TEXT, "Losses" TEXT, "Draws" TEXT)
Which season had 10 draws?
SELECT "Season" FROM table_38794 WHERE "Draws" = '10'
SELECT "Season" FROM "table_38794" WHERE "Draws" = '10'
0.053711
CREATE TABLE table_name_26 (country VARCHAR, player VARCHAR)
WHAT IS THE COUNTRY WITH DAVE BARR?
SELECT country FROM table_name_26 WHERE player = "dave barr"
SELECT "country" FROM "table_name_26" WHERE "dave barr" = "player"
0.064453
CREATE TABLE table_76319 ("Club" TEXT, "League" TEXT, "Venue" TEXT, "Capacity" TEXT, "Location" TEXT, "Established" FLOAT, "Championships" FLOAT)
When was the venue named nassau veterans memorial coliseum established??
SELECT MAX("Established") FROM table_76319 WHERE "Venue" = 'nassau veterans memorial coliseum'
SELECT MAX("Established") FROM "table_76319" WHERE "Venue" = 'nassau veterans memorial coliseum'
0.09375
CREATE TABLE table_27825 ("Lighthouse" TEXT, "Location" TEXT, "Province/City" TEXT, "Date First Lit" TEXT, "Tower height in ft ( m ) " TEXT, "Focal plane in ft ( m ) " TEXT, "Current Status" TEXT, "Current Condition/ Description" TEXT)
The province/city corregidor island (2) is where the lighthouse is located.
SELECT "Province/City" FROM table_27825 WHERE "Lighthouse" = 'Corregidor Island (2)'
SELECT "Province/City" FROM "table_27825" WHERE "Lighthouse" = 'Corregidor Island (2)'
0.083984
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
Specify the discharge time of patient id 87275 along with his total duration of hospital stay
SELECT demographic.days_stay, demographic.dischtime FROM demographic WHERE demographic.subject_id = "87275"
SELECT "demographic"."days_stay", "demographic"."dischtime" FROM "demographic" WHERE "87275" = "demographic"."subject_id"
0.118164
CREATE TABLE table_73399 ("District" TEXT, "Vacator" TEXT, "Reason for change" TEXT, "Successor" TEXT, "Date successor seated" TEXT)
How many vacators have October 22, 1808 as date successor seated?
SELECT COUNT("Vacator") FROM table_73399 WHERE "Date successor seated" = 'October 22, 1808'
SELECT COUNT("Vacator") FROM "table_73399" WHERE "Date successor seated" = 'October 22, 1808'
0.09082
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)
count the number of patients born before 2156 who left against medical advice.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND demographic.dob_year < "2156"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2156" > "demographic"."dob_year" AND "LEFT AGAINST MEDICAL ADVI" = "demographic"."discharge_location"
0.172852
CREATE TABLE table_78882 ("Year" FLOAT, "Title" TEXT, "Director" TEXT, "Survey" TEXT, "Result" TEXT)
What survey has the Ehsas Jdeed title?
SELECT "Survey" FROM table_78882 WHERE "Title" = 'ehsas jdeed'
SELECT "Survey" FROM "table_78882" WHERE "Title" = 'ehsas jdeed'
0.0625
CREATE TABLE table_16190 ("Team" TEXT, "Outgoing manager" TEXT, "Manner of departure" TEXT, "Date of vacancy" TEXT, "Replaced by" TEXT, "Date of appointment" TEXT, "Position in table" TEXT)
Who replaced when team is wigan athletic?
SELECT "Replaced by" FROM table_16190 WHERE "Team" = 'Wigan Athletic'
SELECT "Replaced by" FROM "table_16190" WHERE "Team" = 'Wigan Athletic'
0.069336
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
last time patient 4758 got surgery on the last hospital encounter?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4758 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY procedures_icd.charttime DESC LIMIT 1
SELECT "procedures_icd"."charttime" FROM "procedures_icd" WHERE "procedures_icd"."hadm_id" IN (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 4758 AND NOT "admissions"."dischtime" IS NULL ORDER BY "admissions"."admittime" DESC NULLS LAST LIMIT 1) ORDER BY "procedures_icd"."charttime" DESC NULLS LAST LIMIT 1
0.334961
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
count the number of patients who have been given the procedure for a open incis hern-grft nec two or more times since 2104.
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'open incis hern-grft nec') AND STRFTIME('%y', procedures_icd.charttime) >= '2104' GROUP BY admissions.subject_id) AS t1 WHERE t1.c1 >= 2
WITH "t1" AS (SELECT "admissions"."subject_id", COUNT(*) AS "c1" FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'open incis hern-grft nec' JOIN "admissions" ON "admissions"."hadm_id" = "procedures_icd"."hadm_id" WHERE STRFTIME('%y', "procedures_icd"."charttime") >= '2104' GROUP BY "admissions"."subject_id") SELECT COUNT(DISTINCT "t1"."subject_id") FROM "t1" AS "t1" WHERE "t1"."c1" >= 2
0.479492
CREATE TABLE table_14302582_1 (result VARCHAR, record VARCHAR)
What was the result when the team was 4-1?
SELECT result FROM table_14302582_1 WHERE record = "4-1"
SELECT "result" FROM "table_14302582_1" WHERE "4-1" = "record"
0.060547
CREATE TABLE table_22851 ("Year" FLOAT, "Worldwide" FLOAT, "Africa" FLOAT, "America" FLOAT, "Asia" FLOAT, "Australia" FLOAT, "Europe" FLOAT)
How many members did Africa have the year that Australia had 94615?
SELECT "Africa" FROM table_22851 WHERE "Australia" = '94615'
SELECT "Africa" FROM "table_22851" WHERE "Australia" = '94615'
0.060547
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) 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)
how many dead patients had ondansetron odt medication prescription?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Ondansetron ODT"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "Ondansetron ODT" = "prescriptions"."drug" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "1" = "demographic"."expire_flag"
0.225586
CREATE TABLE table_name_9 (result VARCHAR, attendance VARCHAR)
What is the result of the match with an attendance of 73,855?
SELECT result FROM table_name_9 WHERE attendance = "73,855"
SELECT "result" FROM "table_name_9" WHERE "73,855" = "attendance"
0.063477
CREATE TABLE Allergy_Type (Allergy VARCHAR, AllergyType VARCHAR) CREATE TABLE Student (StuID INT, LName VARCHAR, Fname VARCHAR, Age INT, Sex VARCHAR, Major INT, Advisor INT, city_code VARCHAR) CREATE TABLE Has_Allergy (StuID INT, Allergy VARCHAR)
Show all allergy type with number of students affected by a pie chart.
SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType
SELECT "AllergyType", COUNT(*) FROM "Has_Allergy" AS "T1" JOIN "Allergy_Type" AS "T2" ON "T1"."Allergy" = "T2"."Allergy" GROUP BY "T2"."AllergyType"
0.144531
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
Number of questions asked with python.
SELECT COUNT(*) AS Questions FROM Posts AS questions INNER JOIN PostTags ON questions.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName = 'python'
SELECT COUNT(*) AS "Questions" FROM "Posts" AS "questions" JOIN "PostTags" ON "PostTags"."PostId" = "questions"."Id" JOIN "Tags" ON "PostTags"."TagId" = "Tags"."Id" AND "Tags"."TagName" = 'python'
0.191406
CREATE TABLE table_48585 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Attendance" FLOAT)
What was the Result of the game on December 14, 1986 after Week 11?
SELECT "Result" FROM table_48585 WHERE "Week" > '11' AND "Date" = 'december 14, 1986'
SELECT "Result" FROM "table_48585" WHERE "Date" = 'december 14, 1986' AND "Week" > '11'
0.084961
CREATE TABLE table_51795 ("Year" TEXT, "Team" TEXT, "Comp" TEXT, "Long" TEXT, "Rate" TEXT, "RAtt" TEXT, "RYds" TEXT, "RAvg" TEXT)
What is the RAvg of the year with Ratt of 9?
SELECT "RAvg" FROM table_51795 WHERE "RAtt" = '9'
SELECT "RAvg" FROM "table_51795" WHERE "RAtt" = '9'
0.049805
CREATE TABLE table_204_232 (id DECIMAL, "rank" DECIMAL, "nation" TEXT, "gold" DECIMAL, "silver" DECIMAL, "bronze" DECIMAL, "total" DECIMAL)
nation to earn the same number of silver medals as uruguay
SELECT "nation" FROM table_204_232 WHERE "nation" <> 'uruguay' AND "silver" = (SELECT "silver" FROM table_204_232 WHERE "nation" = 'uruguay')
SELECT "nation" FROM "table_204_232" WHERE "nation" <> 'uruguay' AND "silver" = (SELECT "silver" FROM "table_204_232" WHERE "nation" = 'uruguay')
0.141602
CREATE TABLE submission (submission_id DECIMAL, scores DECIMAL, author TEXT, college TEXT) CREATE TABLE acceptance (submission_id DECIMAL, workshop_id DECIMAL, result TEXT) CREATE TABLE workshop (workshop_id DECIMAL, date TEXT, venue TEXT, name TEXT)
Which colleges have both authors with submission score above 90 and authors with submission score below 80?
SELECT college FROM submission WHERE scores > 90 INTERSECT SELECT college FROM submission WHERE scores < 80
SELECT "college" FROM "submission" WHERE "scores" > 90 INTERSECT SELECT "college" FROM "submission" WHERE "scores" < 80
0.116211