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_5 (total_rebounds VARCHAR, player VARCHAR, rank VARCHAR)
How many rebounds have a Player of andre gaddy, and a Rank smaller than 6?
SELECT COUNT(total_rebounds) FROM table_name_5 WHERE player = "andre gaddy" AND rank < 6
SELECT COUNT("total_rebounds") FROM "table_name_5" WHERE "andre gaddy" = "player" AND "rank" < 6
0.09375
CREATE TABLE status (station_id DECIMAL, bikes_available DECIMAL, docks_available DECIMAL, time TEXT) CREATE TABLE station (id DECIMAL, name TEXT, lat DECIMAL, long DECIMAL, dock_count DECIMAL, city TEXT, installation_date TEXT) CREATE TABLE trip (id DECIMAL, duration DECIMAL, start_date TEXT, start_station_name TEXT, start_station_id DECIMAL, end_date TEXT, end_station_name TEXT, end_station_id DECIMAL, bike_id DECIMAL, subscription_type TEXT, zip_code DECIMAL) CREATE TABLE weather (date TEXT, max_temperature_f DECIMAL, mean_temperature_f DECIMAL, min_temperature_f DECIMAL, max_dew_point_f DECIMAL, mean_dew_point_f DECIMAL, min_dew_point_f DECIMAL, max_humidity DECIMAL, mean_humidity DECIMAL, min_humidity DECIMAL, max_sea_level_pressure_inches DECIMAL, mean_sea_level_pressure_inches DECIMAL, min_sea_level_pressure_inches DECIMAL, max_visibility_miles DECIMAL, mean_visibility_miles DECIMAL, min_visibility_miles DECIMAL, max_wind_speed_mph DECIMAL, mean_wind_speed_mph DECIMAL, max_gust_speed_mph DECIMAL, precipitation_inches DECIMAL, cloud_cover DECIMAL, events TEXT, wind_dir_degrees DECIMAL, zip_code DECIMAL)
In zip code 94107, on which day neither Fog nor Rain was not observed?
SELECT date FROM weather WHERE zip_code = 94107 AND events <> "Fog" AND events <> "Rain"
SELECT "date" FROM "weather" WHERE "Fog" <> "events" AND "Rain" <> "events" AND "zip_code" = 94107
0.095703
CREATE TABLE table_name_6 (category VARCHAR, nominee VARCHAR, result VARCHAR)
What category was Brian D'arcy James nominated for?
SELECT category FROM table_name_6 WHERE nominee = "brian d'arcy james" AND result = "nominated"
SELECT "category" FROM "table_name_6" WHERE "brian d'arcy james" = "nominee" AND "nominated" = "result"
0.100586
CREATE TABLE table_name_6 (played INT, goals_against VARCHAR, losses VARCHAR)
When goals against is greater than 60 and losses less than 29, what is the highest played?
SELECT MAX(played) FROM table_name_6 WHERE goals_against > 60 AND losses < 29
SELECT MAX("played") FROM "table_name_6" WHERE "goals_against" > 60 AND "losses" < 29
0.083008
CREATE TABLE domain_keyword (did INT, kid INT) CREATE TABLE conference (cid INT, homepage VARCHAR, name VARCHAR) CREATE TABLE domain (did INT, name VARCHAR) CREATE TABLE keyword (keyword VARCHAR, kid INT) CREATE TABLE publication (abstract VARCHAR, cid INT, citation_num INT, jid INT, pid INT, reference_num INT, title VARCHAR, year INT) CREATE TABLE cite (cited INT, citing INT) CREATE TABLE author (aid INT, homepage VARCHAR, name VARCHAR, oid INT) CREATE TABLE domain_publication (did INT, pid INT) CREATE TABLE publication_keyword (kid INT, pid INT) CREATE TABLE journal (homepage VARCHAR, jid INT, name VARCHAR) CREATE TABLE organization (continent VARCHAR, homepage VARCHAR, name VARCHAR, oid INT) CREATE TABLE domain_conference (cid INT, did INT) CREATE TABLE domain_author (aid INT, did INT) CREATE TABLE writes (aid INT, pid INT) CREATE TABLE domain_journal (did INT, jid INT)
return me the author in the ' University of Michigan ' whose papers in Databases area have the most total citations .
SELECT author.name FROM author, domain, domain_publication, organization, publication, writes WHERE domain.did = domain_publication.did AND domain.name = 'Databases' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.pid = domain_publication.pid AND writes.aid = author.aid AND writes.pid = publication.pid GROUP BY author.name ORDER BY SUM(publication.citation_num) DESC LIMIT 1
SELECT "author"."name" FROM "author" JOIN "domain" ON "domain"."name" = 'Databases' JOIN "domain_publication" ON "domain"."did" = "domain_publication"."did" JOIN "organization" ON "author"."oid" = "organization"."oid" AND "organization"."name" = 'University of Michigan' JOIN "publication" ON "domain_publication"."pid" = "publication"."pid" JOIN "writes" ON "author"."aid" = "writes"."aid" AND "publication"."pid" = "writes"."pid" GROUP BY "author"."name" ORDER BY SUM("publication"."citation_num") DESC NULLS LAST LIMIT 1
0.510742
CREATE TABLE table_name_50 (release_date VARCHAR, title VARCHAR)
What is the release date of Milk and Money?
SELECT release_date FROM table_name_50 WHERE title = "milk and money"
SELECT "release_date" FROM "table_name_50" WHERE "milk and money" = "title"
0.073242
CREATE TABLE table_26368963_2 (under_11 VARCHAR, under_19 VARCHAR)
What is every value for Under-11 if Under-19 is Leong Siu Lynn?
SELECT under_11 FROM table_26368963_2 WHERE under_19 = "Leong Siu Lynn"
SELECT "under_11" FROM "table_26368963_2" WHERE "Leong Siu Lynn" = "under_19"
0.075195
CREATE TABLE table_2899987_2 (programming VARCHAR, network VARCHAR)
What are all the programs on the Soy Guerrero network?
SELECT programming FROM table_2899987_2 WHERE network = "Soy Guerrero"
SELECT "programming" FROM "table_2899987_2" WHERE "Soy Guerrero" = "network"
0.074219
CREATE TABLE table_66320 ("Producer" TEXT, "Product" TEXT, "Samples taken" FLOAT, "Samples failed" FLOAT, "Melamine content ( mg/kg ) " FLOAT)
What's the melamine content of having more than 1 samples failed?
SELECT "Melamine content(mg/kg)" FROM table_66320 WHERE "Samples failed" > '1' AND "Product" = '英雄牌嬰幼兒配方乳粉'
SELECT "Melamine content(mg/kg)" FROM "table_66320" WHERE "Product" = '英雄牌嬰幼兒配方乳粉' AND "Samples failed" > '1'
0.106445
CREATE TABLE table_47672 ("Team 1" TEXT, "Agg." TEXT, "Team 2" TEXT, "1st leg" TEXT, "2nd leg" TEXT)
What is 1st Leg, when 2nd Leg is 1-3?
SELECT "1st leg" FROM table_47672 WHERE "2nd leg" = '1-3'
SELECT "1st leg" FROM "table_47672" WHERE "2nd leg" = '1-3'
0.057617
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
how many patients below 89 years of age followed the procedure open biopsy of soft tissue?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "89" AND procedures.long_title = "Open biopsy of soft tissue"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Open biopsy of soft tissue" = "procedures"."long_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "89" > "demographic"."age"
0.226563
CREATE TABLE table_44440 ("Driver" TEXT, "Team" TEXT, "Laps" TEXT, "Time/Retired" TEXT, "Grid" TEXT, "Laps Led" TEXT, "Points" TEXT)
How many laps have 50 points?
SELECT "Laps" FROM table_44440 WHERE "Points" = '50'
SELECT "Laps" FROM "table_44440" WHERE "Points" = '50'
0.052734
CREATE TABLE table_30949 ("Rd." FLOAT, "Grand Prix" TEXT, "Pole Position" TEXT, "Fastest Lap" TEXT, "Winning Driver" TEXT, "Constructor" TEXT, "Report" TEXT)
What was the constructor in the Belgian Grand Prix round?
SELECT "Constructor" FROM table_30949 WHERE "Grand Prix" = 'Belgian Grand Prix'
SELECT "Constructor" FROM "table_30949" WHERE "Grand Prix" = 'Belgian Grand Prix'
0.079102
CREATE TABLE university (School_ID INT, School TEXT, Location TEXT, Founded FLOAT, Affiliation TEXT, Enrollment FLOAT, Nickname TEXT, Primary_conference TEXT) CREATE TABLE basketball_match (Team_ID INT, School_ID INT, Team_Name TEXT, ACC_Regular_Season TEXT, ACC_Percent TEXT, ACC_Home TEXT, ACC_Road TEXT, All_Games TEXT, All_Games_Percent INT, All_Home TEXT, All_Road TEXT, All_Neutral TEXT)
Show me about the correlation between Team_ID and All_Games_Percent , and group by attribute All_Games in a scatter chart.
SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY All_Games
SELECT "Team_ID", "All_Games_Percent" FROM "basketball_match" GROUP BY "All_Games"
0.080078
CREATE TABLE table_8207 ("Region" TEXT, "Date" TEXT, "Label" TEXT, "Format" TEXT, "Version" TEXT)
What is the Version of the CD release?
SELECT "Version" FROM table_8207 WHERE "Format" = 'cd'
SELECT "Version" FROM "table_8207" WHERE "Format" = 'cd'
0.054688
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime 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 diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT) 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 allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL) 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 intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
has patient 016-18150 excreted the output amt-blake drain during a month before?
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18150')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'output amt-blake drain' AND DATETIME(intakeoutput.intakeoutputtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month')
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '016-18150' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "intakeoutput" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = 'output amt-blake drain' AND "intakeoutput"."cellpath" LIKE '%output%' AND DATETIME("intakeoutput"."intakeoutputtime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') AND NOT "_u_1"."" IS NULL
0.711914
CREATE TABLE candidate (Candidate_ID INT, People_ID INT, Poll_Source TEXT, Date TEXT, Support_rate FLOAT, Consider_rate FLOAT, Oppose_rate FLOAT, Unsure_rate FLOAT) CREATE TABLE people (People_ID INT, Sex TEXT, Name TEXT, Date_of_Birth TEXT, Height FLOAT, Weight FLOAT)
Give me a bar chart for sum weight of each sex
SELECT Sex, SUM(Weight) FROM people GROUP BY Sex
SELECT "Sex", SUM("Weight") FROM "people" GROUP BY "Sex"
0.054688
CREATE TABLE table_name_33 (date VARCHAR, opponents VARCHAR)
What date was georgie stoop emily webley-smith the opponent?
SELECT date FROM table_name_33 WHERE opponents = "georgie stoop emily webley-smith"
SELECT "date" FROM "table_name_33" WHERE "georgie stoop emily webley-smith" = "opponents"
0.086914
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE 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)
what is the number of patients whose diagnoses icd9 code is 5856?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "5856"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "5856" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id"
0.168945
CREATE TABLE appellations (no DECIMAL, appelation TEXT, county TEXT, state TEXT, area TEXT, isava TEXT) CREATE TABLE wine (no DECIMAL, grape TEXT, winery TEXT, appelation TEXT, state TEXT, name TEXT, year DECIMAL, price DECIMAL, score DECIMAL, cases DECIMAL, drink TEXT) CREATE TABLE grapes (id DECIMAL, grape TEXT, color TEXT)
Give the distinct names of wines made before 2000 or after 2010.
SELECT DISTINCT name FROM wine WHERE year < 2000 OR year > 2010
SELECT DISTINCT "name" FROM "wine" WHERE "year" < 2000 OR "year" > 2010
0.069336
CREATE TABLE table_74625 ("Total tenure rank" FLOAT, "Uninterrupted rank" FLOAT, "Name" TEXT, "Total tenure time" TEXT, "Uninterrupted time" TEXT)
How many uninterrupted ranks does john dingell have?
SELECT COUNT("Uninterrupted rank") FROM table_74625 WHERE "Name" = 'john dingell'
SELECT COUNT("Uninterrupted rank") FROM "table_74625" WHERE "Name" = 'john dingell'
0.081055
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title 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 patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod 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 diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) 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_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 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 chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom 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)
what was the first mchc value in patient 433 in a month before?
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 433) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mchc') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY labevents.charttime LIMIT 1
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 433 GROUP BY "hadm_id"), "_u_1" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'mchc' GROUP BY "itemid") SELECT "labevents"."valuenum" FROM "labevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "labevents"."hadm_id" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "labevents"."itemid" WHERE DATETIME("labevents"."charttime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') AND NOT "_u_0"."" IS NULL AND NOT "_u_1"."" IS NULL ORDER BY "labevents"."charttime" NULLS FIRST LIMIT 1
0.614258
CREATE TABLE table_10169 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Date" TEXT)
What is the home team score when the away team was fitzroy?
SELECT "Home team score" FROM table_10169 WHERE "Away team" = 'fitzroy'
SELECT "Home team score" FROM "table_10169" WHERE "Away team" = 'fitzroy'
0.071289
CREATE TABLE Products (Code INT, Name VARCHAR, Price DECIMAL, Manufacturer INT) CREATE TABLE Manufacturers (Code INT, Name VARCHAR, Headquarter VARCHAR, Founder VARCHAR, Revenue FLOAT)
For those records from the products and each product's manufacturer, a bar chart shows the distribution of headquarter and the average of code , and group by attribute headquarter, sort Y-axis from high to low order.
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC
SELECT "T2"."Headquarter", "T1"."Code" FROM "Products" AS "T1" JOIN "Manufacturers" AS "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "T2"."Headquarter" ORDER BY "T1"."Code" DESC NULLS LAST
0.188477
CREATE TABLE party (Party_ID INT, Minister TEXT, Took_office TEXT, Left_office TEXT, Region_ID INT, Party_name TEXT) CREATE TABLE party_events (Event_ID INT, Event_Name TEXT, Party_ID INT, Member_in_charge_ID INT) CREATE TABLE region (Region_ID INT, Region_name TEXT, Date TEXT, Label TEXT, Format TEXT, Catalogue TEXT) CREATE TABLE member (Member_ID INT, Member_Name TEXT, Party_ID TEXT, In_office TEXT)
Give me a histogram for how many members are in each party?, display by the Y from low to high.
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*)
SELECT "Party_name", COUNT(*) FROM "member" AS "T1" JOIN "party" AS "T2" ON "T1"."Party_ID" = "T2"."Party_ID" GROUP BY "T1"."Party_ID" ORDER BY COUNT(*) NULLS FIRST
0.160156
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
provide the number of patients whose diagnoses long title is candidiasis of mouth and lab test fluid is blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Candidiasis of mouth" AND lab.fluid = "Blood"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Candidiasis of mouth" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "lab" ON "Blood" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id"
0.267578
CREATE TABLE table_name_96 (home VARCHAR, score VARCHAR)
What home has 122-28 as the score?
SELECT home FROM table_name_96 WHERE score = "122-28"
SELECT "home" FROM "table_name_96" WHERE "122-28" = "score"
0.057617
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT) CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime 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 intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL) 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)
what is five of the most frequent intake until 2104?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) <= '2104' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5
WITH "t1" AS (SELECT "intakeoutput"."celllabel", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "intakeoutput" WHERE "intakeoutput"."cellpath" LIKE '%intake%' AND STRFTIME('%y', "intakeoutput"."intakeoutputtime") <= '2104' GROUP BY "intakeoutput"."celllabel") SELECT "t1"."celllabel" FROM "t1" AS "t1" WHERE "t1"."c1" <= 5
0.333984
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 student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR) CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT) CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT) CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR) CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR) CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT) CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT) CREATE TABLE gsi (course_offering_id INT, student_id INT) CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT) CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR) CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR) CREATE TABLE area (course_id INT, area VARCHAR) CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR) CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR) CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR) CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR) CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
ENSCEN 171 can be taken at the moment ?
SELECT COUNT(*) > 0 FROM course, course_offering, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ENSCEN' AND course.number = 171 AND offering_instructor.offering_id = course_offering.offering_id AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016
SELECT COUNT(*) > 0 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 "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'WN' AND "semester"."year" = 2016 WHERE "course"."department" = 'ENSCEN' AND "course"."number" = 171
0.40625
CREATE TABLE table_57929 ("Episode" TEXT, "Air Date" TEXT, "Rating" FLOAT, "Share" FLOAT, "Rating/Share 18\\u201349" TEXT, "Viewers ( m ) " FLOAT, "Timeslot Rank" FLOAT, "Night Rank" TEXT, "Overall Rank" FLOAT)
What is the rating of the episode with 13.47 million viewers and overall rank larger than 6?
SELECT SUM("Rating") FROM table_57929 WHERE "Viewers (m)" = '13.47' AND "Overall Rank" > '6'
SELECT SUM("Rating") FROM "table_57929" WHERE "Overall Rank" > '6' AND "Viewers (m)" = '13.47'
0.091797
CREATE TABLE table_70047 ("Rank" FLOAT, "Mountain Peak" TEXT, "Province" TEXT, "Mountain Range" TEXT, "Location" TEXT)
Name the province with rank more than 49
SELECT "Province" FROM table_70047 WHERE "Rank" > '49'
SELECT "Province" FROM "table_70047" WHERE "Rank" > '49'
0.054688
CREATE TABLE table_53392 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
What away team had a score of 14.14 (98)?
SELECT "Away team" FROM table_53392 WHERE "Away team score" = '14.14 (98)'
SELECT "Away team" FROM "table_53392" WHERE "Away team score" = '14.14 (98)'
0.074219
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR) CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR) CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT) CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT) CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR) CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT) CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR) CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR) CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT) CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT) CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR) CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR) CREATE TABLE area (course_id INT, area VARCHAR) CREATE TABLE gsi (course_offering_id INT, student_id INT) CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR) CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname 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 program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
Which courses is Prof. Matthew Ronfeldt teaching ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Matthew Ronfeldt%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id
SELECT DISTINCT "course"."department", "course"."name", "course"."number" 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 "instructor"."name" LIKE '%Matthew Ronfeldt%'
0.396484
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) 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)
what is the number of patients whose gender is m and diagnoses long title is dysthymic disorder?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Dysthymic disorder"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Dysthymic disorder" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "M" = "demographic"."gender"
0.217773
CREATE TABLE table_59423 ("Geelong FL" TEXT, "Wins" FLOAT, "Byes" FLOAT, "Losses" FLOAT, "Draws" FLOAT, "Against" FLOAT)
What is the largest number of draws of St Josephs with losses greater than 6 and less than 1250 against?
SELECT MAX("Draws") FROM table_59423 WHERE "Losses" > '6' AND "Geelong FL" = 'st josephs' AND "Against" < '1250'
SELECT MAX("Draws") FROM "table_59423" WHERE "Against" < '1250' AND "Geelong FL" = 'st josephs' AND "Losses" > '6'
0.111328
CREATE TABLE table_68056 ("Tournament" TEXT, "1999" TEXT, "2002" TEXT, "2004" TEXT, "2006" TEXT, "2007" TEXT, "2010" TEXT, "2011" TEXT, "2012" TEXT)
What is the 2007 value with a 2r in 2012 and 1r in 2002?
SELECT "2007" FROM table_68056 WHERE "2012" = '2r' AND "2002" = '1r'
SELECT "2007" FROM "table_68056" WHERE "2002" = '1r' AND "2012" = '2r'
0.068359
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE 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)
give me the number of patients whose admission year is less than 2184 and lab test fluid is ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2184" AND lab.fluid = "Ascites"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Ascites" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "2184" > "demographic"."admityear"
0.19043
CREATE TABLE route (train_id INT, station_id INT) CREATE TABLE train (id INT, train_number INT, name TEXT, origin TEXT, destination TEXT, time TEXT, interval TEXT) CREATE TABLE weekly_weather (station_id INT, day_of_week TEXT, high_temperature INT, low_temperature INT, precipitation FLOAT, wind_speed_mph INT) CREATE TABLE station (id INT, network_name TEXT, services TEXT, local_authority TEXT)
Find the number of trains starting from each origin Plot them as bar chart, and sort bar in ascending order.
SELECT origin, COUNT(*) FROM train GROUP BY origin ORDER BY origin
SELECT "origin", COUNT(*) FROM "train" GROUP BY "origin" ORDER BY "origin" NULLS FIRST
0.083984
CREATE TABLE table_test_30 ("id" INT, "ejection_fraction_ef" INT, "multiple_long_bone_fractures" BOOLEAN, "extracellular_volume_expansion" BOOLEAN, "pregnancy_or_lactation" BOOLEAN, "bleeding" INT, "serum_potassium" FLOAT, "prosthetic_heart_valve" BOOLEAN, "hbg" INT, "anticoagulation" BOOLEAN, "incomplete_spinal_cord_injury" BOOLEAN, "complex_pelvic_fractures" BOOLEAN, "ascites" BOOLEAN, "gcs" INT, "urine_output" INT, "hyperkalemia" BOOLEAN, "head_injury" BOOLEAN, "operative_area" BOOLEAN, "trauma" BOOLEAN, "renal_disease" BOOLEAN, "metal_sensitivity" BOOLEAN, "para" BOOLEAN, "creatinine_clearance_cl" FLOAT, "mental_illness" BOOLEAN, "estimated_glomerular_filtration_rate_egfr" INT, "pulmonary_rales" BOOLEAN, "edema" BOOLEAN, "platelet_count" FLOAT, "inadequate_tissue_coverage" BOOLEAN, "associated_long_bone_fractures" BOOLEAN, "pe" BOOLEAN, "long_term_anticoagulation" INT, "pitting" BOOLEAN, "injury_patterns" BOOLEAN, "spinal_infection" BOOLEAN, "jugular_venous_distention" BOOLEAN, "serum_sodium_concentration" INT, "previous_hemorrhagic_stroke" BOOLEAN, "orthopedic" BOOLEAN, "kidney_disease" BOOLEAN, "open_wounds" BOOLEAN, "quadriplegia" BOOLEAN, "chronic_warfarin_therapy" BOOLEAN, "chest_x_ray" BOOLEAN, "inflammation" BOOLEAN, "morbid_obesity" BOOLEAN, "iv_furosemide" INT, "cardiomyopathy" BOOLEAN, "atrial_flutter" BOOLEAN, "alcohol_abuse" BOOLEAN, "aortic" BOOLEAN, "mitral" BOOLEAN, "atrial_fibrillation" BOOLEAN, "drug_abuse" BOOLEAN, "foreign_body_sensitivity" BOOLEAN, "venous_thromboembolic_disease" BOOLEAN, "chronic_anticoagulation" BOOLEAN, "myocardial_infarction" BOOLEAN, "dvt" BOOLEAN, "NOUSE" FLOAT)
known reduced kidney function with estimated glomerular filtration rate ( gfr ) < 30 ml / min / 1.73 m2.
SELECT * FROM table_test_30 WHERE kidney_disease = 1 AND estimated_glomerular_filtration_rate_egfr < 30
SELECT * FROM "table_test_30" WHERE "estimated_glomerular_filtration_rate_egfr" < 30 AND "kidney_disease" = 1
0.106445
CREATE TABLE mediatype (mediatypeid DECIMAL, name TEXT) CREATE TABLE invoice (invoiceid DECIMAL, customerid DECIMAL, invoicedate TIME, billingaddress TEXT, billingcity TEXT, billingstate TEXT, billingcountry TEXT, billingpostalcode TEXT, total DECIMAL) CREATE TABLE album (albumid DECIMAL, title TEXT, artistid DECIMAL) CREATE TABLE playlist (playlistid DECIMAL, name TEXT) CREATE TABLE track (trackid DECIMAL, name TEXT, albumid DECIMAL, mediatypeid DECIMAL, genreid DECIMAL, composer TEXT, milliseconds DECIMAL, bytes DECIMAL, unitprice DECIMAL) CREATE TABLE playlisttrack (playlistid DECIMAL, trackid DECIMAL) CREATE TABLE genre (genreid DECIMAL, name TEXT) CREATE TABLE customer (customerid DECIMAL, firstname TEXT, lastname TEXT, company TEXT, address TEXT, city TEXT, state TEXT, country TEXT, postalcode TEXT, phone TEXT, fax TEXT, email TEXT, supportrepid DECIMAL) CREATE TABLE artist (artistid DECIMAL, name TEXT) CREATE TABLE invoiceline (invoicelineid DECIMAL, invoiceid DECIMAL, trackid DECIMAL, unitprice DECIMAL, quantity DECIMAL) CREATE TABLE employee (employeeid DECIMAL, lastname TEXT, firstname TEXT, title TEXT, reportsto DECIMAL, birthdate TIME, hiredate TIME, address TEXT, city TEXT, state TEXT, country TEXT, postalcode TEXT, phone TEXT, fax TEXT, email TEXT)
Find all the customer last names that do not have invoice totals larger than 20.
SELECT lastname FROM customer EXCEPT SELECT T1.lastname FROM customer AS T1 JOIN invoice AS T2 ON T1.customerid = T2.customerid WHERE T2.total > 20
SELECT "lastname" FROM "customer" EXCEPT SELECT "T1"."lastname" FROM "customer" AS "T1" JOIN "invoice" AS "T2" ON "T1"."customerid" = "T2"."customerid" AND "T2"."total" > 20
0.168945
CREATE TABLE table_name_49 (ends INT, name VARCHAR)
What is the lowest ends for Dani Alves?
SELECT MIN(ends) FROM table_name_49 WHERE name = "dani alves"
SELECT MIN("ends") FROM "table_name_49" WHERE "dani alves" = "name"
0.06543
CREATE TABLE on_call (nurse DECIMAL, blockfloor DECIMAL, blockcode DECIMAL, oncallstart TIME, oncallend TIME) CREATE TABLE nurse (employeeid DECIMAL, name TEXT, position TEXT, registered BOOLEAN, ssn DECIMAL) CREATE TABLE department (departmentid DECIMAL, name TEXT, head DECIMAL) CREATE TABLE block (blockfloor DECIMAL, blockcode DECIMAL) CREATE TABLE medication (code DECIMAL, name TEXT, brand TEXT, description TEXT) CREATE TABLE trained_in (physician DECIMAL, treatment DECIMAL, certificationdate TIME, certificationexpires TIME) CREATE TABLE prescribes (physician DECIMAL, patient DECIMAL, medication DECIMAL, date TIME, appointment DECIMAL, dose TEXT) CREATE TABLE procedures (code DECIMAL, name TEXT, cost DECIMAL) CREATE TABLE stay (stayid DECIMAL, patient DECIMAL, room DECIMAL, staystart TIME, stayend TIME) CREATE TABLE patient (ssn DECIMAL, name TEXT, address TEXT, phone TEXT, insuranceid DECIMAL, pcp DECIMAL) CREATE TABLE undergoes (patient DECIMAL, procedures DECIMAL, stay DECIMAL, dateundergoes TIME, physician DECIMAL, assistingnurse DECIMAL) CREATE TABLE appointment (appointmentid DECIMAL, patient DECIMAL, prepnurse DECIMAL, physician DECIMAL, start TIME, end TIME, examinationroom TEXT) CREATE TABLE affiliated_with (physician DECIMAL, department DECIMAL, primaryaffiliation BOOLEAN) CREATE TABLE physician (employeeid DECIMAL, name TEXT, position TEXT, ssn DECIMAL) CREATE TABLE room (roomnumber DECIMAL, roomtype TEXT, blockfloor DECIMAL, blockcode DECIMAL, unavailable BOOLEAN)
Which physicians prescribe a medication of brand X? Tell me the name and position of those physicians.
SELECT DISTINCT T1.name, T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.brand = "X"
SELECT DISTINCT "T1"."name", "T1"."position" FROM "physician" AS "T1" JOIN "prescribes" AS "T2" ON "T1"."employeeid" = "T2"."physician" JOIN "medication" AS "T3" ON "T2"."medication" = "T3"."code" AND "T3"."brand" = "X"
0.213867
CREATE TABLE table_79250 ("Location" TEXT, "Year" TEXT, "Champion" TEXT, "Runner-up" TEXT, "Score" TEXT, "Name" TEXT)
Who was runner-up in the 2006 Pacific Life Open?
SELECT "Runner-up" FROM table_79250 WHERE "Name" = 'pacific life open' AND "Year" = '2006'
SELECT "Runner-up" FROM "table_79250" WHERE "Name" = 'pacific life open' AND "Year" = '2006'
0.089844
CREATE TABLE table_56127 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
What was the smallest crowd of vfl park?
SELECT MIN("Crowd") FROM table_56127 WHERE "Venue" = 'vfl park'
SELECT MIN("Crowd") FROM "table_56127" WHERE "Venue" = 'vfl park'
0.063477
CREATE TABLE table_29566686_1 (clubs_remaining INT, leagues_entering_at_this_round VARCHAR)
What is the maximum number of clubs remaining when the league entering at this round was allsvenskan?
SELECT MIN(clubs_remaining) FROM table_29566686_1 WHERE leagues_entering_at_this_round = "Allsvenskan"
SELECT MIN("clubs_remaining") FROM "table_29566686_1" WHERE "Allsvenskan" = "leagues_entering_at_this_round"
0.105469
CREATE TABLE table_58741 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" FLOAT, "Results" TEXT)
What is the lowest First Elected, when Party is 'Republican', and when District is 'Minnesota 1'?
SELECT MIN("First elected") FROM table_58741 WHERE "Party" = 'republican' AND "District" = 'minnesota 1'
SELECT MIN("First elected") FROM "table_58741" WHERE "District" = 'minnesota 1' AND "Party" = 'republican'
0.103516
CREATE TABLE table_204_772 (id DECIMAL, "team" TEXT, "county" TEXT, "wins" DECIMAL, "years won" DECIMAL)
what is the total of wins on the chart
SELECT SUM("wins") FROM table_204_772
SELECT SUM("wins") FROM "table_204_772"
0.038086
CREATE TABLE table_16919 ("Date" TEXT, "Tournament" TEXT, "Location" TEXT, "Purse ( $ ) " FLOAT, "Winner" TEXT, "Score" TEXT, "1st Prize ( $ ) " FLOAT)
Name the tournament for arizona
SELECT "Tournament" FROM table_16919 WHERE "Location" = 'Arizona'
SELECT "Tournament" FROM "table_16919" WHERE "Location" = 'Arizona'
0.06543
CREATE TABLE captain (Captain_ID INT, Name TEXT, Ship_ID INT, age TEXT, Class TEXT, Rank TEXT) CREATE TABLE Ship (Ship_ID INT, Name TEXT, Type TEXT, Built_Year FLOAT, Class TEXT, Flag TEXT)
Compare the total number of different ranks using a bar graph, could you order X in desc order?
SELECT Rank, COUNT(Rank) FROM captain GROUP BY Rank ORDER BY Rank DESC
SELECT "Rank", COUNT("Rank") FROM "captain" GROUP BY "Rank" ORDER BY "Rank" DESC NULLS LAST
0.088867
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title 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 procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) 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 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 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 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 microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name 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 inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
what are the five most common laboratory tests that a patient had during the same hospital visit after being diagnosed with jt contracture-jt nec in 2105?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'jt contracture-jt nec') AND STRFTIME('%y', diagnoses_icd.charttime) = '2105') AS t1 JOIN (SELECT admissions.subject_id, labevents.itemid, labevents.charttime, admissions.hadm_id FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', labevents.charttime) = '2105') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id GROUP BY t2.itemid) AS t3 WHERE t3.c1 <= 5)
WITH "t2" AS (SELECT "admissions"."subject_id", "labevents"."itemid", "labevents"."charttime", "admissions"."hadm_id" FROM "labevents" JOIN "admissions" ON "admissions"."hadm_id" = "labevents"."hadm_id" WHERE STRFTIME('%y', "labevents"."charttime") = '2105'), "t3" AS (SELECT "t2"."itemid", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'jt contracture-jt nec' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" JOIN "t2" AS "t2" ON "admissions"."hadm_id" = "t2"."hadm_id" AND "admissions"."subject_id" = "t2"."subject_id" AND "diagnoses_icd"."charttime" < "t2"."charttime" WHERE STRFTIME('%y', "diagnoses_icd"."charttime") = '2105' GROUP BY "t2"."itemid"), "_u_1" AS (SELECT "t3"."itemid" FROM "t3" AS "t3" WHERE "t3"."c1" <= 5 GROUP BY "itemid") SELECT "d_labitems"."label" FROM "d_labitems" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "d_labitems"."itemid" WHERE NOT "_u_1"."" IS NULL
1.041992
CREATE TABLE table_204_228 (id DECIMAL, "year" DECIMAL, "title" TEXT, "credit" TEXT, "role" TEXT, "notes" TEXT)
what is the only film for which seth was director and screenwriter ?
SELECT "title" FROM table_204_228 WHERE "credit" = 'director and screenwriter'
SELECT "title" FROM "table_204_228" WHERE "credit" = 'director and screenwriter'
0.078125
CREATE TABLE table_name_93 (tournament VARCHAR)
During the Hamburg Masters Tournament, during which Ji Nov k was absent(A) in 1998, how did he do in 1997?
SELECT 1997 FROM table_name_93 WHERE 1998 = "a" AND tournament = "hamburg masters"
SELECT 1997 FROM "table_name_93" WHERE "a" = 1998 AND "hamburg masters" = "tournament"
0.083984
CREATE TABLE table_name_24 (venue VARCHAR, goal VARCHAR)
What is the Venue for Goal number 1?
SELECT venue FROM table_name_24 WHERE goal = 1
SELECT "venue" FROM "table_name_24" WHERE "goal" = 1
0.050781
CREATE TABLE table_75896 ("Television service" TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "HDTV" TEXT, "Package/Option" TEXT)
What shows as Content for the Television service of nickelodeon +1?
SELECT "Content" FROM table_75896 WHERE "Television service" = 'nickelodeon +1'
SELECT "Content" FROM "table_75896" WHERE "Television service" = 'nickelodeon +1'
0.079102
CREATE TABLE campuses (campus VARCHAR, YEAR VARCHAR)
Which campus was opened between 1935 and 1939?
SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939
SELECT "campus" FROM "campuses" WHERE "YEAR" <= 1939 AND "YEAR" >= 1935
0.069336
CREATE TABLE table_18600760_7 (pop__2010_ VARCHAR, county VARCHAR, geo_id VARCHAR)
In Cavalier County and the geo id is larger than 3801931620.0, what is the population?
SELECT pop__2010_ FROM table_18600760_7 WHERE county = "Cavalier" AND geo_id > 3801931620.0
SELECT "pop__2010_" FROM "table_18600760_7" WHERE "Cavalier" = "county" AND "geo_id" > 3801931620.0
0.09668
CREATE TABLE table_name_8 (saturday VARCHAR, thursday VARCHAR)
Which Saturday has a Thursday of mokuy bi
SELECT saturday FROM table_name_8 WHERE thursday = "木曜日 mokuyōbi"
SELECT "saturday" FROM "table_name_8" WHERE "thursday" = "木曜日 mokuyōbi"
0.069336
CREATE TABLE table_name_54 (nominated_work VARCHAR, year INT)
Tell me the nominated work larger than 2011
SELECT nominated_work FROM table_name_54 WHERE year > 2011
SELECT "nominated_work" FROM "table_name_54" WHERE "year" > 2011
0.0625
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId 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 Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) 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 PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId 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 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 VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description 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 TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description 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 ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
get posts of specific tags.
SELECT * FROM Posts AS p INNER JOIN PostTags AS pt1 ON p.Id = pt1.PostId INNER JOIN PostTags AS pt2 ON p.Id = pt2.PostId WHERE pt1.TagId = 17 AND pt2.TagId = 942
SELECT * FROM "Posts" AS "p" JOIN "PostTags" AS "pt1" ON "p"."Id" = "pt1"."PostId" AND "pt1"."TagId" = 17 JOIN "PostTags" AS "pt2" ON "p"."Id" = "pt2"."PostId" AND "pt2"."TagId" = 942
0.178711
CREATE TABLE table_47040 ("Tournament" TEXT, "1990" TEXT, "1991" TEXT, "1992" TEXT, "1993" TEXT, "1994" TEXT, "1995" TEXT, "1996" TEXT, "1997" TEXT, "1998" TEXT, "1999" TEXT, "2000" TEXT, "2001" TEXT, "Career SR" TEXT, "Career Win-Loss" TEXT)
Which tournament had a 1994 finish of RR and 1996 and 1998 finishes of A?
SELECT "Tournament" FROM table_47040 WHERE "1996" = 'a' AND "1998" = 'a' AND "1994" = 'rr'
SELECT "Tournament" FROM "table_47040" WHERE "1994" = 'rr' AND "1996" = 'a' AND "1998" = 'a'
0.089844
CREATE TABLE table_36754 ("Position" FLOAT, "Team" TEXT, "Points" FLOAT, "Played" FLOAT, "Drawn" FLOAT, "Lost" FLOAT, "Against" FLOAT, "Difference" TEXT)
How many Lost have Points larger than 40, and a Position of 11, and a Played smaller than 38?
SELECT SUM("Lost") FROM table_36754 WHERE "Points" > '40' AND "Position" = '11' AND "Played" < '38'
SELECT SUM("Lost") FROM "table_36754" WHERE "Played" < '38' AND "Points" > '40' AND "Position" = '11'
0.098633
CREATE TABLE Manufacturers (Code INT, Name VARCHAR, Headquarter VARCHAR, Founder VARCHAR, Revenue FLOAT) CREATE TABLE Products (Code INT, Name VARCHAR, Price DECIMAL, Manufacturer INT)
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and revenue , and group by attribute headquarter, display by the bars in asc.
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name
SELECT "T1"."Name", "T2"."Revenue" FROM "Products" AS "T1" JOIN "Manufacturers" AS "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "Headquarter", "T1"."Name" ORDER BY "T1"."Name" NULLS FIRST
0.188477
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) 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)
what is maximum age of patients whose death status is 0 and age is greater than or equal to 64?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.age >= "64"
SELECT MAX("demographic"."age") FROM "demographic" WHERE "0" = "demographic"."expire_flag" AND "64" <= "demographic"."age"
0.119141
CREATE TABLE table_44580 ("Season" TEXT, "Zone" FLOAT, "Champion" TEXT, "Second" TEXT, "Third" TEXT, "Top scorer" TEXT)
Which Zone has a Champion of surozh sudak?
SELECT SUM("Zone") FROM table_44580 WHERE "Champion" = 'surozh sudak'
SELECT SUM("Zone") FROM "table_44580" WHERE "Champion" = 'surozh sudak'
0.069336
CREATE TABLE table_58315 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
When did the away team score 12.14 (86)?
SELECT "Date" FROM table_58315 WHERE "Away team score" = '12.14 (86)'
SELECT "Date" FROM "table_58315" WHERE "Away team score" = '12.14 (86)'
0.069336
CREATE TABLE table_name_59 (record VARCHAR, date VARCHAR)
What record has September 21 as the date?
SELECT record FROM table_name_59 WHERE date = "september 21"
SELECT "record" FROM "table_name_59" WHERE "date" = "september 21"
0.064453
CREATE TABLE table_42250 ("Event" TEXT, "Record" TEXT, "Nation" TEXT, "Date" TEXT, "Venue" TEXT)
Which Nation has a Record of 15.16 m?
SELECT "Nation" FROM table_42250 WHERE "Record" = '15.16 m'
SELECT "Nation" FROM "table_42250" WHERE "Record" = '15.16 m'
0.05957
CREATE TABLE table_30538 ("Season" TEXT, "Sport" TEXT, "Tournament Structure" TEXT, "# of Divisions" FLOAT, "1st Tournament" FLOAT, "2011-2012 State Tournament Location" TEXT)
Where was the 2011-2012 soccer state tournament held?
SELECT "2011-2012 State Tournament Location" FROM table_30538 WHERE "Sport" = 'Soccer'
SELECT "2011-2012 State Tournament Location" FROM "table_30538" WHERE "Sport" = 'Soccer'
0.085938
CREATE TABLE table_name_7 (city_of_license VARCHAR, call_sign VARCHAR)
Name the city of license for call sign of k215es
SELECT city_of_license FROM table_name_7 WHERE call_sign = "k215es"
SELECT "city_of_license" FROM "table_name_7" WHERE "call_sign" = "k215es"
0.071289
CREATE TABLE table_name_63 (nationality___opponent VARCHAR, competition VARCHAR, result VARCHAR)
Name the Nationality / Opponent of the Competition of welsh rugby union challenge trophy and a Result of 38-29?
SELECT nationality___opponent FROM table_name_63 WHERE competition = "welsh rugby union challenge trophy" AND result = "38-29"
SELECT "nationality___opponent" FROM "table_name_63" WHERE "38-29" = "result" AND "competition" = "welsh rugby union challenge trophy"
0.130859
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description 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 PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId 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 PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE VoteTypes (Id DECIMAL, Name 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) 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 TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description 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 PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE ReviewTaskTypes (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 PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description 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)
A day accounted for 'How Unsung Am I?'.
SELECT COUNT(answer.Id) AS "accepted_answers", SUM(CASE WHEN answer.Score = 0 THEN 0 ELSE 1 END) AS "scored_answers", SUM(CASE WHEN answer.Score = 0 THEN 1 ELSE 0 END) AS "unscored_answers", SUM(CASE WHEN answer.Score = 0 THEN 1 ELSE 0 END) * 1000 / COUNT(answer.Id) / 10.0 AS "percentage_unscored" FROM Posts AS question INNER JOIN Posts AS answer ON answer.Id = question.AcceptedAnswerId WHERE answer.CommunityOwnedDate IS NULL AND answer.OwnerUserId = '##UserId##' AND question.OwnerUserId != '##UserId##' AND answer.PostTypeId = 2 AND answer.CreationDate < CURRENT_TIMESTAMP()
SELECT COUNT("answer"."Id") AS "accepted_answers", SUM(CASE WHEN "answer"."Score" = 0 THEN 0 ELSE 1 END) AS "scored_answers", SUM(CASE WHEN "answer"."Score" = 0 THEN 1 ELSE 0 END) AS "unscored_answers", SUM(CASE WHEN "answer"."Score" = 0 THEN 1 ELSE 0 END) * 1000 / NULLIF(COUNT("answer"."Id"), 0) / NULLIF(10.0, 0) AS "percentage_unscored" FROM "Posts" AS "question" JOIN "Posts" AS "answer" ON "answer"."CommunityOwnedDate" IS NULL AND "answer"."CreationDate" < CURRENT_TIMESTAMP() AND "answer"."Id" = "question"."AcceptedAnswerId" AND "answer"."OwnerUserId" = '##UserId##' AND "answer"."PostTypeId" = 2 WHERE "question"."OwnerUserId" <> '##UserId##'
0.636719
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
provide the duration of hospital stay and death status of subject id 17519.
SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "17519"
SELECT "demographic"."days_stay", "demographic"."expire_flag" FROM "demographic" WHERE "17519" = "demographic"."subject_id"
0.120117
CREATE TABLE table_10420426_1 (wins VARCHAR, series VARCHAR, team VARCHAR)
What is the number of wins for gp2 series for racing engineering?
SELECT COUNT(wins) FROM table_10420426_1 WHERE series = "GP2 series" AND team = "Racing Engineering"
SELECT COUNT("wins") FROM "table_10420426_1" WHERE "GP2 series" = "series" AND "Racing Engineering" = "team"
0.105469
CREATE TABLE table_16727 ("Rnd" FLOAT, "Race" TEXT, "Date" TEXT, "Location" TEXT, "Pole Position" TEXT, "Fastest Lap" TEXT, "Race Winner" TEXT, "Constructor" TEXT, "Report" TEXT)
What is the pole position for the race with the fastest lap by Nelson Piquet and the constructor is Ferrari?
SELECT "Pole Position" FROM table_16727 WHERE "Fastest Lap" = 'Nelson Piquet' AND "Constructor" = 'Ferrari'
SELECT "Pole Position" FROM "table_16727" WHERE "Constructor" = 'Ferrari' AND "Fastest Lap" = 'Nelson Piquet'
0.106445
CREATE TABLE table_13186 ("Date" TEXT, "Ship" TEXT, "Tonnage" TEXT, "Nationality" TEXT, "Fate" TEXT)
Which Fate has a Tonnage of 7,217?
SELECT "Fate" FROM table_13186 WHERE "Tonnage" = '7,217'
SELECT "Fate" FROM "table_13186" WHERE "Tonnage" = '7,217'
0.056641
CREATE TABLE paperfield (fieldid INT, paperid INT) CREATE TABLE paperdataset (paperid INT, datasetid INT) CREATE TABLE field (fieldid INT) CREATE TABLE paper (paperid INT, title VARCHAR, venueid INT, year INT, numciting INT, numcitedby INT, journalid INT) CREATE TABLE cite (citingpaperid INT, citedpaperid INT) CREATE TABLE dataset (datasetid INT, datasetname VARCHAR) CREATE TABLE paperkeyphrase (paperid INT, keyphraseid INT) CREATE TABLE journal (journalid INT, journalname VARCHAR) CREATE TABLE writes (paperid INT, authorid INT) CREATE TABLE venue (venueid INT, venuename VARCHAR) CREATE TABLE keyphrase (keyphraseid INT, keyphrasename VARCHAR) CREATE TABLE author (authorid INT, authorname VARCHAR)
what year was the first deep learning paper published ?
SELECT DISTINCT dataset.datasetid, paper.year FROM dataset, keyphrase, paper, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'deep learning' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid AND paper.paperid = paperdataset.paperid ORDER BY paper.year
SELECT DISTINCT "dataset"."datasetid", "paper"."year" FROM "dataset" JOIN "paperdataset" ON "dataset"."datasetid" = "paperdataset"."datasetid" JOIN "paper" ON "paper"."paperid" = "paperdataset"."paperid" JOIN "paperkeyphrase" ON "paperdataset"."paperid" = "paperkeyphrase"."paperid" JOIN "keyphrase" ON "keyphrase"."keyphraseid" = "paperkeyphrase"."keyphraseid" AND "keyphrase"."keyphrasename" = 'deep learning' ORDER BY "paper"."year" NULLS FIRST
0.436523
CREATE TABLE table_name_17 (week INT, points_against VARCHAR, points_for VARCHAR, opponent VARCHAR)
Which Week has Points For larger than 19, and an Opponent of philadelphia eagles, and Points Against larger than 7?
SELECT MAX(week) FROM table_name_17 WHERE points_for > 19 AND opponent = "philadelphia eagles" AND points_against > 7
SELECT MAX("week") FROM "table_name_17" WHERE "opponent" = "philadelphia eagles" AND "points_against" > 7 AND "points_for" > 19
0.124023
CREATE TABLE table_11207040_5 (lowest INT, stadium VARCHAR)
What is the lowest attandance recorded at Cappielow?
SELECT MIN(lowest) FROM table_11207040_5 WHERE stadium = "Cappielow"
SELECT MIN("lowest") FROM "table_11207040_5" WHERE "Cappielow" = "stadium"
0.072266
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT) CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME) CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) 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 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 treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
what are the five most frequent intakes?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5
WITH "t1" AS (SELECT "intakeoutput"."celllabel", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "intakeoutput" WHERE "intakeoutput"."cellpath" LIKE '%intake%' GROUP BY "intakeoutput"."celllabel") SELECT "t1"."celllabel" FROM "t1" AS "t1" WHERE "t1"."c1" <= 5
0.271484
CREATE TABLE table_57033 ("Date" TEXT, "Tournament" TEXT, "Location" TEXT, "Purse ( $ ) " FLOAT, "Winner" TEXT, "Score" TEXT, "1st Prize ( $ ) " FLOAT)
For the gte northwest classic with the score of 207 (-9), what is the average 1st prize ($)
SELECT AVG("1st Prize( $ )") FROM table_57033 WHERE "Score" = '207 (-9)' AND "Tournament" = 'gte northwest classic'
SELECT AVG("1st Prize( $ )") FROM "table_57033" WHERE "Score" = '207 (-9)' AND "Tournament" = 'gte northwest classic'
0.114258
CREATE TABLE artwork (Id VARCHAR)
How many artworks are there?
SELECT COUNT(*) FROM artwork
SELECT COUNT(*) FROM "artwork"
0.029297
CREATE TABLE table_name_20 (silver VARCHAR, nation VARCHAR, gold VARCHAR, total VARCHAR)
How many silver medals did Estonia, which won more than 1 gold and less than 97 medals total, win?
SELECT silver FROM table_name_20 WHERE gold > 1 AND total < 97 AND nation = "estonia"
SELECT "silver" FROM "table_name_20" WHERE "estonia" = "nation" AND "gold" > 1 AND "total" < 97
0.092773
CREATE TABLE table_6154 ("Medal" TEXT, "Name" TEXT, "Games" TEXT, "Sport" TEXT, "Event" TEXT)
What team played in the 1964 Tokyo Games?
SELECT "Name" FROM table_6154 WHERE "Games" = '1964 tokyo'
SELECT "Name" FROM "table_6154" WHERE "Games" = '1964 tokyo'
0.058594
CREATE TABLE table_1566848_6 (pictorials VARCHAR, date VARCHAR)
Name the number of pictorials for 5-85
SELECT COUNT(pictorials) FROM table_1566848_6 WHERE date = "5-85"
SELECT COUNT("pictorials") FROM "table_1566848_6" WHERE "5-85" = "date"
0.069336
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 PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) 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 PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId 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 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 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 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 ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment 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 Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
Number of questions concerning xamarin development.
SELECT COUNT(*) FROM Posts WHERE Id IN (SELECT DISTINCT (PostId) FROM PostTags WHERE TagId IN (SELECT Id FROM Tags WHERE TagName LIKE '%xamarin%'))
SELECT COUNT(*) FROM "Posts" WHERE "Id" IN (SELECT DISTINCT "PostId" FROM "PostTags" WHERE "TagId" IN (SELECT "Id" FROM "Tags" WHERE "TagName" LIKE '%xamarin%'))
0.157227
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 CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) 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 ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId 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 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 FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) 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 PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE PostTypes (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 ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense 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 PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
TIO Languages by Popularity [BROKEN].
SELECT SUBSTRING(Body, PATINDEX('%http://*.tryitonline.net', Body) + 7, STR_POSITION(Body, '.', PATINDEX('%http://*.tryitonline.net', Body)) - PATINDEX('%http://*.tryitonline.net', Body) + 6) AS Language, COUNT(*) AS Frequency FROM Posts WHERE PostTypeId = 2 GROUP BY SUBSTRING(Body, PATINDEX('%http://*.tryitonline.net', Body) + 7, STR_POSITION(Body, '.', PATINDEX('%http://*.tryitonline.net', Body)) - PATINDEX('%http://*.tryitonline.net', Body) + 6)
SELECT SUBSTRING("Body", PATINDEX('%http://*.tryitonline.net', "Body") + 7, POSITION('.', "Body", PATINDEX('%http://*.tryitonline.net', "Body")) - PATINDEX('%http://*.tryitonline.net', "Body") + 6) AS "Language", COUNT(*) AS "Frequency" FROM "Posts" WHERE "PostTypeId" = 2 GROUP BY SUBSTRING("Body", PATINDEX('%http://*.tryitonline.net', "Body") + 7, POSITION('.', "Body", PATINDEX('%http://*.tryitonline.net', "Body")) - PATINDEX('%http://*.tryitonline.net', "Body") + 6)
0.460938
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
count the number of patients whose admission type is elective and ethnicity is hispanic/latino - puerto rican
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "ELECTIVE" = "demographic"."admission_type" AND "HISPANIC/LATINO - PUERTO RICAN" = "demographic"."ethnicity"
0.178711
CREATE TABLE table_name_93 (score VARCHAR, date VARCHAR)
What is the score for the game that was played on 29-Jun-2009?
SELECT score FROM table_name_93 WHERE date = "29-jun-2009"
SELECT "score" FROM "table_name_93" WHERE "29-jun-2009" = "date"
0.0625
CREATE TABLE table_60908 ("Shooter" TEXT, "Event" TEXT, "Rank points" TEXT, "Score points" TEXT, "Total" TEXT)
Who's the shooter with a total of 25?
SELECT "Shooter" FROM table_60908 WHERE "Total" = '25'
SELECT "Shooter" FROM "table_60908" WHERE "Total" = '25'
0.054688
CREATE TABLE table_name_13 (state VARCHAR, city VARCHAR)
What state is the city of Ruston in?
SELECT state FROM table_name_13 WHERE city = "ruston"
SELECT "state" FROM "table_name_13" WHERE "city" = "ruston"
0.057617
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL) 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 diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT) 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 treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime 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 allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
what was the time of patient 002-52932's first laboratory test when they visited the hospital first time?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-52932' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)) ORDER BY lab.labresulttime LIMIT 1
SELECT "lab"."labresulttime" FROM "lab" WHERE "lab"."patientunitstayid" IN (SELECT "patient"."patientunitstayid" FROM "patient" WHERE "patient"."patienthealthsystemstayid" IN (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '002-52932' AND NOT "patient"."hospitaldischargetime" IS NULL ORDER BY "patient"."hospitaladmittime" NULLS FIRST LIMIT 1)) ORDER BY "lab"."labresulttime" NULLS FIRST LIMIT 1
0.428711
CREATE TABLE candidate (people_id VARCHAR, support_rate INT, oppose_rate VARCHAR) CREATE TABLE people (name VARCHAR, people_id VARCHAR)
Find the names of the candidates whose support percentage is lower than their oppose rate.
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate
SELECT "t1"."name" FROM "people" AS "t1" JOIN "candidate" AS "t2" ON "t1"."people_id" = "t2"."people_id" AND "t2"."oppose_rate" > "t2"."support_rate"
0.145508
CREATE TABLE table_23835213_2 (df VARCHAR, adam_hinshelwood VARCHAR)
What is the df when Adam Hinshelwood is Junior Mendes?
SELECT df FROM table_23835213_2 WHERE adam_hinshelwood = "Junior Mendes"
SELECT "df" FROM "table_23835213_2" WHERE "Junior Mendes" = "adam_hinshelwood"
0.076172
CREATE TABLE table_19113 ("Club" TEXT, "Played" TEXT, "Won" TEXT, "Drawn" TEXT, "Lost" TEXT, "Points for" TEXT, "Points against" TEXT, "Tries for" TEXT, "Tries against" TEXT, "Try bonus" TEXT, "Losing bonus" TEXT, "Points" TEXT)
what's the lost with club being colwyn bay rfc
SELECT "Lost" FROM table_19113 WHERE "Club" = 'Colwyn Bay RFC'
SELECT "Lost" FROM "table_19113" WHERE "Club" = 'Colwyn Bay RFC'
0.0625
CREATE TABLE domain (did INT, name VARCHAR) CREATE TABLE conference (cid INT, homepage VARCHAR, name VARCHAR) CREATE TABLE domain_author (aid INT, did INT) CREATE TABLE journal (homepage VARCHAR, jid INT, name VARCHAR) CREATE TABLE writes (aid INT, pid INT) CREATE TABLE domain_journal (did INT, jid INT) CREATE TABLE domain_conference (cid INT, did INT) CREATE TABLE domain_keyword (did INT, kid 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_publication (did INT, pid INT) CREATE TABLE cite (cited INT, citing 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 publication_keyword (kid INT, pid INT) CREATE TABLE keyword (keyword VARCHAR, kid INT)
return me all the papers in VLDB conference in ' University of Michigan ' .
SELECT publication.title FROM author, conference, organization, publication, writes WHERE conference.name = 'VLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid
SELECT "publication"."title" FROM "author" JOIN "conference" ON "conference"."name" = 'VLDB' JOIN "organization" ON "author"."oid" = "organization"."oid" AND "organization"."name" = 'University of Michigan' JOIN "publication" ON "conference"."cid" = "publication"."cid" JOIN "writes" ON "author"."aid" = "writes"."aid" AND "publication"."pid" = "writes"."pid"
0.350586
CREATE TABLE table_8856 ("Pick" FLOAT, "Player" TEXT, "Position" TEXT, "Nationality" TEXT, "Former Team" TEXT)
Which Player has a Pick larger than 2, and a Position of forward?
SELECT "Player" FROM table_8856 WHERE "Pick" > '2' AND "Position" = 'forward'
SELECT "Player" FROM "table_8856" WHERE "Pick" > '2' AND "Position" = 'forward'
0.077148
CREATE TABLE table_name_47 (make VARCHAR, car__number VARCHAR)
What is the make of car 31?
SELECT make FROM table_name_47 WHERE car__number = 31
SELECT "make" FROM "table_name_47" WHERE "car__number" = 31
0.057617
CREATE TABLE table_name_3 (home_team VARCHAR, venue VARCHAR)
What was the home team score for the game played at Princes Park?
SELECT home_team AS score FROM table_name_3 WHERE venue = "princes park"
SELECT "home_team" AS "score" FROM "table_name_3" WHERE "princes park" = "venue"
0.078125
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT) CREATE TABLE area (course_id INT, area VARCHAR) CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT) CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT) CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR) CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR) CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR) CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR) CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR) CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR) CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category 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 program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR) CREATE TABLE gsi (course_offering_id INT, student_id INT) CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT) CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR) CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
Can I take 792 when ?
SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 792 AND course_offering.semester = semester.semester_id AND semester.semester_id > (SELECT SEMESTERalias1.semester_id FROM semester AS SEMESTERalias1 WHERE SEMESTERalias1.semester = 'WN' AND SEMESTERalias1.year = 2016) ORDER BY semester.semester_id LIMIT 1
SELECT DISTINCT "semester"."semester", "semester"."year" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" JOIN "semester" AS "SEMESTERalias1" ON "SEMESTERalias1"."semester" = 'WN' AND "SEMESTERalias1"."semester_id" < "semester"."semester_id" AND "SEMESTERalias1"."year" = 2016 WHERE "course"."department" = 'EECS' AND "course"."number" = 792 ORDER BY "semester"."semester_id" NULLS FIRST LIMIT 1
0.501953
CREATE TABLE table_name_17 (school VARCHAR, colors VARCHAR)
What School has Colors of navy blue orange?
SELECT school FROM table_name_17 WHERE colors = "navy blue orange"
SELECT "school" FROM "table_name_17" WHERE "colors" = "navy blue orange"
0.070313