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_890 ("District" FLOAT, "Incumbent" TEXT, "Party" TEXT, "Elected" FLOAT, "Status" TEXT, "Opponent" TEXT)
| what's the district with party being republican and elected being 1998 | SELECT "District" FROM table_890 WHERE "Party" = 'Republican' AND "Elected" = '1998' | SELECT "District" FROM "table_890" WHERE "Elected" = '1998' AND "Party" = 'Republican' | 0.083984 |
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, visualize a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, and order y-axis in descending order. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer DESC | SELECT "T1"."Name", "T1"."Manufacturer" FROM "Products" AS "T1" JOIN "Manufacturers" AS "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "T1"."Name" ORDER BY "T1"."Manufacturer" DESC NULLS LAST | 0.19043 |
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)
CREATE TABLE university (School_ID INT, School TEXT, Location TEXT, Founded FLOAT, Affiliation TEXT, Enrollment FLOAT, Nickname TEXT, Primary_conference TEXT)
| Visualize a bar chart about the distribution of All_Home and the average of Team_ID , and group by attribute All_Home. | SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home | SELECT "All_Home", AVG("Team_ID") FROM "basketball_match" GROUP BY "All_Home" | 0.075195 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
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)
| calculate the minimum age of cape speaking patients who had complete heart block as primary disease | SELECT MIN(demographic.age) FROM demographic WHERE demographic.language = "CAPE" AND demographic.diagnosis = "COMPLETE HEART BLOCK" | SELECT MIN("demographic"."age") FROM "demographic" WHERE "CAPE" = "demographic"."language" AND "COMPLETE HEART BLOCK" = "demographic"."diagnosis" | 0.141602 |
CREATE TABLE table_48460 ("Year" TEXT, "Date" TEXT, "Circuit" TEXT, "Winning driver" TEXT, "Winning constructor" TEXT, "Report" TEXT)
| What year did Ferrari win the Kyalami circuit? | SELECT "Year" FROM table_48460 WHERE "Circuit" = 'kyalami' AND "Winning constructor" = 'ferrari' | SELECT "Year" FROM "table_48460" WHERE "Circuit" = 'kyalami' AND "Winning constructor" = 'ferrari' | 0.095703 |
CREATE TABLE table_24334 ("Year" FLOAT, "Date" TEXT, "Driver" TEXT, "Team" TEXT, "Manufacturer" TEXT, "Laps" TEXT, "Miles ( km ) " TEXT, "Race Time" TEXT, "Average Speed ( mph ) " TEXT, "Report" TEXT)
| Name the team for june 20 | SELECT "Team" FROM table_24334 WHERE "Date" = 'June 20' | SELECT "Team" FROM "table_24334" WHERE "Date" = 'June 20' | 0.055664 |
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 procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label 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 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 d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto 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 cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value 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 labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
| what were the top four most frequent diagnoses that were given to patients within the same month after the diagnosis of alcohol withdrawal since 3 years ago? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 = 'alcohol withdrawal') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-3 year')) AS t1 JOIN (SELECT admissions.subject_id, diagnoses_icd.icd9_code, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-3 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 4) | WITH "t2" AS (SELECT "admissions"."subject_id", "diagnoses_icd"."icd9_code", "diagnoses_icd"."charttime" FROM "diagnoses_icd" JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" WHERE DATETIME("diagnoses_icd"."charttime") >= DATETIME(CURRENT_TIME(), '-3 year')), "t3" AS (SELECT "t2"."icd9_code", 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" = 'alcohol withdrawal' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" JOIN "t2" AS "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND "diagnoses_icd"."charttime" < "t2"."charttime" AND DATETIME("diagnoses_icd"."charttime", 'start of month') = DATETIME("t2"."charttime", 'start of month') WHERE DATETIME("diagnoses_icd"."charttime") >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY "t2"."icd9_code"), "_u_1" AS (SELECT "t3"."icd9_code" FROM "t3" AS "t3" WHERE "t3"."c1" <= 4 GROUP BY "icd9_code") SELECT "d_icd_diagnoses"."short_title" FROM "d_icd_diagnoses" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "d_icd_diagnoses"."icd9_code" WHERE NOT "_u_1"."" IS NULL | 1.181641 |
CREATE TABLE table_name_54 (best VARCHAR, qual_1 VARCHAR)
| What is the best time of the team that had a qualifying 1 time of 1:01.043? | SELECT best FROM table_name_54 WHERE qual_1 = "1:01.043" | SELECT "best" FROM "table_name_54" WHERE "1:01.043" = "qual_1" | 0.060547 |
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime 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 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 diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
| had patient 007-6603 been diagnosed as traumatic injury to major vessels - r carotid artery in 2105? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-6603')) AND diagnosis.diagnosisname = 'traumatic injury to major vessels - r carotid artery' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '007-6603' 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 "diagnosis" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "diagnosis"."patientunitstayid" WHERE "diagnosis"."diagnosisname" = 'traumatic injury to major vessels - r carotid artery' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y', "diagnosis"."diagnosistime") = '2105' | 0.625977 |
CREATE TABLE player_award_vote (award_id TEXT, year DECIMAL, league_id TEXT, player_id TEXT, points_won DECIMAL, points_max DECIMAL, votes_first TEXT)
CREATE TABLE player_award (player_id TEXT, award_id TEXT, year DECIMAL, league_id TEXT, tie TEXT, notes TEXT)
CREATE TABLE hall_of_fame (player_id TEXT, yearid DECIMAL, votedby TEXT, ballots TEXT, needed TEXT, votes TEXT, inducted TEXT, category TEXT, needed_note TEXT)
CREATE TABLE salary (year DECIMAL, team_id TEXT, league_id TEXT, player_id TEXT, salary DECIMAL)
CREATE TABLE player (player_id TEXT, birth_year TEXT, birth_month TEXT, birth_day TEXT, birth_country TEXT, birth_state TEXT, birth_city TEXT, death_year TEXT, death_month TEXT, death_day TEXT, death_country TEXT, death_state TEXT, death_city TEXT, name_first TEXT, name_last TEXT, name_given TEXT, weight TEXT)
| For every award, who is the youngest winner? | SELECT T1.player_id, T1.award_id, MIN(T1.year - T2.birth_year) FROM player_award AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id GROUP BY T1.award_id | SELECT "T1"."player_id", "T1"."award_id", MIN("T1"."year" - "T2"."birth_year") FROM "player_award" AS "T1" JOIN "player" AS "T2" ON "T1"."player_id" = "T2"."player_id" GROUP BY "T1"."award_id" | 0.1875 |
CREATE TABLE table_name_59 (population INT, median_house__hold_income VARCHAR)
| What is the Population where the Median House-hold Income is $25,016? | SELECT MIN(population) FROM table_name_59 WHERE median_house__hold_income = "$25,016" | SELECT MIN("population") FROM "table_name_59" WHERE "$25,016" = "median_house__hold_income" | 0.088867 |
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime 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 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 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 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 lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
| has patient 027-154299 been administered any enteral meds on this month/27? | 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 = '027-154299')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'enteral meds' AND DATETIME(intakeoutput.intakeoutputtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND STRFTIME('%d', intakeoutput.intakeoutputtime) = '27' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '027-154299' 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" = 'enteral meds' AND "intakeoutput"."cellpath" LIKE '%intake%' AND DATETIME("intakeoutput"."intakeoutputtime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND NOT "_u_1"."" IS NULL AND STRFTIME('%d', "intakeoutput"."intakeoutputtime") = '27' | 0.762695 |
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT)
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
| show me flights from NEW YORK to MIAMI | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" AS "AIRPORT_SERVICE_0" JOIN "city" AS "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'NEW YORK' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" AS "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" AS "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'MIAMI' | 0.493164 |
CREATE TABLE table_name_92 (points VARCHAR, tries_against VARCHAR)
| When the tries against is 90 how many points are there? | SELECT points FROM table_name_92 WHERE tries_against = "90" | SELECT "points" FROM "table_name_92" WHERE "90" = "tries_against" | 0.063477 |
CREATE TABLE table_name_78 (visitor VARCHAR, date VARCHAR)
| WHo is the Visitor on april 14? | SELECT visitor FROM table_name_78 WHERE date = "april 14" | SELECT "visitor" FROM "table_name_78" WHERE "april 14" = "date" | 0.061523 |
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE 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 me the number of patients whose admission year is less than 2125 and drug route is neb? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2125" AND prescriptions.route = "NEB" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "NEB" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "2125" > "demographic"."admityear" | 0.21582 |
CREATE TABLE table_name_37 (record VARCHAR, opponent VARCHAR)
| what is the record when the opponent is jeff williams? | SELECT record FROM table_name_37 WHERE opponent = "jeff williams" | SELECT "record" FROM "table_name_37" WHERE "jeff williams" = "opponent" | 0.069336 |
CREATE TABLE table_name_98 (partner VARCHAR, opponents_in_the_final VARCHAR)
| What is Partner, when Opponents In The Final is Remi Tezuka Shuko Aoyama? | SELECT partner FROM table_name_98 WHERE opponents_in_the_final = "remi tezuka shuko aoyama" | SELECT "partner" FROM "table_name_98" WHERE "opponents_in_the_final" = "remi tezuka shuko aoyama" | 0.094727 |
CREATE TABLE table_10123 ("Year" TEXT, "League" TEXT, "Reg. Season" TEXT, "Playoffs" TEXT, "Avg. attendance" FLOAT)
| What is the Playoffs during 2004-05? | SELECT "Playoffs" FROM table_10123 WHERE "Year" = '2004-05' | SELECT "Playoffs" FROM "table_10123" WHERE "Year" = '2004-05' | 0.05957 |
CREATE TABLE table_51250 ("Year" FLOAT, "Date" TEXT, "Winner" TEXT, "Result" TEXT, "Loser" TEXT, "Attendance" FLOAT, "Location" TEXT)
| what date saw the chicago bears lose in green bay earlier than 1931? | SELECT "Date" FROM table_51250 WHERE "Loser" = 'chicago bears' AND "Location" = 'green bay' AND "Year" < '1931' | SELECT "Date" FROM "table_51250" WHERE "Location" = 'green bay' AND "Loser" = 'chicago bears' AND "Year" < '1931' | 0.110352 |
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress 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 CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId 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 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 PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment 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 Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
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 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 FlagTypes (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 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 PostTypes (Id DECIMAL, Name TEXT)
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 Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
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 VoteTypes (Id DECIMAL, Name 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)
| Users by Location and Tags. | SELECT DISTINCT u.Id AS "user_link", u.DisplayName, u.Reputation, u.Location FROM Posts AS p JOIN Posts AS pp ON pp.ParentId = p.Id JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId JOIN Users AS u ON u.Id = pp.OwnerUserId WHERE t.TagName = '##tagname##' AND LOWER(u.Location) LIKE LOWER('%##locationname##%') ORDER BY u.Reputation DESC, u.Id | SELECT DISTINCT "u"."Id" AS "user_link", "u"."DisplayName", "u"."Reputation", "u"."Location" FROM "Posts" AS "p" JOIN "Posts" AS "pp" ON "p"."Id" = "pp"."ParentId" JOIN "PostTags" AS "pt" ON "p"."Id" = "pt"."PostId" JOIN "Tags" AS "t" ON "pt"."TagId" = "t"."Id" AND "t"."TagName" = '##tagname##' JOIN "Users" AS "u" ON "pp"."OwnerUserId" = "u"."Id" AND LOWER("u"."Location") LIKE LOWER('%##locationname##%') ORDER BY "u"."Reputation" DESC NULLS LAST, "u"."Id" NULLS FIRST | 0.459961 |
CREATE TABLE table_48716 ("Institution" TEXT, "Location" TEXT, "Nickname" TEXT, "Founded" FLOAT, "Enrollment" FLOAT, "Joined" FLOAT)
| Which Nickname has an Enrollment smaller than 501, and a Location of clarkesville? | SELECT "Nickname" FROM table_48716 WHERE "Enrollment" < '501' AND "Location" = 'clarkesville' | SELECT "Nickname" FROM "table_48716" WHERE "Enrollment" < '501' AND "Location" = 'clarkesville' | 0.092773 |
CREATE TABLE table_61955 ("Year" FLOAT, "Award" TEXT, "Category" TEXT, "Nominee" TEXT, "Result" TEXT)
| What year had Best Actor in a Musical as a category? | SELECT SUM("Year") FROM table_61955 WHERE "Category" = 'best actor in a musical' | SELECT SUM("Year") FROM "table_61955" WHERE "Category" = 'best actor in a musical' | 0.080078 |
CREATE TABLE table_204_738 (id DECIMAL, "season" DECIMAL, "level" TEXT, "division" TEXT, "section" TEXT, "position" TEXT, "movements" TEXT)
| what is the last year they played division 4 ? | SELECT MAX("season") FROM table_204_738 WHERE "division" = 4 | SELECT MAX("season") FROM "table_204_738" WHERE "division" = 4 | 0.060547 |
CREATE TABLE table_5705 ("Year" FLOAT, "League" TEXT, "Wins" FLOAT, "Losses" FLOAT, "Draws" FLOAT, "Points" FLOAT)
| What is the lowest wins that has a year prior to 1999, with draws greater than 1, and points greater than 17? | SELECT MIN("Wins") FROM table_5705 WHERE "Year" < '1999' AND "Draws" > '1' AND "Points" > '17' | SELECT MIN("Wins") FROM "table_5705" WHERE "Draws" > '1' AND "Points" > '17' AND "Year" < '1999' | 0.09375 |
CREATE TABLE table_name_49 (crew VARCHAR, comments VARCHAR)
| Which Crew has Comments of daggerboards. design: roy seaman? | SELECT crew FROM table_name_49 WHERE comments = "daggerboards. design: roy seaman" | SELECT "crew" FROM "table_name_49" WHERE "comments" = "daggerboards. design: roy seaman" | 0.085938 |
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
| what is the drug type and drug route of drug code pheny100l? | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "PHENY100L" | SELECT "prescriptions"."drug_type", "prescriptions"."route" FROM "prescriptions" WHERE "PHENY100L" = "prescriptions"."formulary_drug_cd" | 0.132813 |
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 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)
| count the number of patients whose ethnicity is american indian/alaska native and diagnoses long title is unspecified erythematous condition? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND diagnoses.long_title = "Unspecified erythematous condition" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Unspecified erythematous condition" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "AMERICAN INDIAN/ALASKA NATIVE" = "demographic"."ethnicity" | 0.263672 |
CREATE TABLE people (People_ID INT, Sex TEXT, Name TEXT, Date_of_Birth TEXT, Height FLOAT, Weight FLOAT)
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)
| A bar chart showing the minimum weight for each gender, and I want to list by the bar in ascending. | SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY Sex | SELECT "Sex", MIN("Weight") FROM "people" GROUP BY "Sex" ORDER BY "Sex" NULLS FIRST | 0.081055 |
CREATE TABLE table_name_22 (played INT, team VARCHAR, lost VARCHAR, drawn VARCHAR)
| How much Played has a Lost larger than 14, and Drawn of 8, and a Team of ipatinga? | SELECT SUM(played) FROM table_name_22 WHERE lost > 14 AND drawn = 8 AND team = "ipatinga" | SELECT SUM("played") FROM "table_name_22" WHERE "drawn" = 8 AND "ipatinga" = "team" AND "lost" > 14 | 0.09668 |
CREATE TABLE table_name_50 (ages VARCHAR, report VARCHAR, school VARCHAR)
| What are the Ages of the Seashell Trust School with Ofsted Report? | SELECT ages FROM table_name_50 WHERE report = "ofsted" AND school = "seashell trust" | SELECT "ages" FROM "table_name_50" WHERE "ofsted" = "report" AND "school" = "seashell trust" | 0.089844 |
CREATE TABLE Products (product_id INT, parent_product_id INT, product_category_code VARCHAR, date_product_first_available DATETIME, date_product_discontinued DATETIME, product_name VARCHAR, product_description VARCHAR, product_price DECIMAL)
CREATE TABLE Complaints (complaint_id INT, product_id INT, customer_id INT, complaint_outcome_code VARCHAR, complaint_status_code VARCHAR, complaint_type_code VARCHAR, date_complaint_raised DATETIME, date_complaint_closed DATETIME, staff_id INT)
CREATE TABLE Customers (customer_id INT, customer_type_code VARCHAR, address_line_1 VARCHAR, address_line_2 VARCHAR, town_city VARCHAR, state VARCHAR, email_address VARCHAR, phone_number VARCHAR)
CREATE TABLE Staff (staff_id INT, gender VARCHAR, first_name VARCHAR, last_name VARCHAR, email_address VARCHAR, phone_number VARCHAR)
| what are all the different product names, and how many complains has each received?, rank in asc by the Y-axis. | SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY COUNT(*) | SELECT "product_name", COUNT(*) FROM "Products" AS "t1" JOIN "Complaints" AS "t2" ON "t1"."product_id" = "t2"."product_id" GROUP BY "t1"."product_name" ORDER BY COUNT(*) NULLS FIRST | 0.176758 |
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT)
CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT)
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR)
CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
| round trip fares from DENVER to PHILADELPHIA under 1000 dollars | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND fare.round_trip_cost < 1000 AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND NOT fare.round_trip_cost IS NULL | SELECT DISTINCT "fare"."fare_id" FROM "airport_service" AS "AIRPORT_SERVICE_0" JOIN "city" AS "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'DENVER' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" AS "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "flight_fare" ON "flight"."flight_id" = "flight_fare"."flight_id" JOIN "city" AS "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'PHILADELPHIA' JOIN "fare" ON "fare"."fare_id" = "flight_fare"."fare_id" AND "fare"."round_trip_cost" < 1000 AND NOT "fare"."round_trip_cost" IS NULL | 0.695313 |
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 treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
| when is patient 006-81423's per iv flush: upper arm r 20 gauge intake the first time until 1959 days ago? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-81423')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'per iv flush: upper arm r 20 gauge' AND DATETIME(intakeoutput.intakeoutputtime) <= DATETIME(CURRENT_TIME(), '-1959 day') ORDER BY intakeoutput.intakeoutputtime LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '006-81423' 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 "intakeoutput"."intakeoutputtime" FROM "intakeoutput" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = 'per iv flush: upper arm r 20 gauge' AND "intakeoutput"."cellpath" LIKE '%intake%' AND DATETIME("intakeoutput"."intakeoutputtime") <= DATETIME(CURRENT_TIME(), '-1959 day') AND NOT "_u_1"."" IS NULL ORDER BY "intakeoutput"."intakeoutputtime" NULLS FIRST LIMIT 1 | 0.772461 |
CREATE TABLE Faculty (FacID INT, Lname VARCHAR, Fname VARCHAR, Rank VARCHAR, Sex VARCHAR, Phone INT, Room VARCHAR, Building VARCHAR)
CREATE TABLE Participates_in (stuid INT, actid INT)
CREATE TABLE Faculty_Participates_in (FacID INT, actid INT)
CREATE TABLE Activity (actid INT, activity_name VARCHAR)
CREATE TABLE Student (StuID INT, LName VARCHAR, Fname VARCHAR, Age INT, Sex VARCHAR, Major INT, Advisor INT, city_code VARCHAR)
| Bar chart of total number by each rank, sort from high to low by the Y. | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank ORDER BY COUNT(Rank) DESC | SELECT "Rank", COUNT("Rank") FROM "Faculty" GROUP BY "Rank" ORDER BY COUNT("Rank") DESC NULLS LAST | 0.095703 |
CREATE TABLE table_63726 ("Res." TEXT, "Record" TEXT, "Opponent" TEXT, "Method" TEXT, "Round" FLOAT, "Time" TEXT, "Location" TEXT)
| What is the lowest round that has kazushi sakuraba as the opponent? | SELECT MIN("Round") FROM table_63726 WHERE "Opponent" = 'kazushi sakuraba' | SELECT MIN("Round") FROM "table_63726" WHERE "Opponent" = 'kazushi sakuraba' | 0.074219 |
CREATE TABLE table_name_63 (system VARCHAR, license VARCHAR, current_version VARCHAR)
| What is the System when the Licence is gpl and the Current Version is 1.72? | SELECT system FROM table_name_63 WHERE license = "gpl" AND current_version = "1.72" | SELECT "system" FROM "table_name_63" WHERE "1.72" = "current_version" AND "gpl" = "license" | 0.088867 |
CREATE TABLE table_28549 ("Series #" FLOAT, "Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "Original air date" TEXT, "Production code" TEXT)
| Name the least series number written by brenda hampton and directed by burt brinckerhoff | SELECT MIN("Series #") FROM table_28549 WHERE "Written by" = 'Brenda Hampton' AND "Directed by" = 'Burt Brinckerhoff' | SELECT MIN("Series #") FROM "table_28549" WHERE "Directed by" = 'Burt Brinckerhoff' AND "Written by" = 'Brenda Hampton' | 0.116211 |
CREATE TABLE Has_amenity (dormid INT, amenid INT)
CREATE TABLE Dorm_amenity (amenid INT, amenity_name VARCHAR)
CREATE TABLE Student (StuID INT, LName VARCHAR, Fname VARCHAR, Age INT, Sex VARCHAR, Major INT, Advisor INT, city_code VARCHAR)
CREATE TABLE Dorm (dormid INT, dorm_name VARCHAR, student_capacity INT, gender VARCHAR)
CREATE TABLE Lives_in (stuid INT, dormid INT, room_number INT)
| Find the average age of male students (with sex M) from each city. | SELECT city_code, AVG(Age) FROM Student WHERE Sex = 'M' GROUP BY city_code | SELECT "city_code", AVG("Age") FROM "Student" WHERE "Sex" = 'M' GROUP BY "city_code" | 0.082031 |
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE area (course_id INT, area VARCHAR)
| Is STATS 350 a prerequisite for STATS 415 ? | SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'STATS' AND COURSE_0.number = 350 AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'STATS' AND COURSE_1.number = 415 | SELECT COUNT(*) > 0 FROM "course" AS "COURSE_0" JOIN "course_prerequisite" ON "COURSE_0"."course_id" = "course_prerequisite"."pre_course_id" JOIN "course" AS "COURSE_1" ON "COURSE_1"."course_id" = "course_prerequisite"."course_id" AND "COURSE_1"."department" = 'STATS' AND "COURSE_1"."number" = 415 WHERE "COURSE_0"."department" = 'STATS' AND "COURSE_0"."number" = 350 | 0.359375 |
CREATE TABLE table_48024 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT)
| What is Score, when Player is 'Andy North'? | SELECT "Score" FROM table_48024 WHERE "Player" = 'andy north' | SELECT "Score" FROM "table_48024" WHERE "Player" = 'andy north' | 0.061523 |
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 vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
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 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 lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
| what are the three most commonly ordered procedures in patients aged 60 or above? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 3 | WITH "_u_0" AS (SELECT "patient"."patientunitstayid" FROM "patient" WHERE "patient"."age" >= 60 GROUP BY "patientunitstayid"), "t1" AS (SELECT "treatment"."treatmentname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "treatment" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "treatment"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "treatment"."treatmentname") SELECT "t1"."treatmentname" FROM "t1" AS "t1" WHERE "t1"."c1" <= 3 | 0.446289 |
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)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
| how many patients whose lab test abnormal status is abnormal and lab test name is platelet count? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "Platelet Count" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Platelet Count" = "lab"."label" AND "abnormal" = "lab"."flag" AND "demographic"."hadm_id" = "lab"."hadm_id" | 0.186523 |
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 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)
| how many patients stayed in hospital for more than 9 days and procedured with icd9 code 3571? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "9" AND procedures.icd9_code = "3571" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "3571" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "9" < "demographic"."days_stay" | 0.208984 |
CREATE TABLE table_name_8 (conference VARCHAR, season VARCHAR, format VARCHAR)
| What conference has 2009 as the season, with super leg final as the format? | SELECT conference FROM table_name_8 WHERE season = 2009 AND format = "super leg final" | SELECT "conference" FROM "table_name_8" WHERE "format" = "super leg final" AND "season" = 2009 | 0.091797 |
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 VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId 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 ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment 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 ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE ReviewTaskStates (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 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)
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 PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
| Final Query : Questions with answer along with tag Random top 500. | SELECT p.Id, p.Title, p.Body, p.Score, p.ViewCount, p.AnswerCount, p.CommentCount FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id JOIN Posts AS a ON p.AcceptedAnswerId = a.Id WHERE (t.TagName = '##TagName:string##') AND (NOT p.AcceptedAnswerId IS NULL) AND (p.CreationDate >= '##Date1?2016-01-01##') AND (p.CreationDate <= '##Date2?2019-12-31##') AND (p.Score > 2) AND (p.AnswerCount > 2) ORDER BY RAND() LIMIT 500 | SELECT "p"."Id", "p"."Title", "p"."Body", "p"."Score", "p"."ViewCount", "p"."AnswerCount", "p"."CommentCount" FROM "Posts" AS "p" JOIN "Posts" AS "a" ON "a"."Id" = "p"."AcceptedAnswerId" JOIN "PostTags" AS "pt" ON "p"."Id" = "pt"."PostId" JOIN "Tags" AS "t" ON "pt"."TagId" = "t"."Id" AND "t"."TagName" = '##TagName:string##' WHERE "p"."AnswerCount" > 2 AND "p"."CreationDate" <= '##Date2?2019-12-31##' AND "p"."CreationDate" >= '##Date1?2016-01-01##' AND "p"."Score" > 2 AND NOT "p"."AcceptedAnswerId" IS NULL ORDER BY RANDOM() NULLS FIRST LIMIT 500 | 0.537109 |
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
| Give me a histogram for what are all the employee ids and the names of the countries in which they work?, order in descending by the X. | SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME ORDER BY COUNTRY_NAME DESC | SELECT "COUNTRY_NAME", SUM("EMPLOYEE_ID") FROM "employees" AS "T1" JOIN "departments" AS "T2" ON "T1"."DEPARTMENT_ID" = "T2"."DEPARTMENT_ID" JOIN "locations" AS "T3" ON "T2"."LOCATION_ID" = "T3"."LOCATION_ID" JOIN "countries" AS "T4" ON "T3"."COUNTRY_ID" = "T4"."COUNTRY_ID" GROUP BY "COUNTRY_NAME" ORDER BY "COUNTRY_NAME" DESC NULLS LAST | 0.330078 |
CREATE TABLE table_name_5 (run_3 INT, run_1 VARCHAR, run_2 VARCHAR)
| What is the run 3 of the athlete with a run 1 more than 53.75 and a run 2 less than 52.91? | SELECT SUM(run_3) FROM table_name_5 WHERE run_1 > 53.75 AND run_2 < 52.91 | SELECT SUM("run_3") FROM "table_name_5" WHERE "run_1" > 53.75 AND "run_2" < 52.91 | 0.079102 |
CREATE TABLE table_24192031_2 (geographical_regions VARCHAR, contestant VARCHAR)
| What geographical region is contestant laura jim nez ynoa from? | SELECT geographical_regions FROM table_24192031_2 WHERE contestant = "Laura Jiménez Ynoa" | SELECT "geographical_regions" FROM "table_24192031_2" WHERE "Laura Jiménez Ynoa" = "contestant" | 0.092773 |
CREATE TABLE table_name_64 (main_span_feet VARCHAR, name VARCHAR)
| What is the Main span of the Qincaobei Bridge | SELECT main_span_feet FROM table_name_64 WHERE name = "qincaobei bridge" | SELECT "main_span_feet" FROM "table_name_64" WHERE "name" = "qincaobei bridge" | 0.076172 |
CREATE TABLE table_name_13 (club VARCHAR, league VARCHAR, established VARCHAR)
| What Club Established in 2010 has a League of MHL? | SELECT club FROM table_name_13 WHERE league = "mhl" AND established = 2010 | SELECT "club" FROM "table_name_13" WHERE "established" = 2010 AND "league" = "mhl" | 0.080078 |
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 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 diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime 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 vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
| tell me the name of the test that patient 013-33898 last received since 02/2104? | SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-33898')) AND STRFTIME('%y-%m', lab.labresulttime) >= '2104-02' ORDER BY lab.labresulttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '013-33898' 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 "lab"."labname" FROM "lab" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m', "lab"."labresulttime") >= '2104-02' ORDER BY "lab"."labresulttime" DESC NULLS LAST LIMIT 1 | 0.585938 |
CREATE TABLE table_name_67 (district INT, took_office VARCHAR, senator VARCHAR)
| What is the sum of District, when Took Office is greater than 1981, and when Senator is Cyndi Taylor Krier? | SELECT SUM(district) FROM table_name_67 WHERE took_office > 1981 AND senator = "cyndi taylor krier" | SELECT SUM("district") FROM "table_name_67" WHERE "cyndi taylor krier" = "senator" AND "took_office" > 1981 | 0.104492 |
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 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 lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
| Provide the number of patients under the age of 68 whose drug name is syringe (neonatal) *sw*. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "68" AND prescriptions.drug = "Syringe (Neonatal) *SW*" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "Syringe (Neonatal) *SW*" = "prescriptions"."drug" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "68" > "demographic"."age" | 0.226563 |
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 procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime 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 admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label 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 cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
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 diagnoses_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 transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_icd_diagnoses (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 d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
| what is the percentile of 2.0 in a base excess laboratory test given the same age of patient 17462 during the current hospital encounter? | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'base excess') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SELECT admissions.age FROM admissions WHERE admissions.subject_id = 17462 AND admissions.dischtime IS NULL))) AS t1 WHERE t1.valuenum = 2.0 | WITH "_u_0" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'base excess' GROUP BY "itemid"), "_u_2" AS (SELECT "admissions"."hadm_id" FROM "admissions" JOIN "admissions" AS "admissions_2" ON "admissions"."age" = "admissions_2"."age" AND "admissions_2"."dischtime" IS NULL AND "admissions_2"."subject_id" = 17462 GROUP BY "hadm_id") SELECT DISTINCT PERCENT_RANK() OVER (ORDER BY "labevents"."valuenum" NULLS FIRST) FROM "labevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "labevents"."itemid" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "labevents"."hadm_id" WHERE "labevents"."valuenum" = 2.0 AND NOT "_u_0"."" IS NULL AND NOT "_u_2"."" IS NULL | 0.661133 |
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction 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)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_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 area (course_id INT, area 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 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_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE course (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)
| What 200 -level courses are available in Spring or Summer terms ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 200 AND 200 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = course_offering.semester AND semester.year = 2016 | SELECT DISTINCT "course"."department", "course"."name", "course"."number", "semester"."semester" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" IN ('SP', 'SS', 'SU') AND "semester"."year" = 2016 WHERE "course"."department" = 'EECS' AND "course"."number" <= 300 AND "course"."number" >= 200 | 0.425781 |
CREATE TABLE table_name_31 (hometown VARCHAR, country VARCHAR)
| What is the hometown of the player from Indonesia? | SELECT hometown FROM table_name_31 WHERE country = "indonesia" | SELECT "hometown" FROM "table_name_31" WHERE "country" = "indonesia" | 0.066406 |
CREATE TABLE status (station_id INT, bikes_available INT, docks_available INT, time TEXT)
CREATE TABLE weather (date TEXT, max_temperature_f INT, mean_temperature_f INT, min_temperature_f INT, max_dew_point_f INT, mean_dew_point_f INT, min_dew_point_f INT, max_humidity INT, mean_humidity INT, min_humidity INT, max_sea_level_pressure_inches DECIMAL, mean_sea_level_pressure_inches DECIMAL, min_sea_level_pressure_inches DECIMAL, max_visibility_miles INT, mean_visibility_miles INT, min_visibility_miles INT, max_wind_Speed_mph INT, mean_wind_speed_mph INT, max_gust_speed_mph INT, precipitation_inches INT, cloud_cover INT, events TEXT, wind_dir_degrees INT, zip_code INT)
CREATE TABLE station (id INT, name TEXT, lat DECIMAL, long DECIMAL, dock_count INT, city TEXT, installation_date TEXT)
CREATE TABLE trip (id INT, duration INT, start_date TEXT, start_station_name TEXT, start_station_id INT, end_date TEXT, end_station_name TEXT, end_station_id INT, bike_id INT, subscription_type TEXT, zip_code INT)
| What is the name of every city that has at least 15 stations and how many stations does it have Visualize by bar chart, sort y axis in asc order please. | SELECT city, COUNT(*) FROM station GROUP BY city ORDER BY COUNT(*) | SELECT "city", COUNT(*) FROM "station" GROUP BY "city" ORDER BY COUNT(*) NULLS FIRST | 0.082031 |
CREATE TABLE table_3647 ("Country or territory with flag" TEXT, "Area ( km\\u00b2 ) ( per sqmi ) " TEXT, "Population ( July 2009 est. ) " FLOAT, "Population density per km\\u00b2" TEXT, "Capital" TEXT)
| What was the country with a population density per km of 3.5/km (/sqmi)? | SELECT "Country or territory with flag" FROM table_3647 WHERE "Population density per km\u00b2" = '3.5/km² (/sqmi)' | SELECT "Country or territory with flag" FROM "table_3647" WHERE "Population density per km\u00b2" = '3.5/km² (/sqmi)' | 0.114258 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
| Calculate the minimum age of spanish speaking patients who have bladder cancer/sda as their primary disease. | SELECT MIN(demographic.age) FROM demographic WHERE demographic.language = "SPAN" AND demographic.diagnosis = "BLADDER CANCER/SDA" | SELECT MIN("demographic"."age") FROM "demographic" WHERE "BLADDER CANCER/SDA" = "demographic"."diagnosis" AND "SPAN" = "demographic"."language" | 0.139648 |
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
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 VoteTypes (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 ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE FlagTypes (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 TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE 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 ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE CloseReasonTypes (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 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 ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
| FAIL! 10 most common names on Stack Overflow are where the first name is Jon. | SELECT DisplayName, COUNT(*) FROM Users WHERE DisplayName LIKE 'Jon %' GROUP BY DisplayName ORDER BY COUNT(*) DESC LIMIT 10 | SELECT "DisplayName", COUNT(*) FROM "Users" WHERE "DisplayName" LIKE 'Jon %' GROUP BY "DisplayName" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 10 | 0.138672 |
CREATE TABLE table_66122 ("School" TEXT, "Location" TEXT, "Mascot" TEXT, "Enrollment" FLOAT, "IHSAA Class" TEXT, "County" TEXT, "Primary Conference" TEXT)
| Which Enrollment has a Primary Conference of mid-hoosier, and a County of 16 decatur, and an IHSAA Class of aa? | SELECT "Enrollment" FROM table_66122 WHERE "Primary Conference" = 'mid-hoosier' AND "County" = '16 decatur' AND "IHSAA Class" = 'aa' | SELECT "Enrollment" FROM "table_66122" WHERE "County" = '16 decatur' AND "IHSAA Class" = 'aa' AND "Primary Conference" = 'mid-hoosier' | 0.130859 |
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)
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 who are less than 61 years and have pseudomonas infection in conditions classified elsewhere and of unspecified site diagnoses? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "61" AND diagnoses.long_title = "Pseudomonas infection in conditions classified elsewhere and of unspecified site" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Pseudomonas infection in conditions classified elsewhere and of unspecified site" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "61" > "demographic"."age" | 0.276367 |
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
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 PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress 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 PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE ReviewTaskResultTypes (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 Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description 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 Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, 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 Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
| Country and Reputation Wise Rank. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##CountryName##%') AND Reputation > '##Reputation##' ORDER BY Reputation DESC | SELECT ROW_NUMBER() OVER (ORDER BY "Reputation" DESC NULLS LAST) AS "#", "Id" AS "user_link", "Reputation" FROM "Users" WHERE "Reputation" > '##Reputation##' AND LOWER("Location") LIKE LOWER('%##CountryName##%') ORDER BY "Reputation" DESC NULLS LAST | 0.243164 |
CREATE TABLE table_47013 ("English Name" TEXT, "Simplified" TEXT, "Traditional" TEXT, "Pinyin" TEXT, "Area" TEXT, "Population" FLOAT, "Density" TEXT)
| What is the Population of the subdivision with the English Name of nanbin farm? | SELECT MIN("Population") FROM table_47013 WHERE "English Name" = 'nanbin farm' | SELECT MIN("Population") FROM "table_47013" WHERE "English Name" = 'nanbin farm' | 0.078125 |
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)
CREATE TABLE university (School_ID INT, School TEXT, Location TEXT, Founded FLOAT, Affiliation TEXT, Enrollment FLOAT, Nickname TEXT, Primary_conference TEXT)
| Find the total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type Show bar chart, and list by the total number in ascending. | SELECT Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation ORDER BY SUM(Enrollment) | SELECT "Affiliation", SUM("Enrollment") FROM "university" WHERE "Founded" > 1850 GROUP BY "Affiliation" ORDER BY SUM("Enrollment") NULLS FIRST | 0.138672 |
CREATE TABLE Plays_Games (StuID INT, GameID INT, Hours_Played INT)
CREATE TABLE Video_Games (GameID INT, GName VARCHAR, GType VARCHAR)
CREATE TABLE Student (StuID INT, LName VARCHAR, Fname VARCHAR, Age INT, Sex VARCHAR, Major INT, Advisor INT, city_code VARCHAR)
CREATE TABLE SportsInfo (StuID INT, SportName VARCHAR, HoursPerWeek INT, GamesPlayed INT, OnScholarship VARCHAR)
| Plot a scatter chart, avg(age) by maximal age. | SELECT AVG(Age), MAX(Age) FROM Student GROUP BY Major | SELECT AVG("Age"), MAX("Age") FROM "Student" GROUP BY "Major" | 0.05957 |
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
| For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average of salary , and group by attribute job_id in a bar chart, list in descending by the X-axis. | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | SELECT "JOB_ID", AVG("SALARY") FROM "employees" WHERE "FIRST_NAME" LIKE '%D%' OR "FIRST_NAME" LIKE '%S%' GROUP BY "JOB_ID" ORDER BY "JOB_ID" DESC NULLS LAST | 0.152344 |
CREATE TABLE table_20183474_1 (press_jury INT, artist VARCHAR)
| How many press jury points did the song by Frank Aleksandersen get? | SELECT MIN(press_jury) FROM table_20183474_1 WHERE artist = "Frank Aleksandersen" | SELECT MIN("press_jury") FROM "table_20183474_1" WHERE "Frank Aleksandersen" = "artist" | 0.084961 |
CREATE TABLE table_44266 ("Date" TEXT, "Home team" TEXT, "Score" TEXT, "Away team" TEXT, "Venue" TEXT, "Box Score" TEXT, "Report" TEXT)
| What was the report for the game with the home team of the Townsville Crocodiles? | SELECT "Report" FROM table_44266 WHERE "Home team" = 'townsville crocodiles' | SELECT "Report" FROM "table_44266" WHERE "Home team" = 'townsville crocodiles' | 0.076172 |
CREATE TABLE table_6212 ("Date" TEXT, "Course" TEXT, "Distance" TEXT, "Type" TEXT, "Winner" TEXT)
| What is the distance for the 5 September race? | SELECT "Distance" FROM table_6212 WHERE "Date" = '5 september' | SELECT "Distance" FROM "table_6212" WHERE "Date" = '5 september' | 0.0625 |
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 medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
| what was the last intake that patient 005-87465 had received on 12/30/this year? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465')) AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', intakeoutput.intakeoutputtime) = '12-30' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '005-87465' 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 "intakeoutput"."celllabel" FROM "intakeoutput" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."cellpath" LIKE '%intake%' AND DATETIME("intakeoutput"."intakeoutputtime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_1"."" IS NULL AND STRFTIME('%m-%d', "intakeoutput"."intakeoutputtime") = '12-30' ORDER BY "intakeoutput"."intakeoutputtime" DESC NULLS LAST LIMIT 1 | 0.796875 |
CREATE TABLE paperkeyphrase (paperid INT, keyphraseid INT)
CREATE TABLE paperfield (fieldid INT, paperid INT)
CREATE TABLE venue (venueid INT, venuename VARCHAR)
CREATE TABLE journal (journalid INT, journalname VARCHAR)
CREATE TABLE cite (citingpaperid INT, citedpaperid INT)
CREATE TABLE field (fieldid INT)
CREATE TABLE author (authorid INT, authorname VARCHAR)
CREATE TABLE paperdataset (paperid INT, datasetid INT)
CREATE TABLE keyphrase (keyphraseid INT, keyphrasename VARCHAR)
CREATE TABLE paper (paperid INT, title VARCHAR, venueid INT, year INT, numciting INT, numcitedby INT, journalid INT)
CREATE TABLE writes (paperid INT, authorid INT)
CREATE TABLE dataset (datasetid INT, datasetname VARCHAR)
| people working on query expansion | SELECT DISTINCT author.authorname FROM author, keyphrase, paperkeyphrase, writes WHERE keyphrase.keyphrasename LIKE 'query expansion' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid | SELECT DISTINCT "author"."authorname" FROM "author" JOIN "keyphrase" ON "keyphrase"."keyphrasename" LIKE 'query expansion' JOIN "paperkeyphrase" ON "keyphrase"."keyphraseid" = "paperkeyphrase"."keyphraseid" JOIN "writes" ON "author"."authorid" = "writes"."authorid" AND "paperkeyphrase"."paperid" = "writes"."paperid" | 0.30957 |
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)
| what is diagnoses short title of subject name tina henderson? | SELECT diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Tina Henderson" | SELECT "diagnoses"."short_title" FROM "demographic" JOIN "diagnoses" ON "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "Tina Henderson" = "demographic"."name" | 0.161133 |
CREATE TABLE table_name_45 (winning_driver VARCHAR, race VARCHAR)
| Name the winning driver for belgian grand prix | SELECT winning_driver FROM table_name_45 WHERE race = "belgian grand prix" | SELECT "winning_driver" FROM "table_name_45" WHERE "belgian grand prix" = "race" | 0.078125 |
CREATE TABLE table_62394 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT, "Money ( $ ) " FLOAT)
| Name the To par of payne stewart? | SELECT "To par" FROM table_62394 WHERE "Player" = 'payne stewart' | SELECT "To par" FROM "table_62394" WHERE "Player" = 'payne stewart' | 0.06543 |
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT)
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT)
CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR)
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR)
| all flights from DENVER to PHILADELPHIA | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" AS "AIRPORT_SERVICE_0" JOIN "city" AS "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'DENVER' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" AS "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" AS "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'PHILADELPHIA' | 0.498047 |
CREATE TABLE table_28231 ("Stage" FLOAT, "Winner" TEXT, "General classification" TEXT, "Points classification" TEXT, "Mountains classification" TEXT, "Young rider classification" TEXT, "Team classification" TEXT, "Combativity award" TEXT)
| What is every team classification when points classification is Philippe Gilbert if mountains classification is Johnny Hoogerland and stage is less than 9.0? | SELECT "Team classification" FROM table_28231 WHERE "Points classification" = 'Philippe Gilbert' AND "Mountains classification" = 'Johnny Hoogerland' AND "Stage" < '9.0' | SELECT "Team classification" FROM "table_28231" WHERE "Mountains classification" = 'Johnny Hoogerland' AND "Points classification" = 'Philippe Gilbert' AND "Stage" < '9.0' | 0.166992 |
CREATE TABLE table_name_61 (wins INT, against VARCHAR, byes VARCHAR)
| Which Wins has an Against of 1940, and a Byes larger than 0? | SELECT MAX(wins) FROM table_name_61 WHERE against = 1940 AND byes > 0 | SELECT MAX("wins") FROM "table_name_61" WHERE "against" = 1940 AND "byes" > 0 | 0.075195 |
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 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)
| calculate the number of patients who had icd9 code 8960 and got discharged to snf. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SNF" AND procedures.icd9_code = "8960" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "8960" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "SNF" = "demographic"."discharge_location" | 0.219727 |
CREATE TABLE music_festival (ID INT, Music_Festival TEXT, Date_of_ceremony TEXT, Category TEXT, Volume INT, Result TEXT)
CREATE TABLE volume (Volume_ID INT, Volume_Issue TEXT, Issue_Date TEXT, Weeks_on_Top FLOAT, Song TEXT, Artist_ID INT)
CREATE TABLE artist (Artist_ID INT, Artist TEXT, Age INT, Famous_Title TEXT, Famous_Release_date TEXT)
| Return the results of all music festivals using a pie chart. | SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result | SELECT "Result", COUNT("Result") FROM "music_festival" GROUP BY "Result" | 0.070313 |
CREATE TABLE table_203_94 (id DECIMAL, "year" DECIMAL, "player" TEXT, "country" TEXT, "score" TEXT, "to par" DECIMAL, "margin\ of victory" TEXT, "course" TEXT, "location" TEXT, "purse ( $ ) " DECIMAL, "winner's\ share ( $ ) " DECIMAL)
| who won after tiger woods in 2010 ? | SELECT "player" FROM table_203_94 WHERE "year" = 2010 | SELECT "player" FROM "table_203_94" WHERE "year" = 2010 | 0.053711 |
CREATE TABLE table_33713 ("Season" TEXT, "Tier" TEXT, "Division" TEXT, "Position" TEXT, "Top scorer" TEXT)
| What was the top scorer in the 1890-91 season? | SELECT "Top scorer" FROM table_33713 WHERE "Season" = '1890-91' | SELECT "Top scorer" FROM "table_33713" WHERE "Season" = '1890-91' | 0.063477 |
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 PostTypes (Id DECIMAL, Name 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 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 PostHistoryTypes (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 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 SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, 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 PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId 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 VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
| Top users by bounties. | SELECT UserId AS "user_link", SUM(BountyAmount) FROM Votes WHERE NOT BountyAmount IS NULL AND VoteTypeId = 8 GROUP BY UserId ORDER BY SUM(BountyAmount) DESC | SELECT "UserId" AS "user_link", SUM("BountyAmount") FROM "Votes" WHERE "VoteTypeId" = 8 AND NOT "BountyAmount" IS NULL GROUP BY "UserId" ORDER BY SUM("BountyAmount") DESC NULLS LAST | 0.176758 |
CREATE TABLE table_1759 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Game site" TEXT, "Record" TEXT, "Attendance" FLOAT)
| The opponent was the New York Jets on what week? | SELECT "Week" FROM table_1759 WHERE "Opponent" = 'New York Jets' | SELECT "Week" FROM "table_1759" WHERE "Opponent" = 'New York Jets' | 0.064453 |
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_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)
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_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE 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 patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod 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 outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto 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 microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
| when did patient 50065 receive direct antigen test for herpes simplex virus types 1 & 2 microbiology test the first time in 04/this year? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 50065) AND microbiologyevents.spec_type_desc = 'direct antigen test for herpes simplex virus types 1 & 2' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', microbiologyevents.charttime) = '04' ORDER BY microbiologyevents.charttime LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 50065 GROUP BY "hadm_id") SELECT "microbiologyevents"."charttime" FROM "microbiologyevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "microbiologyevents"."hadm_id" WHERE "microbiologyevents"."spec_type_desc" = 'direct antigen test for herpes simplex virus types 1 & 2' AND DATETIME("microbiologyevents"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_0"."" IS NULL AND STRFTIME('%m', "microbiologyevents"."charttime") = '04' ORDER BY "microbiologyevents"."charttime" NULLS FIRST LIMIT 1 | 0.619141 |
CREATE TABLE table_6785 ("Institution" TEXT, "Location" TEXT, "Founded" FLOAT, "Type" TEXT, "Enrollment" FLOAT, "Nickname" TEXT, "Joined" TEXT, "Left" TEXT, "Current Conference" TEXT)
| What is the total number of teams founded that were left in 1976? | SELECT SUM("Founded") FROM table_6785 WHERE "Left" = '1976' | SELECT SUM("Founded") FROM "table_6785" WHERE "Left" = '1976' | 0.05957 |
CREATE TABLE LOTS (lot_details VARCHAR)
| Show all distinct lot details. | SELECT DISTINCT lot_details FROM LOTS | SELECT DISTINCT "lot_details" FROM "LOTS" | 0.040039 |
CREATE TABLE table_1670921_2 (runs VARCHAR, fielding_team VARCHAR)
| How many runs when bangladesh was the fielding team? | SELECT runs FROM table_1670921_2 WHERE fielding_team = "Bangladesh" | SELECT "runs" FROM "table_1670921_2" WHERE "Bangladesh" = "fielding_team" | 0.071289 |
CREATE TABLE Participates_in (stuid INT, actid INT)
CREATE TABLE Faculty_Participates_in (FacID INT, actid INT)
CREATE TABLE Activity (actid INT, activity_name VARCHAR)
CREATE TABLE Faculty (FacID INT, Lname VARCHAR, Fname VARCHAR, Rank VARCHAR, Sex VARCHAR, Phone INT, Room VARCHAR, Building VARCHAR)
CREATE TABLE Student (StuID INT, LName VARCHAR, Fname VARCHAR, Age INT, Sex VARCHAR, Major INT, Advisor INT, city_code VARCHAR)
| Return a pie on how many faculty members does each building have? List the result with the name of the building. | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building | SELECT "Building", COUNT(*) FROM "Faculty" GROUP BY "Building" | 0.060547 |
CREATE TABLE table_48976 ("Competition" TEXT, "Played" FLOAT, "Millwall wins" FLOAT, "Drawn" FLOAT, "West Ham wins" FLOAT, "Millwall goals" FLOAT, "West Ham goals" FLOAT)
| How many wins did West Ham get when Millwall had more than 23 goal and 5 wins, and they tied 8 times? | SELECT "West Ham wins" FROM table_48976 WHERE "Millwall wins" > '5' AND "Millwall goals" > '23' AND "Drawn" = '8' | SELECT "West Ham wins" FROM "table_48976" WHERE "Drawn" = '8' AND "Millwall goals" > '23' AND "Millwall wins" > '5' | 0.112305 |
CREATE TABLE table_name_76 (film VARCHAR, year VARCHAR)
| What film was released in 1996? | SELECT film FROM table_name_76 WHERE year = 1996 | SELECT "film" FROM "table_name_76" WHERE "year" = 1996 | 0.052734 |
CREATE TABLE table_58092 ("Rank" TEXT, "Nation" TEXT, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
| Which rank has more than 1 silver, more than 1 gold, and more than 4 bronze? | SELECT "Rank" FROM table_58092 WHERE "Silver" > '1' AND "Gold" > '1' AND "Bronze" > '4' | SELECT "Rank" FROM "table_58092" WHERE "Bronze" > '4' AND "Gold" > '1' AND "Silver" > '1' | 0.086914 |
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 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 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 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 PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE CloseReasonTypes (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 ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount 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 VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
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 PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId 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 FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskTypes (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 PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
| Retrieve posts of a user-specified tag and with keywords in body and title. | SELECT Posts.Id AS "post_link", Posts.Title, ViewCount FROM Tags JOIN PostTags ON PostTags.TagId = Tags.Id JOIN Posts ON Posts.Id = PostTags.PostId WHERE Tags.TagName = '##TagName##' AND (LENGTH(Posts.Body) <= 1000) AND ((Posts.Body LIKE '%compare(%') OR (Posts.Body LIKE '%compareTo%') OR (Posts.Body LIKE '%<code>%')) AND (Posts.Body LIKE '%total order%' OR Posts.Body LIKE '%transitive%' OR Posts.Body LIKE '%symmetric%' OR Posts.Body LIKE '%reflexive%') GROUP BY Posts.Id, Posts.Title, Posts.ViewCount | SELECT "Posts"."Id" AS "post_link", "Posts"."Title", "ViewCount" FROM "Tags" JOIN "PostTags" ON "PostTags"."TagId" = "Tags"."Id" JOIN "Posts" ON "PostTags"."PostId" = "Posts"."Id" AND ("Posts"."Body" LIKE '%<code>%' OR "Posts"."Body" LIKE '%compare(%' OR "Posts"."Body" LIKE '%compareTo%') AND ("Posts"."Body" LIKE '%reflexive%' OR "Posts"."Body" LIKE '%symmetric%' OR "Posts"."Body" LIKE '%total order%' OR "Posts"."Body" LIKE '%transitive%') AND LENGTH("Posts"."Body") <= 1000 WHERE "Tags"."TagName" = '##TagName##' GROUP BY "Posts"."Id", "Posts"."Title", "Posts"."ViewCount" | 0.563477 |
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_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto 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 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 patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod 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 labevents (row_id DECIMAL, subject_id DECIMAL, hadm_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 outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
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 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 procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
| had patient 74159 received a test of oxygen saturation in their first hospital visit? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'oxygen saturation') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74159 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) | WITH "_u_0" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'oxygen saturation' GROUP BY "itemid") SELECT COUNT(*) > 0 FROM "labevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "labevents"."itemid" WHERE "labevents"."hadm_id" IN (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 74159 AND NOT "admissions"."dischtime" IS NULL ORDER BY "admissions"."admittime" NULLS FIRST LIMIT 1) AND NOT "_u_0"."" IS NULL | 0.460938 |
CREATE TABLE Dorm (dormid INT, dorm_name VARCHAR, student_capacity INT, gender VARCHAR)
CREATE TABLE Dorm_amenity (amenid INT, amenity_name VARCHAR)
CREATE TABLE Lives_in (stuid INT, dormid INT, room_number INT)
CREATE TABLE Has_amenity (dormid INT, amenid INT)
CREATE TABLE Student (StuID INT, LName VARCHAR, Fname VARCHAR, Age INT, Sex VARCHAR, Major INT, Advisor INT, city_code VARCHAR)
| What is the average age for each dorm and what are the names of each dorm Plot them as bar chart, and I want to display by the y axis in descending. | SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY AVG(T1.Age) DESC | SELECT "dorm_name", AVG("T1"."Age") FROM "Student" AS "T1" JOIN "Lives_in" AS "T2" ON "T1"."stuid" = "T2"."stuid" JOIN "Dorm" AS "T3" ON "T2"."dormid" = "T3"."dormid" GROUP BY "T3"."dorm_name" ORDER BY AVG("T1"."Age") DESC NULLS LAST | 0.227539 |
CREATE TABLE table_49998 ("Player" TEXT, "Country" TEXT, "Year ( s ) won" TEXT, "Total" FLOAT, "To par" TEXT, "Finish" TEXT)
| What country has a +3 to par? | SELECT "Country" FROM table_49998 WHERE "To par" = '+3' | SELECT "Country" FROM "table_49998" WHERE "To par" = '+3' | 0.055664 |
CREATE TABLE table_57308 ("Rank" FLOAT, "English title" TEXT, "Chinese title" TEXT, "Average" FLOAT, "Peak" FLOAT, "Premiere" FLOAT, "Finale" FLOAT, "HK viewers" TEXT)
| What is the Average of Men in Pain with a Finale of less than 33? | SELECT AVG("Average") FROM table_57308 WHERE "English title" = 'men in pain' AND "Finale" < '33' | SELECT AVG("Average") FROM "table_57308" WHERE "English title" = 'men in pain' AND "Finale" < '33' | 0.095703 |
CREATE TABLE table_8193 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT, "Money ( $ ) " TEXT)
| What was Tom Kite's to par? | SELECT "To par" FROM table_8193 WHERE "Player" = 'tom kite' | SELECT "To par" FROM "table_8193" WHERE "Player" = 'tom kite' | 0.05957 |
CREATE TABLE table_23214 ("Institution" TEXT, "Location" TEXT, "Nickname" TEXT, "Founded" FLOAT, "Type" TEXT, "Enrollment" FLOAT, "Joined" FLOAT)
| On how many different dates did schools from Chestnut Hill, Massachusetts join the conference? | SELECT COUNT("Joined") FROM table_23214 WHERE "Location" = 'Chestnut Hill, Massachusetts' | SELECT COUNT("Joined") FROM "table_23214" WHERE "Location" = 'Chestnut Hill, Massachusetts' | 0.088867 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.