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_79 (visitor VARCHAR, home VARCHAR, date VARCHAR)
What visitor has detroit red wings as the home, and march 30 as the date?
SELECT visitor FROM table_name_79 WHERE home = "detroit red wings" AND date = "march 30"
SELECT "visitor" FROM "table_name_79" WHERE "date" = "march 30" AND "detroit red wings" = "home"
0.09375
CREATE TABLE table_204_23 (id DECIMAL, "#" DECIMAL, "wrestlers" TEXT, "reign" DECIMAL, "date" TEXT, "days held" DECIMAL, "location" TEXT, "event" TEXT, "notes" TEXT)
how many days did hardcore tv # 6 take ?
SELECT "days held" FROM table_204_23 WHERE "event" = 'hardcore tv #6'
SELECT "days held" FROM "table_204_23" WHERE "event" = 'hardcore tv #6'
0.069336
CREATE TABLE Accounts (account_id VARCHAR, account_name VARCHAR) CREATE TABLE Financial_transactions (account_id VARCHAR)
How many transaction does account with name 337 have?
SELECT COUNT(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id WHERE T2.account_name = "337"
SELECT COUNT(*) FROM "Financial_transactions" AS "T1" JOIN "Accounts" AS "T2" ON "337" = "T2"."account_name" AND "T1"."account_id" = "T2"."account_id"
0.146484
CREATE TABLE wine (No INT, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INT, Price INT, Score INT, Cases INT, Drink TEXT) CREATE TABLE grapes (ID INT, Grape TEXT, Color TEXT) CREATE TABLE appellations (No INT, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT)
How many wines are there for each grape, and show x-axis from high to low order.
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape DESC
SELECT "Grape", COUNT(*) FROM "wine" GROUP BY "Grape" ORDER BY "Grape" DESC NULLS LAST
0.083984
CREATE TABLE table_79166 ("Enzyme" TEXT, "Location" TEXT, "Substrate" TEXT, "Product" TEXT, "Chromosome" TEXT, "OMIM" FLOAT, "Porphyria" TEXT)
What is the location of the enzyme Uroporphyrinogen iii Synthase?
SELECT "Location" FROM table_79166 WHERE "Enzyme" = 'uroporphyrinogen iii synthase'
SELECT "Location" FROM "table_79166" WHERE "Enzyme" = 'uroporphyrinogen iii synthase'
0.083008
CREATE TABLE table_53220 ("Rank" TEXT, "Nation" TEXT, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
What is the lowest gold medals of a rank 12 team?
SELECT MIN("Gold") FROM table_53220 WHERE "Rank" = '12'
SELECT MIN("Gold") FROM "table_53220" WHERE "Rank" = '12'
0.055664
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)
how many patients whose marital status is widowed and procedure icd9 code is 4610?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.icd9_code = "4610"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "4610" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "WIDOWED" = "demographic"."marital_status"
0.219727
CREATE TABLE table_name_12 (Id VARCHAR)
Name the 1901 with 1851 of 1961
SELECT 1901 FROM table_name_12 WHERE 1851 = "1961"
SELECT 1901 FROM "table_name_12" WHERE "1961" = 1851
0.050781
CREATE TABLE table_50186 ("Year" FLOAT, "Starts" FLOAT, "Wins" FLOAT, "Top 5" FLOAT, "Top 10" FLOAT, "Poles" FLOAT, "Avg. Start" FLOAT, "Avg. Finish" TEXT, "Winnings" TEXT, "Position" TEXT, "Team ( s ) " TEXT)
Can you tell me the Wins that has the Starts larger than 1, and the Top 5 of 3?
SELECT "Wins" FROM table_50186 WHERE "Starts" > '1' AND "Top 5" = '3'
SELECT "Wins" FROM "table_50186" WHERE "Starts" > '1' AND "Top 5" = '3'
0.069336
CREATE TABLE table_name_28 (margin_of_victory VARCHAR, date VARCHAR)
What was the margin of victory on Apr 8, 1979?
SELECT margin_of_victory FROM table_name_28 WHERE date = "apr 8, 1979"
SELECT "margin_of_victory" FROM "table_name_28" WHERE "apr 8, 1979" = "date"
0.074219
CREATE TABLE table_68095 ("Year" FLOAT, "Group" TEXT, "Award" TEXT, "Film/Show" TEXT, "Result" TEXT)
What is the average Year that has the Group, Logie Award, the Award, Most Outstanding Actor, and the Result, nominated?
SELECT AVG("Year") FROM table_68095 WHERE "Group" = 'logie award' AND "Award" = 'most outstanding actor' AND "Result" = 'nominated'
SELECT AVG("Year") FROM "table_68095" WHERE "Award" = 'most outstanding actor' AND "Group" = 'logie award' AND "Result" = 'nominated'
0.129883
CREATE TABLE table_train_209 ("id" INT, "body_weight" FLOAT, "diabetic" TEXT, "lactose_intolerance" BOOLEAN, "galactose_intolerance" BOOLEAN, "allergy_to_food" BOOLEAN, "body_mass_index_bmi" FLOAT, "a1c" FLOAT, "NOUSE" FLOAT)
lactose or galactose intolerance
SELECT * FROM table_train_209 WHERE lactose_intolerance = 1 OR galactose_intolerance = 1
SELECT * FROM "table_train_209" WHERE "galactose_intolerance" = 1 OR "lactose_intolerance" = 1
0.091797
CREATE TABLE table_29545336_2 (directed_by VARCHAR, no VARCHAR)
How many people directed episode 2?
SELECT COUNT(directed_by) FROM table_29545336_2 WHERE no = 2
SELECT COUNT("directed_by") FROM "table_29545336_2" WHERE "no" = 2
0.064453
CREATE TABLE table_52771 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Location" TEXT, "Final Score" TEXT, "Attendance" TEXT, "Record" TEXT)
What was the record for a week below 13 on July 12?
SELECT "Record" FROM table_52771 WHERE "Week" < '13' AND "Date" = 'july 12'
SELECT "Record" FROM "table_52771" WHERE "Date" = 'july 12' AND "Week" < '13'
0.075195
CREATE TABLE table_2749 ("Season" FLOAT, "Winner" TEXT, "Captain" TEXT, "Coach" TEXT, "League finish" TEXT, "Mat" FLOAT, "W" FLOAT, "L" FLOAT, "Win %" TEXT, "Runner-up" TEXT)
Name the least season for trevor bayliss
SELECT MIN("Season") FROM table_2749 WHERE "Coach" = 'Trevor Bayliss'
SELECT MIN("Season") FROM "table_2749" WHERE "Coach" = 'Trevor Bayliss'
0.069336
CREATE TABLE table_name_64 (Away INT, matches VARCHAR, no_result VARCHAR, losses VARCHAR)
What is the sum of Away Losses with a No Result of more than 0, losses of more than 6, and matches of more than 91?
SELECT SUM(Away) AS losses FROM table_name_64 WHERE no_result > 0 AND losses > 6 AND matches > 91
SELECT SUM("Away") AS "losses" FROM "table_name_64" WHERE "losses" > 6 AND "matches" > 91 AND "no_result" > 0
0.106445
CREATE TABLE Customer_Orders (order_id INT, customer_id INT, order_status VARCHAR, order_date DATETIME, order_details VARCHAR) CREATE TABLE Customer_Addresses (customer_id INT, address_id INT, date_address_from DATETIME, address_type VARCHAR, date_address_to DATETIME) CREATE TABLE Addresses (address_id INT, address_content VARCHAR, city VARCHAR, zip_postcode VARCHAR, state_province_county VARCHAR, country VARCHAR, other_address_details VARCHAR) CREATE TABLE Customer_Contact_Channels (customer_id INT, channel_code VARCHAR, active_from_date DATETIME, active_to_date DATETIME, contact_number VARCHAR) CREATE TABLE Customers (customer_id INT, payment_method VARCHAR, customer_name VARCHAR, date_became_customer DATETIME, other_customer_details VARCHAR) CREATE TABLE Products (product_id INT, product_details VARCHAR) CREATE TABLE Order_Items (order_id INT, product_id INT, order_quantity VARCHAR)
Return a bar chart showing the proportion of the number of orders that have the status 'Delivered' for each customer name.
SELECT customer_name, COUNT(customer_name) FROM Customers AS t1 JOIN Customer_Orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered" GROUP BY customer_name
SELECT "customer_name", COUNT("customer_name") FROM "Customers" AS "t1" JOIN "Customer_Orders" AS "t2" ON "t1"."customer_id" = "t2"."customer_id" WHERE "Delivered" = "order_status" GROUP BY "customer_name"
0.200195
CREATE TABLE table_22407 ("Episode" TEXT, "Garfield Episode 1" TEXT, "U.S. Acres Episode" TEXT, "Garfield Episode 2" TEXT, "Original Airdate" TEXT)
What is the garfield episode 2 when episode 1 is 'change of mind'?
SELECT "Garfield Episode 2" FROM table_22407 WHERE "Garfield Episode 1" = 'Change Of Mind'
SELECT "Garfield Episode 2" FROM "table_22407" WHERE "Garfield Episode 1" = 'Change Of Mind'
0.089844
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 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 inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount 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 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 icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
patient 10431 has excreted any gu irrigant/urine volume out until 62 months ago?
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10431)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gu irrigant/urine volume out' AND d_items.linksto = 'outputevents') AND DATETIME(outputevents.charttime) <= DATETIME(CURRENT_TIME(), '-62 month')
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 10431 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'gu irrigant/urine volume out' AND "d_items"."linksto" = 'outputevents' GROUP BY "itemid") SELECT COUNT(*) > 0 FROM "outputevents" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "outputevents"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "outputevents"."itemid" WHERE DATETIME("outputevents"."charttime") <= DATETIME(CURRENT_TIME(), '-62 month') AND NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL
0.759766
CREATE TABLE table_name_67 (city VARCHAR, short_name VARCHAR)
What city has the nickname of pontisola?
SELECT city FROM table_name_67 WHERE short_name = "pontisola"
SELECT "city" FROM "table_name_67" WHERE "pontisola" = "short_name"
0.06543
CREATE TABLE table_204_469 (id DECIMAL, "coach" TEXT, "years" TEXT, "seasons" DECIMAL, "wins" DECIMAL, "losses" DECIMAL, "ties" DECIMAL, "pct" DECIMAL)
who coached more seasons : ed sabre or mack erwin ?
SELECT "coach" FROM table_204_469 WHERE "coach" IN ('ed sabre', 'mack erwin') ORDER BY "seasons" DESC LIMIT 1
SELECT "coach" FROM "table_204_469" WHERE "coach" IN ('ed sabre', 'mack erwin') ORDER BY "seasons" DESC NULLS LAST LIMIT 1
0.119141
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE diagnoses_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 microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto 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 outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL) CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT) CREATE TABLE 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 cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
how many patients passed away within 2 months after they were diagnosed with asthma nos w (ac) exac?
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime 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 = 'asthma nos w (ac) exac')) AS t1 GROUP BY t1.subject_id HAVING MIN(t1.charttime) = t1.charttime) AS t2 JOIN (SELECT patients.subject_id, admissions.hadm_id, patients.dod FROM admissions JOIN patients ON patients.subject_id = admissions.subject_id WHERE NOT patients.dod IS NULL) AS t3 ON t2.subject_id = t3.subject_id WHERE (DATETIME(t3.dod) BETWEEN DATETIME(t2.charttime) AND DATETIME(t2.charttime, '+2 month')) OR (DATETIME(t2.charttime) BETWEEN DATETIME(t3.dod) AND DATETIME(t3.dod, '+2 month'))
WITH "t2" AS (SELECT "admissions"."subject_id", "diagnoses_icd"."charttime" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'asthma nos w (ac) exac' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" GROUP BY "admissions"."subject_id" HAVING "diagnoses_icd"."charttime" = MIN("diagnoses_icd"."charttime")), "t3" AS (SELECT "patients"."subject_id", "patients"."dod" FROM "admissions" JOIN "patients" ON "admissions"."subject_id" = "patients"."subject_id" AND NOT "patients"."dod" IS NULL) SELECT COUNT(DISTINCT "t2"."subject_id") FROM "t2" AS "t2" JOIN "t3" AS "t3" ON "t2"."subject_id" = "t3"."subject_id" AND ((DATETIME("t2"."charttime") <= DATETIME("t3"."dod") AND DATETIME("t2"."charttime", '+2 month') >= DATETIME("t3"."dod")) OR (DATETIME("t2"."charttime") <= DATETIME("t3"."dod", '+2 month') AND DATETIME("t2"."charttime") >= DATETIME("t3"."dod"))) WHERE (DATETIME("t2"."charttime") <= DATETIME("t3"."dod") AND DATETIME("t2"."charttime", '+2 month') >= DATETIME("t3"."dod")) OR (DATETIME("t2"."charttime") <= DATETIME("t3"."dod", '+2 month') AND DATETIME("t2"."charttime") >= DATETIME("t3"."dod"))
1.192383
CREATE TABLE table_name_85 (away_team VARCHAR, home_team VARCHAR)
What away team score has carlton home team?
SELECT away_team AS score FROM table_name_85 WHERE home_team = "carlton"
SELECT "away_team" AS "score" FROM "table_name_85" WHERE "carlton" = "home_team"
0.078125
CREATE TABLE member (member_id DECIMAL, card_number TEXT, name TEXT, hometown TEXT, level DECIMAL) CREATE TABLE branch (branch_id DECIMAL, name TEXT, open_year TEXT, address_road TEXT, city TEXT, membership_amount TEXT) CREATE TABLE membership_register_branch (member_id DECIMAL, branch_id TEXT, register_year TEXT) CREATE TABLE purchase (member_id DECIMAL, branch_id TEXT, year TEXT, total_pounds DECIMAL)
Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.
SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.hometown = 'Louisville , Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.hometown = 'Hiram , Georgia'
SELECT "T2"."name" FROM "membership_register_branch" AS "T1" JOIN "branch" AS "T2" ON "T1"."branch_id" = "T2"."branch_id" JOIN "member" AS "T3" ON "T1"."member_id" = "T3"."member_id" AND "T3"."hometown" = 'Louisville , Kentucky' INTERSECT SELECT "T2"."name" FROM "membership_register_branch" AS "T1" JOIN "branch" AS "T2" ON "T1"."branch_id" = "T2"."branch_id" JOIN "member" AS "T3" ON "T1"."member_id" = "T3"."member_id" AND "T3"."hometown" = 'Hiram , Georgia'
0.452148
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
provide the age and gender of gus marques.
SELECT demographic.age, demographic.gender FROM demographic WHERE demographic.name = "Gus Marques"
SELECT "demographic"."age", "demographic"."gender" FROM "demographic" WHERE "Gus Marques" = "demographic"."name"
0.109375
CREATE TABLE table_59016 ("Date" TEXT, "Venue" TEXT, "Score" TEXT, "Result" TEXT, "Competition" TEXT)
What is the result at Dreisamstadion, Freiburg?
SELECT "Result" FROM table_59016 WHERE "Venue" = 'dreisamstadion, freiburg'
SELECT "Result" FROM "table_59016" WHERE "Venue" = 'dreisamstadion, freiburg'
0.075195
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 the number of patients whose primary disease is ruq pain and age is less than 71?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.age < "71"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "71" > "demographic"."age" AND "RUQ PAIN" = "demographic"."diagnosis"
0.140625
CREATE TABLE table_name_93 (organization VARCHAR, finish VARCHAR)
Which organization has a Finish of 4th?
SELECT organization FROM table_name_93 WHERE finish = "4th"
SELECT "organization" FROM "table_name_93" WHERE "4th" = "finish"
0.063477
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR) CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR) CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR) CREATE TABLE area (course_id INT, area VARCHAR) CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT) CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT) CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT) CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT) CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR) CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR) CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR) CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT) CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT) CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR) CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR) CREATE TABLE 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 gsi (course_offering_id INT, student_id INT)
Over next semester , what classes is Dr. Kevin Carney teaching ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Kevin Carney%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
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 "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'FA' AND "semester"."year" = 2016 JOIN "instructor" ON "instructor"."instructor_id" = "offering_instructor"."instructor_id" AND "instructor"."name" LIKE '%Kevin Carney%'
0.526367
CREATE TABLE table_name_97 (played INT, team VARCHAR)
What is the highest amount of plays for fluminense?
SELECT MAX(played) FROM table_name_97 WHERE team = "fluminense"
SELECT MAX("played") FROM "table_name_97" WHERE "fluminense" = "team"
0.067383
CREATE TABLE table_name_11 (country VARCHAR, place VARCHAR, player VARCHAR)
Which Country has a Place of t8 and byron nelson?
SELECT country FROM table_name_11 WHERE place = "t8" AND player = "byron nelson"
SELECT "country" FROM "table_name_11" WHERE "byron nelson" = "player" AND "place" = "t8"
0.085938
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 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 PostTags (PostId DECIMAL, TagId DECIMAL) 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 ReviewTaskResultTypes (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 PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT) CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL) CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description 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 PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
User with highest number of comments.
SELECT COUNT(a.Id), a.PostId, b.Score, b.Title FROM Comments AS a INNER JOIN Posts AS b ON b.Id = a.PostId WHERE a.CreationDate >= '8/1/2018' GROUP BY a.PostId, b.Score, b.Title ORDER BY COUNT(a.Id) DESC LIMIT 100
SELECT COUNT("a"."Id"), "a"."PostId", "b"."Score", "b"."Title" FROM "Comments" AS "a" JOIN "Posts" AS "b" ON "a"."PostId" = "b"."Id" WHERE "a"."CreationDate" >= '8/1/2018' GROUP BY "a"."PostId", "b"."Score", "b"."Title" ORDER BY COUNT("a"."Id") DESC NULLS LAST LIMIT 100
0.263672
CREATE TABLE table_name_43 (lost INT, played INT)
What is the highest number of losses when there are under 1 games played?
SELECT MAX(lost) FROM table_name_43 WHERE played < 1
SELECT MAX("lost") FROM "table_name_43" WHERE "played" < 1
0.056641
CREATE TABLE table_202_72 (id DECIMAL, "year" DECIMAL, "single" TEXT, "chart" TEXT, "position" DECIMAL)
which singles each appear at position 22 ?
SELECT "single" FROM table_202_72 WHERE "position" = 22
SELECT "single" FROM "table_202_72" WHERE "position" = 22
0.055664
CREATE TABLE table_name_5 (score VARCHAR, team_2 VARCHAR)
What was the score of team 2 Stade Lavallois (D1)?
SELECT score FROM table_name_5 WHERE team_2 = "stade lavallois (d1)"
SELECT "score" FROM "table_name_5" WHERE "stade lavallois (d1)" = "team_2"
0.072266
CREATE TABLE table_name_53 (verb_meaning VARCHAR, part_1 VARCHAR)
what is the verb meaning when the part 1 is lopen?
SELECT verb_meaning FROM table_name_53 WHERE part_1 = "lopen"
SELECT "verb_meaning" FROM "table_name_53" WHERE "lopen" = "part_1"
0.06543
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
count the number of patients whose discharge location is home and diagnoses long title is anxiety state, unspecified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "HOME" AND diagnoses.long_title = "Anxiety state, unspecified"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Anxiety state, unspecified" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "HOME" = "demographic"."discharge_location"
0.240234
CREATE TABLE table_203_531 (id DECIMAL, "date" TEXT, "tournament" TEXT, "location" TEXT, "winner" TEXT, "score" TEXT, "1st prize ( $ ) " DECIMAL)
which tournament rewarded the most money for first prize ?
SELECT "tournament" FROM table_203_531 ORDER BY "1st prize ($)" DESC LIMIT 1
SELECT "tournament" FROM "table_203_531" ORDER BY "1st prize ($)" DESC NULLS LAST LIMIT 1
0.086914
CREATE TABLE table_43082 ("Usage" TEXT, "Sn/Sb ( % ) " TEXT, "Liquid at ( \\u00b0C ) " TEXT, "Casting at ( \\u00b0C ) " TEXT, "Remelting at ( \\u00b0C ) " TEXT, "Hardness" TEXT)
What is the Sn/Sb percentage that is liquid at 258 degrees C?
SELECT "Sn/Sb (%)" FROM table_43082 WHERE "Liquid at (\u00b0C)" = '258'
SELECT "Sn/Sb (%)" FROM "table_43082" WHERE "Liquid at (\u00b0C)" = '258'
0.071289
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
what is gender of subject id 17787?
SELECT demographic.gender FROM demographic WHERE demographic.subject_id = "17787"
SELECT "demographic"."gender" FROM "demographic" WHERE "17787" = "demographic"."subject_id"
0.088867
CREATE TABLE table_75459 ("High School" TEXT, "Location" TEXT, "Founded" FLOAT, "Affiliation" TEXT, "Enrollment" FLOAT, "Nickname" TEXT, "Division" TEXT)
What is the affiliation of a location called Issaquah?
SELECT "Affiliation" FROM table_75459 WHERE "Location" = 'issaquah'
SELECT "Affiliation" FROM "table_75459" WHERE "Location" = 'issaquah'
0.067383
CREATE TABLE table_name_52 (date VARCHAR, tournament VARCHAR)
what is the date for the tournament jou -l s-tours?
SELECT date FROM table_name_52 WHERE tournament = "joué-lès-tours"
SELECT "date" FROM "table_name_52" WHERE "joué-lès-tours" = "tournament"
0.070313
CREATE TABLE table_name_72 (season INT, races VARCHAR, podiums VARCHAR)
What is the earliest season with more than 14 races and more than 4 podiums?
SELECT MIN(season) FROM table_name_72 WHERE races > 14 AND podiums > 4
SELECT MIN("season") FROM "table_name_72" WHERE "podiums" > 4 AND "races" > 14
0.076172
CREATE TABLE table_76818 ("Model Number" TEXT, "Frequency" TEXT, "L2-Cache" TEXT, "Front Side Bus" TEXT, "Multiplier" TEXT, "Voltage" TEXT, "Socket" TEXT, "Release Date" TEXT)
What is the Release Date for Model Number c7 1.8?
SELECT "Release Date" FROM table_76818 WHERE "Model Number" = 'c7 1.8'
SELECT "Release Date" FROM "table_76818" WHERE "Model Number" = 'c7 1.8'
0.070313
CREATE TABLE table_27473 ("Team" TEXT, "Home city" TEXT, "Home ground" TEXT, "In Toppserien since" FLOAT, "First appearance" FLOAT, "Seasons" FLOAT)
What is the home ground for the team whose home city is Trondheim with 27 seasons?
SELECT "Home ground" FROM table_27473 WHERE "Seasons" = '27' AND "Home city" = 'Trondheim'
SELECT "Home ground" FROM "table_27473" WHERE "Home city" = 'Trondheim' AND "Seasons" = '27'
0.089844
CREATE TABLE table_30604 ("Player" TEXT, "Matches" FLOAT, "Innings" FLOAT, "Runs" FLOAT, "Average" TEXT, "Highest Score" FLOAT, "100s" FLOAT, "50s" FLOAT)
How many times has the 100s record been 1?
SELECT COUNT("Highest Score") FROM table_30604 WHERE "100s" = '1'
SELECT COUNT("Highest Score") FROM "table_30604" WHERE "100s" = '1'
0.06543
CREATE TABLE table_5858 ("District" FLOAT, "Incumbent" TEXT, "Party" TEXT, "Elected" FLOAT, "Status" TEXT)
What year was Incumbent Ed Towns elected with a district smaller than 10?
SELECT AVG("Elected") FROM table_5858 WHERE "Incumbent" = 'ed towns' AND "District" < '10'
SELECT AVG("Elected") FROM "table_5858" WHERE "District" < '10' AND "Incumbent" = 'ed towns'
0.089844
CREATE TABLE program (Program_ID INT, Name TEXT, Origin TEXT, Launch FLOAT, Owner TEXT) CREATE TABLE broadcast_share (Channel_ID INT, Program_ID INT, Date TEXT, Share_in_percent FLOAT) CREATE TABLE channel (Channel_ID INT, Name TEXT, Owner TEXT, Share_in_percent FLOAT, Rating_in_percent FLOAT) CREATE TABLE broadcast (Channel_ID INT, Program_ID INT, Time_of_day TEXT)
Show me a bar chart for what is the total rating of channel for each channel owner?, and show in ascending by the total number.
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY SUM(Rating_in_percent)
SELECT "Owner", SUM("Rating_in_percent") FROM "channel" GROUP BY "Owner" ORDER BY SUM("Rating_in_percent") NULLS FIRST
0.115234
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 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)
how many patients were administered drug via both eyes and have been admitted on an urgent basis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "BOTH EYES"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "BOTH EYES" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "URGENT" = "demographic"."admission_type"
0.228516
CREATE TABLE table_52988 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
What venue has a score of 14.15 (99) for away teams?
SELECT "Venue" FROM table_52988 WHERE "Away team score" = '14.15 (99)'
SELECT "Venue" FROM "table_52988" WHERE "Away team score" = '14.15 (99)'
0.070313
CREATE TABLE tracks (id DECIMAL, name TEXT, album_id DECIMAL, media_type_id DECIMAL, genre_id DECIMAL, composer TEXT, milliseconds DECIMAL, bytes DECIMAL, unit_price DECIMAL) CREATE TABLE customers (id DECIMAL, first_name TEXT, last_name TEXT, company TEXT, address TEXT, city TEXT, state TEXT, country TEXT, postal_code TEXT, phone TEXT, fax TEXT, email TEXT, support_rep_id DECIMAL) CREATE TABLE invoices (id DECIMAL, customer_id DECIMAL, invoice_date TIME, billing_address TEXT, billing_city TEXT, billing_state TEXT, billing_country TEXT, billing_postal_code TEXT, total DECIMAL) CREATE TABLE playlists (id DECIMAL, name TEXT) CREATE TABLE sqlite_sequence (name TEXT, seq TEXT) CREATE TABLE employees (id DECIMAL, last_name TEXT, first_name TEXT, title TEXT, reports_to DECIMAL, birth_date TIME, hire_date TIME, address TEXT, city TEXT, state TEXT, country TEXT, postal_code TEXT, phone TEXT, fax TEXT, email TEXT) CREATE TABLE artists (id DECIMAL, name TEXT) CREATE TABLE albums (id DECIMAL, title TEXT, artist_id DECIMAL) CREATE TABLE genres (id DECIMAL, name TEXT) CREATE TABLE invoice_lines (id DECIMAL, invoice_id DECIMAL, track_id DECIMAL, unit_price DECIMAL, quantity DECIMAL) CREATE TABLE playlist_tracks (playlist_id DECIMAL, track_id DECIMAL) CREATE TABLE media_types (id DECIMAL, name TEXT)
What are the names of all the media types?
SELECT name FROM media_types
SELECT "name" FROM "media_types"
0.03125
CREATE TABLE table_43201 ("s Member state" TEXT, "GDP 2012 millions of euro" TEXT, "Population in millions" FLOAT, "GDP ( PPP ) per capita 2012 euro" TEXT, "GDP ( Nominal ) per capita 2012 euro" TEXT, "GDP ( PPP ) per capita 2012 EU27 = 100" TEXT)
What is GDP 2012 Millions of Euro, when Population in Millions is less than 1.3, and when GDP (Nominal) Per Capita 2012 Euro is 20,700(p)?
SELECT "GDP 2012 millions of euro" FROM table_43201 WHERE "Population in millions" < '1.3' AND "GDP (Nominal) per capita 2012 euro" = '20,700(p)'
SELECT "GDP 2012 millions of euro" FROM "table_43201" WHERE "GDP (Nominal) per capita 2012 euro" = '20,700(p)' AND "Population in millions" < '1.3'
0.143555
CREATE TABLE table_22027 ("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)
Name the try bonus for lost being 11 and losing bonus is 6
SELECT "Try bonus" FROM table_22027 WHERE "Lost" = '11' AND "Losing bonus" = '6'
SELECT "Try bonus" FROM "table_22027" WHERE "Losing bonus" = '6' AND "Lost" = '11'
0.080078
CREATE TABLE table_name_87 (mountain_pass VARCHAR, rank VARCHAR)
What is the Mountain Pass with a 21 Rank?
SELECT mountain_pass FROM table_name_87 WHERE rank = 21
SELECT "mountain_pass" FROM "table_name_87" WHERE "rank" = 21
0.05957
CREATE TABLE table_4047 ("Team" TEXT, "Points per game" TEXT, "Rebounds per game" TEXT, "Assists per game" TEXT, "Steals per game" TEXT, "Minutes per game" TEXT, "Ranking per game" TEXT)
How many rebounds per game did Andrej D akovi average when playing 35 minutes per game?
SELECT "Rebounds per game" FROM table_4047 WHERE "Minutes per game" = '35'
SELECT "Rebounds per game" FROM "table_4047" WHERE "Minutes per game" = '35'
0.074219
CREATE TABLE table_16122 ("Year" FLOAT, "Division" FLOAT, "League" TEXT, "Regular Season" TEXT, "Playoffs" TEXT, "Open Cup" TEXT)
what are all the regular season where year is 2011
SELECT "Regular Season" FROM table_16122 WHERE "Year" = '2011'
SELECT "Regular Season" FROM "table_16122" WHERE "Year" = '2011'
0.0625
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 SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE PostHistoryTypes (Id DECIMAL, Name 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 VoteTypes (Id DECIMAL, Name TEXT) CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId 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 ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT) CREATE TABLE FlagTypes (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 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 PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other) CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) 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) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
Count questions not answered per tag count.
SELECT x.total, COUNT(x.Id), CAST(COUNT(x.Id) AS FLOAT) / (SELECT COUNT(Q.Id) FROM Posts AS Q WHERE Q.AnswerCount = 0 AND Q.PostTypeId = 1) FROM (SELECT Q.Id, COUNT(PT.TagId) AS total FROM Posts AS Q INNER JOIN PostTags AS PT ON Q.Id = PT.PostId WHERE Q.AnswerCount = 0 AND Q.PostTypeId = 1 GROUP BY Q.Id) AS x GROUP BY x.total
WITH "x" AS (SELECT "Q"."Id", COUNT("PT"."TagId") AS "total" FROM "Posts" AS "Q" JOIN "PostTags" AS "PT" ON "PT"."PostId" = "Q"."Id" WHERE "Q"."AnswerCount" = 0 AND "Q"."PostTypeId" = 1 GROUP BY "Q"."Id"), "_u_0" AS (SELECT COUNT("Q"."Id") FROM "Posts" AS "Q" WHERE "Q"."AnswerCount" = 0 AND "Q"."PostTypeId" = 1) SELECT "x"."total", COUNT("x"."Id"), CAST(COUNT("x"."Id") AS FLOAT) / NULLIF(MAX("_u_0".""), 0) FROM "x" AS "x" CROSS JOIN "_u_0" AS "_u_0" GROUP BY "x"."total"
0.462891
CREATE TABLE table_203_161 (id DECIMAL, "pos." TEXT, "div." DECIMAL, "no." DECIMAL, "team" TEXT, "drivers" TEXT, "car" TEXT, "laps" DECIMAL, "qual.\ pos." DECIMAL)
how many teams had less than five qualifying positions ?
SELECT COUNT("team") FROM table_203_161 WHERE "qual.\npos." < 5
SELECT COUNT("team") FROM "table_203_161" WHERE "qual.\npos." < 5
0.063477
CREATE TABLE table_name_10 (grid INT, constructor VARCHAR, time_retired VARCHAR)
What is the average grid number with a ferrari and a time or retired time of 1:32:35.101?
SELECT AVG(grid) FROM table_name_10 WHERE constructor = "ferrari" AND time_retired = "1:32:35.101"
SELECT AVG("grid") FROM "table_name_10" WHERE "1:32:35.101" = "time_retired" AND "constructor" = "ferrari"
0.103516
CREATE TABLE table_name_70 (score VARCHAR, loss VARCHAR)
What is the score when there was a Loss of birkbeck (0 3)?
SELECT score FROM table_name_70 WHERE loss = "birkbeck (0–3)"
SELECT "score" FROM "table_name_70" WHERE "birkbeck (0–3)" = "loss"
0.06543
CREATE TABLE table_name_69 (clock_multiplier VARCHAR, clock_speed VARCHAR, model_number VARCHAR)
Which Clock Multiplier has a Clock Speed of 1.6 ghz, and a Model Number of c7-m 764?
SELECT clock_multiplier FROM table_name_69 WHERE clock_speed = "1.6 ghz" AND model_number = "c7-m 764"
SELECT "clock_multiplier" FROM "table_name_69" WHERE "1.6 ghz" = "clock_speed" AND "c7-m 764" = "model_number"
0.107422
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime 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 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) 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 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)
when has patient 004-11006 first received a procedure since 2103?
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-11006')) AND STRFTIME('%y', treatment.treatmenttime) >= '2103' ORDER BY treatment.treatmenttime LIMIT 1
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '004-11006' 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 "treatment"."treatmenttime" FROM "treatment" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "treatment"."patientunitstayid" WHERE NOT "_u_1"."" IS NULL AND STRFTIME('%y', "treatment"."treatmenttime") >= '2103' ORDER BY "treatment"."treatmenttime" NULLS FIRST LIMIT 1
0.611328
CREATE TABLE table_name_76 (byes INT, wins VARCHAR, draws VARCHAR, mininera_dfl VARCHAR)
WHAT ARE THE BYES WITH A DRAWS OF 1, SMW ROVERS, AND WINS LARGER THAN 6?
SELECT AVG(byes) FROM table_name_76 WHERE draws = 1 AND mininera_dfl = "smw rovers" AND wins > 6
SELECT AVG("byes") FROM "table_name_76" WHERE "draws" = 1 AND "mininera_dfl" = "smw rovers" AND "wins" > 6
0.103516
CREATE TABLE table_name_93 (authority VARCHAR, name VARCHAR, gender VARCHAR, area VARCHAR)
In the tkkm o manawatu coed school in kelvin grove, what is the Authority listed/
SELECT authority FROM table_name_93 WHERE gender = "coed" AND area = "kelvin grove" AND name = "tkkm o manawatu"
SELECT "authority" FROM "table_name_93" WHERE "area" = "kelvin grove" AND "coed" = "gender" AND "name" = "tkkm o manawatu"
0.119141
CREATE TABLE table_31824 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Venue" TEXT, "Attendance" FLOAT, "Record" TEXT)
Tell mem the opponent for result of w 31-21
SELECT "Opponent" FROM table_31824 WHERE "Result" = 'w 31-21'
SELECT "Opponent" FROM "table_31824" WHERE "Result" = 'w 31-21'
0.061523
CREATE TABLE table_204_288 (id DECIMAL, "region" TEXT, "seed" DECIMAL, "team" TEXT, "coach" TEXT, "finished" TEXT, "final opponent" TEXT, "score" TEXT)
which team scored the least ?
SELECT "team" FROM table_204_288 ORDER BY "score" LIMIT 1
SELECT "team" FROM "table_204_288" ORDER BY "score" NULLS FIRST LIMIT 1
0.069336
CREATE TABLE table_2668347_14 (candidates VARCHAR, district VARCHAR)
who are the candidates for district new york 10?
SELECT candidates FROM table_2668347_14 WHERE district = "New York 10"
SELECT "candidates" FROM "table_2668347_14" WHERE "New York 10" = "district"
0.074219
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount 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 PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME) 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 ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description 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 FlagTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN) 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 ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL) CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL) CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL) CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL) CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL) CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT) CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL) CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId 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 ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT) CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT) CREATE TABLE PostTypes (Id DECIMAL, Name TEXT) CREATE TABLE 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 Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId 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 PostHistoryTypes (Id DECIMAL, Name TEXT)
display all the data from the Customers table - Tony.
SELECT AnswerCount, ViewCount, Title AS "Post Title" FROM Posts
SELECT "AnswerCount", "ViewCount", "Title" AS "Post Title" FROM "Posts"
0.069336
CREATE TABLE table_name_88 (enrollment INT, ihsaa_class VARCHAR, mascot VARCHAR)
What's the most enrolled having the dragons for a mascot and an AAA for the IHSAA Class?
SELECT MAX(enrollment) FROM table_name_88 WHERE ihsaa_class = "aaa" AND mascot = "dragons"
SELECT MAX("enrollment") FROM "table_name_88" WHERE "aaa" = "ihsaa_class" AND "dragons" = "mascot"
0.095703
CREATE TABLE table_12834315_4 (barrel_twist VARCHAR, colt_model_no VARCHAR)
Name the barrel twist for colt model mt6400
SELECT barrel_twist FROM table_12834315_4 WHERE colt_model_no = "MT6400"
SELECT "barrel_twist" FROM "table_12834315_4" WHERE "MT6400" = "colt_model_no"
0.076172
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
specify the gender and insurance of patient jesse ran
SELECT demographic.gender, demographic.insurance FROM demographic WHERE demographic.name = "Jesse Ran"
SELECT "demographic"."gender", "demographic"."insurance" FROM "demographic" WHERE "Jesse Ran" = "demographic"."name"
0.113281
CREATE TABLE table_204_643 (id DECIMAL, "release" DECIMAL, "artist" TEXT, "title" TEXT, "notes" TEXT, "album" TEXT)
what has been the last song this artist has made an other appearance on ?
SELECT "title" FROM table_204_643 ORDER BY id DESC LIMIT 1
SELECT "title" FROM "table_204_643" ORDER BY "id" DESC NULLS LAST LIMIT 1
0.071289
CREATE TABLE table_57038 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
What home team plays at princes park?
SELECT "Home team" FROM table_57038 WHERE "Venue" = 'princes park'
SELECT "Home team" FROM "table_57038" WHERE "Venue" = 'princes park'
0.066406
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
provide the number of patients whose ethnicity is white and diagnosis long title is personal history of hodgkin's disease
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.long_title = "Personal history of hodgkin's disease"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Personal history of hodgkin's disease" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "WHITE" = "demographic"."ethnicity"
0.243164
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME) CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME) CREATE TABLE 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 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 microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME) CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
what was the five most commonly carried out specimen tests since 2101?
SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) >= '2101' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5
WITH "t1" AS (SELECT "microlab"."culturesite", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "microlab" WHERE STRFTIME('%y', "microlab"."culturetakentime") >= '2101' GROUP BY "microlab"."culturesite") SELECT "t1"."culturesite" FROM "t1" AS "t1" WHERE "t1"."c1" <= 5
0.279297
CREATE TABLE table_204_20 (id DECIMAL, "represent" TEXT, "contestant" TEXT, "age" DECIMAL, "height" TEXT, "hometown" TEXT)
who is the tallest delegate ?
SELECT "contestant" FROM table_204_20 ORDER BY "height" DESC LIMIT 1
SELECT "contestant" FROM "table_204_20" ORDER BY "height" DESC NULLS LAST LIMIT 1
0.079102
CREATE TABLE table_name_34 (record VARCHAR, date VARCHAR)
What was the record on July 2?
SELECT record FROM table_name_34 WHERE date = "july 2"
SELECT "record" FROM "table_name_34" WHERE "date" = "july 2"
0.058594
CREATE TABLE film (film_id DECIMAL, title TEXT, description TEXT, release_year TIME, language_id DECIMAL, original_language_id DECIMAL, rental_duration DECIMAL, rental_rate DECIMAL, length DECIMAL, replacement_cost DECIMAL, rating TEXT, special_features TEXT, last_update TIME) CREATE TABLE actor (actor_id DECIMAL, first_name TEXT, last_name TEXT, last_update TIME) CREATE TABLE inventory (inventory_id DECIMAL, film_id DECIMAL, store_id DECIMAL, last_update TIME) CREATE TABLE payment (payment_id DECIMAL, customer_id DECIMAL, staff_id DECIMAL, rental_id DECIMAL, amount DECIMAL, payment_date TIME, last_update TIME) CREATE TABLE category (category_id DECIMAL, name TEXT, last_update TIME) CREATE TABLE staff (staff_id DECIMAL, first_name TEXT, last_name TEXT, address_id DECIMAL, picture others, email TEXT, store_id DECIMAL, active BOOLEAN, username TEXT, password TEXT, last_update TIME) CREATE TABLE country (country_id DECIMAL, country TEXT, last_update TIME) CREATE TABLE store (store_id DECIMAL, manager_staff_id DECIMAL, address_id DECIMAL, last_update TIME) CREATE TABLE customer (customer_id DECIMAL, store_id DECIMAL, first_name TEXT, last_name TEXT, email TEXT, address_id DECIMAL, active BOOLEAN, create_date TIME, last_update TIME) CREATE TABLE address (address_id DECIMAL, address TEXT, address2 TEXT, district TEXT, city_id DECIMAL, postal_code TEXT, phone TEXT, last_update TIME) CREATE TABLE film_text (film_id DECIMAL, title TEXT, description TEXT) CREATE TABLE city (city_id DECIMAL, city TEXT, country_id DECIMAL, last_update TIME) CREATE TABLE rental (rental_id DECIMAL, rental_date TIME, inventory_id DECIMAL, customer_id DECIMAL, return_date TIME, staff_id DECIMAL, last_update TIME) CREATE TABLE language (language_id DECIMAL, name TEXT, last_update TIME) CREATE TABLE film_category (film_id DECIMAL, category_id DECIMAL, last_update TIME) CREATE TABLE film_actor (actor_id DECIMAL, film_id DECIMAL, last_update TIME)
Return the full name of the customer who made the first rental.
SELECT T1.first_name, T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.rental_date LIMIT 1
SELECT "T1"."first_name", "T1"."last_name" FROM "customer" AS "T1" JOIN "rental" AS "T2" ON "T1"."customer_id" = "T2"."customer_id" ORDER BY "T2"."rental_date" NULLS FIRST LIMIT 1
0.174805
CREATE TABLE table_22275 ("Departure" TEXT, "Going to" TEXT, "Calling at" TEXT, "Arrival" TEXT, "Operator" TEXT)
what is the operator of trains arriving at 13.39
SELECT "Operator" FROM table_22275 WHERE "Arrival" = '13.39'
SELECT "Operator" FROM "table_22275" WHERE "Arrival" = '13.39'
0.060547
CREATE TABLE table_57332 ("Council" TEXT, "2003 result" TEXT, "Notional control ( based on 2003 results ) " TEXT, "2007 result" TEXT, "Details" TEXT)
What's the 2007 result when the notional control is noc and the 2003 result is snp?
SELECT "2007 result" FROM table_57332 WHERE "Notional control (based on 2003 results)" = 'noc' AND "2003 result" = 'snp'
SELECT "2007 result" FROM "table_57332" WHERE "2003 result" = 'snp' AND "Notional control (based on 2003 results)" = 'noc'
0.119141
CREATE TABLE table_26111 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "Original air date" TEXT, "U.S. viewers ( millions ) " TEXT)
who directed the episode written by Shonda Rhimes?
SELECT "Directed by" FROM table_26111 WHERE "Written by" = 'Shonda Rhimes'
SELECT "Directed by" FROM "table_26111" WHERE "Written by" = 'Shonda Rhimes'
0.074219
CREATE TABLE table_46950 ("Date" TEXT, "Tournament" TEXT, "Surface" TEXT, "Opponent" TEXT, "Score" TEXT)
who is the opponent when the score is 3 6, 6 1, 7 5?
SELECT "Opponent" FROM table_46950 WHERE "Score" = '3–6, 6–1, 7–5'
SELECT "Opponent" FROM "table_46950" WHERE "Score" = '3–6, 6–1, 7–5'
0.066406
CREATE TABLE customer_orders (order_id DECIMAL, customer_id DECIMAL, order_status TEXT, order_date TIME, order_details TEXT) CREATE TABLE order_items (order_id DECIMAL, product_id DECIMAL, order_quantity TEXT) CREATE TABLE customer_addresses (customer_id DECIMAL, address_id DECIMAL, date_address_from TIME, address_type TEXT, date_address_to TIME) CREATE TABLE customers (customer_id DECIMAL, payment_method TEXT, customer_name TEXT, date_became_customer TIME, other_customer_details TEXT) CREATE TABLE customer_contact_channels (customer_id DECIMAL, channel_code TEXT, active_from_date TIME, active_to_date TIME, contact_number TEXT) CREATE TABLE addresses (address_id DECIMAL, address_content TEXT, city TEXT, zip_postcode TEXT, state_province_county TEXT, country TEXT, other_address_details TEXT) CREATE TABLE products (product_id DECIMAL, product_details TEXT)
Find the names of customers who never placed an order.
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id
SELECT "customer_name" FROM "customers" EXCEPT SELECT "t1"."customer_name" FROM "customers" AS "t1" JOIN "customer_orders" AS "t2" ON "t1"."customer_id" = "t2"."customer_id"
0.168945
CREATE TABLE table_14893 ("Rank" FLOAT, "Mountain Peak" TEXT, "State" TEXT, "Mountain Range" TEXT, "Location" TEXT)
Where does Mount Chamberlin, located in Alaska, rank on the chart?
SELECT SUM("Rank") FROM table_14893 WHERE "State" = 'alaska' AND "Mountain Peak" = 'mount chamberlin'
SELECT SUM("Rank") FROM "table_14893" WHERE "Mountain Peak" = 'mount chamberlin' AND "State" = 'alaska'
0.100586
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
what is marital status of subject name joseph dillman?
SELECT demographic.marital_status FROM demographic WHERE demographic.name = "Joseph Dillman"
SELECT "demographic"."marital_status" FROM "demographic" WHERE "Joseph Dillman" = "demographic"."name"
0.099609
CREATE TABLE table_67135 ("Strong's #" FLOAT, "Hebrew word" TEXT, "Strong's Transliteration" TEXT, "Strong's Words Compounded" TEXT, "English Spelling" TEXT)
Strong's Transliteration of yowyaqiym is what Hebrew word?
SELECT "Hebrew word" FROM table_67135 WHERE "Strong's Transliteration" = 'yowyaqiym'
SELECT "Hebrew word" FROM "table_67135" WHERE "Strong's Transliteration" = 'yowyaqiym'
0.083984
CREATE TABLE table_name_67 (quantity VARCHAR, seats VARCHAR, class VARCHAR)
What is the quantity when the seats number was 16 and the class was kss 1913?
SELECT quantity FROM table_name_67 WHERE seats = 16 AND class = "kss 1913"
SELECT "quantity" FROM "table_name_67" WHERE "class" = "kss 1913" AND "seats" = 16
0.080078
CREATE TABLE book (Book_ID INT, Title TEXT, Issues FLOAT, Writer TEXT) CREATE TABLE publication (Publication_ID INT, Book_ID INT, Publisher TEXT, Publication_Date TEXT, Price FLOAT)
A bar chart showing the number of publication dates of books, and list from high to low by the Publication_Date.
SELECT Publication_Date, COUNT(Publication_Date) FROM publication GROUP BY Publication_Date ORDER BY Publication_Date DESC
SELECT "Publication_Date", COUNT("Publication_Date") FROM "publication" GROUP BY "Publication_Date" ORDER BY "Publication_Date" DESC NULLS LAST
0.139648
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT) 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) CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT) CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL) CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT) CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE 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 chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom 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 diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME) CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME) CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT) CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME) CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL) CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
what is the total dosage of bag that was prescribed to patient 14397 since 34 months ago?
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14397) AND prescriptions.drug = 'bag' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-34 month')
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 14397 GROUP BY "hadm_id") SELECT SUM("prescriptions"."dose_val_rx") FROM "prescriptions" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE "prescriptions"."drug" = 'bag' AND DATETIME("prescriptions"."startdate") >= DATETIME(CURRENT_TIME(), '-34 month') AND NOT "_u_0"."" IS NULL
0.390625
CREATE TABLE table_18602462_21 (final__bronze_medal_match VARCHAR, event VARCHAR)
When mixed quad singles is the event what is the final/bronze medal match?
SELECT final__bronze_medal_match FROM table_18602462_21 WHERE event = "Mixed Quad Singles"
SELECT "final__bronze_medal_match" FROM "table_18602462_21" WHERE "Mixed Quad Singles" = "event"
0.09375
CREATE TABLE Has_Allergy (StuID INT, Allergy VARCHAR) CREATE TABLE Allergy_Type (Allergy VARCHAR, AllergyType VARCHAR) CREATE TABLE Student (StuID INT, LName VARCHAR, Fname VARCHAR, Age INT, Sex VARCHAR, Major INT, Advisor INT, city_code VARCHAR)
Visualize a pie chart with what are the allergy types and how many allergies correspond to each one?
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType
SELECT "AllergyType", COUNT(*) FROM "Allergy_Type" GROUP BY "AllergyType"
0.071289
CREATE TABLE table_68747 ("Rank" FLOAT, "Heat" FLOAT, "Lane" FLOAT, "Name" TEXT, "Nationality" TEXT, "Time" TEXT)
What is the largest heat with a time of 4:57.90, and a Rank larger than 22?
SELECT MAX("Heat") FROM table_68747 WHERE "Time" = '4:57.90' AND "Rank" > '22'
SELECT MAX("Heat") FROM "table_68747" WHERE "Rank" > '22' AND "Time" = '4:57.90'
0.078125
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT) CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT) CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT) CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT) CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
give the number of patients who underwent nasal sinus dx proc nec.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Nasal sinus dx proc NEC"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Nasal sinus dx proc NEC" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id"
0.192383
CREATE TABLE table_name_82 (region VARCHAR, village VARCHAR)
Which Reigon has a Village of Chassagne-Montrachet?
SELECT region FROM table_name_82 WHERE village = "chassagne-montrachet"
SELECT "region" FROM "table_name_82" WHERE "chassagne-montrachet" = "village"
0.075195
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT) CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR) CREATE TABLE gsi (course_offering_id INT, student_id INT) CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR) CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college 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 ta (campus_job_id INT, student_id INT, location VARCHAR) CREATE TABLE area (course_id INT, area VARCHAR) CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT) CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR) CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT) CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT) CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR) CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR) CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT) CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR) CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
What days of the week does PHIL 157 meet ?
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'PHIL' AND course.number = 157 ORDER BY semester.year DESC
SELECT DISTINCT "course_offering"."friday", "course_offering"."monday", "course_offering"."saturday", "course_offering"."sunday", "course_offering"."thursday", "course_offering"."tuesday", "course_offering"."wednesday" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" WHERE "course"."department" = 'PHIL' AND "course"."number" = 157 ORDER BY "semester"."year" DESC NULLS LAST
0.482422
CREATE TABLE table_test_13 ("id" INT, "systolic_blood_pressure_sbp" INT, "tachycardia" INT, "diastolic_blood_pressure_dbp" INT, "total_cholesterol" INT, "high_density_lipoprotein_cholesterol_hdl_c" INT, "serum_creatinine" FLOAT, "alcohol_abuse" BOOLEAN, "drug_abuse" BOOLEAN, "body_mass_index_bmi" FLOAT, "triglyceride_tg" FLOAT, "age" FLOAT, "NOUSE" FLOAT)
high density lipoprotein cholesterol >= 40 mg / dl ( 14 mmol / l )
SELECT * FROM table_test_13 WHERE high_density_lipoprotein_cholesterol_hdl_c >= 40
SELECT * FROM "table_test_13" WHERE "high_density_lipoprotein_cholesterol_hdl_c" >= 40
0.083984
CREATE TABLE Ref_Document_Types (document_type_code CHAR, document_type_description VARCHAR) CREATE TABLE Addresses (address_id INT, address_details VARCHAR) CREATE TABLE Document_Drafts (document_id INT, draft_number INT, draft_details VARCHAR) CREATE TABLE Circulation_History (document_id INT, draft_number INT, copy_number INT, employee_id INT) CREATE TABLE Roles (role_code CHAR, role_description VARCHAR) CREATE TABLE Documents (document_id INT, document_status_code CHAR, document_type_code CHAR, shipping_agent_code CHAR, receipt_date DATETIME, receipt_number VARCHAR, other_details VARCHAR) CREATE TABLE Documents_Mailed (document_id INT, mailed_to_address_id INT, mailing_date DATETIME) CREATE TABLE Ref_Document_Status (document_status_code CHAR, document_status_description VARCHAR) CREATE TABLE Draft_Copies (document_id INT, draft_number INT, copy_number INT) CREATE TABLE Employees (employee_id INT, role_code CHAR, employee_name VARCHAR, other_details VARCHAR) CREATE TABLE Ref_Shipping_Agents (shipping_agent_code CHAR, shipping_agent_name VARCHAR, shipping_agent_description VARCHAR)
How many employees does each role have? Plot a pie chart.
SELECT role_description, COUNT(*) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code
SELECT "role_description", COUNT(*) FROM "Roles" AS "T1" JOIN "Employees" AS "T2" ON "T1"."role_code" = "T2"."role_code" GROUP BY "T2"."role_code"
0.142578
CREATE TABLE table_name_92 (position INT, goals_against VARCHAR, goals_for VARCHAR)
What is the lowest position number when goals against was 59, and a goals for is smaller than 24?
SELECT MIN(position) FROM table_name_92 WHERE goals_against = 59 AND goals_for < 24
SELECT MIN("position") FROM "table_name_92" WHERE "goals_against" = 59 AND "goals_for" < 24
0.088867
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME) CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME) CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT) CREATE TABLE 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 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 treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME) CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME) CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
what is patient 028-30487's minimum value for ptt in 06/this year?
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-30487')) AND lab.labname = 'ptt' AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', lab.labresulttime) = '06'
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '028-30487' 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 MIN("lab"."labresult") FROM "lab" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'ptt' AND DATETIME("lab"."labresulttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_1"."" IS NULL AND STRFTIME('%m', "lab"."labresulttime") = '06'
0.663086
CREATE TABLE table_21576644_2 (mens_3rd_xi VARCHAR, ladies_1st_xi VARCHAR)
When 3rd, sedgemoor division 1 is the ladies 1st xi what is the mens 3rd xi?
SELECT mens_3rd_xi FROM table_21576644_2 WHERE ladies_1st_xi = "3rd, Sedgemoor Division 1"
SELECT "mens_3rd_xi" FROM "table_21576644_2" WHERE "3rd, Sedgemoor Division 1" = "ladies_1st_xi"
0.09375