schema
stringlengths 29
5.42k
| question
stringlengths 0
752
| rejected
stringlengths 2
4.44k
| chosen
stringlengths 4
8.94k
| weight
float64 0
8.73
|
---|---|---|---|---|
CREATE TABLE table_name_64 (name VARCHAR2, heat VARCHAR2, country VARCHAR2)
| Who is in heat 5 from Guyana? | SELECT name FROM table_name_64 WHERE heat = 5 AND country = "guyana" | SELECT "name" FROM "table_name_64" WHERE "country" = "guyana" AND "heat" = 5 | 0.074219 |
CREATE TABLE table_204_262 (id NUMBER, "rank" NUMBER, "athlete" CLOB, "time" CLOB, "notes" CLOB, "q" CLOB)
| what was the time of the person who finished first ? | SELECT "time" FROM table_204_262 WHERE "rank" = 1 | SELECT "time" FROM "table_204_262" WHERE "rank" = 1 | 0.049805 |
CREATE TABLE table_33504 ("Year" FLOAT, "Player" CLOB, "Nationality" CLOB, "Position played" CLOB, "Team represented" CLOB)
| What is the latest year featuring candace parker? | SELECT MAX("Year") FROM table_33504 WHERE "Player" = 'candace parker' | SELECT MAX("Year") FROM "table_33504" WHERE "Player" = 'candace parker' | 0.069336 |
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2)
| list the earliest flights from ATLANTA to DENVER on a MONDAY | 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, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND days.day_name = 'MONDAY' AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time = (SELECT MIN(FLIGHTalias1.departure_time) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, days AS DAYSalias1, flight AS FLIGHTalias1 WHERE (CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'DENVER' AND DAYSalias1.day_name = 'MONDAY' AND FLIGHTalias1.flight_days = DAYSalias1.days_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'ATLANTA' AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code) | WITH "_u_0" AS (SELECT MIN("FLIGHTalias1"."departure_time") FROM "airport_service" "AIRPORT_SERVICEalias2" JOIN "city" "CITYalias2" ON "AIRPORT_SERVICEalias2"."city_code" = "CITYalias2"."city_code" AND "CITYalias2"."city_name" = 'ATLANTA' JOIN "flight" "FLIGHTalias1" ON "AIRPORT_SERVICEalias2"."airport_code" = "FLIGHTalias1"."from_airport" JOIN "airport_service" "AIRPORT_SERVICEalias3" ON "AIRPORT_SERVICEalias3"."airport_code" = "FLIGHTalias1"."to_airport" JOIN "days" "DAYSalias1" ON "DAYSalias1"."day_name" = 'MONDAY' AND "DAYSalias1"."days_code" = "FLIGHTalias1"."flight_days" JOIN "city" "CITYalias3" ON "AIRPORT_SERVICEalias3"."city_code" = "CITYalias3"."city_code" AND "CITYalias3"."city_name" = 'DENVER') SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'ATLANTA' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "_u_0" "_u_0" ON "_u_0"."" = "flight"."departure_time" JOIN "days" ON "days"."day_name" = 'MONDAY' AND "days"."days_code" = "flight"."flight_days" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'DENVER' | 1.329102 |
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
| tell me the method of intake of pantoprazole 40 mg intravenous solution? | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'pantoprazole 40 mg intravenous solution' | SELECT DISTINCT "medication"."routeadmin" FROM "medication" WHERE "medication"."drugname" = 'pantoprazole 40 mg intravenous solution' | 0.129883 |
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
| in 2105 what were the top three most frequent lab tests given to patients during the same month after they were diagnosed with acq spondylolisthesis? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime 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 = 'acq spondylolisthesis') AND STRFTIME('%y', diagnoses_icd.charttime) = '2105') AS t1 JOIN (SELECT admissions.subject_id, labevents.itemid, labevents.charttime FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', labevents.charttime) = '2105') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.itemid) AS t3 WHERE t3.c1 <= 3) | WITH "t2" AS (SELECT "admissions"."subject_id", "labevents"."itemid", "labevents"."charttime" FROM "labevents" JOIN "admissions" ON "admissions"."hadm_id" = "labevents"."hadm_id" WHERE STRFTIME('%y', "labevents"."charttime") = '2105'), "t3" AS (SELECT "t2"."itemid", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) 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" = 'acq spondylolisthesis' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" JOIN "t2" "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 STRFTIME('%y', "diagnoses_icd"."charttime") = '2105' GROUP BY "t2"."itemid"), "_u_1" AS (SELECT "t3"."itemid" FROM "t3" "t3" WHERE "t3"."c1" <= 3 GROUP BY "itemid") SELECT "d_labitems"."label" FROM "d_labitems" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "d_labitems"."itemid" WHERE NOT "_u_1"."" IS NULL | 1.060547 |
CREATE TABLE table_17628022_2 (play_by_play VARCHAR2, pregame_host VARCHAR2, sideline_reporters VARCHAR2)
| Who did the play-by-play when the pregame host was Brian Williams and the sideline reporters were Steve Armitage and Brenda Irving? | SELECT play_by_play FROM table_17628022_2 WHERE pregame_host = "Brian Williams" AND sideline_reporters = "Steve Armitage and Brenda Irving" | SELECT "play_by_play" FROM "table_17628022_2" WHERE "Brian Williams" = "pregame_host" AND "Steve Armitage and Brenda Irving" = "sideline_reporters" | 0.143555 |
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
| what are the four most commonly prescribed medications during this year for patients who were previously diagnosed with respiratory arrest in the same month? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'respiratory arrest' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.drugstarttime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.drugstarttime, 'start of month') GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 4 | WITH "t2" AS (SELECT "patient"."uniquepid", "medication"."drugname", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" WHERE DATETIME("medication"."drugstarttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')), "t3" AS (SELECT "t2"."drugname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" "t2" ON "diagnosis"."diagnosistime" < "t2"."drugstarttime" AND "patient"."uniquepid" = "t2"."uniquepid" AND DATETIME("diagnosis"."diagnosistime", 'start of month') = DATETIME("t2"."drugstarttime", 'start of month') WHERE "diagnosis"."diagnosisname" = 'respiratory arrest' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY "t2"."drugname") SELECT "t3"."drugname" FROM "t3" "t3" WHERE "t3"."c1" <= 4 | 0.958008 |
CREATE TABLE table_44119 ("Rank" FLOAT, "Title" CLOB, "Studio" CLOB, "Director" CLOB, "Gross" CLOB)
| What is the rank of the film directed by Kevin Costner? | SELECT COUNT("Rank") FROM table_44119 WHERE "Director" = 'kevin costner' | SELECT COUNT("Rank") FROM "table_44119" WHERE "Director" = 'kevin costner' | 0.072266 |
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
| how much change in patient 010-12376's weight second measured on the first hospital visit compared to the value first measured on the first hospital visit? | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-12376' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1) - (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-12376' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1) | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '010-12376' AND NOT "patient"."hospitaldischargetime" IS NULL GROUP BY "patienthealthsystemstayid" ORDER BY "patient"."hospitaladmittime" FETCH FIRST 1 ROWS ONLY) SELECT (SELECT "patient"."admissionweight" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL AND NOT "patient"."admissionweight" IS NULL ORDER BY "patient"."unitadmittime" OFFSET 1 ROWS FETCH FIRST 1 ROWS ONLY) - (SELECT "patient"."admissionweight" FROM "patient" LEFT JOIN "_u_0" "_u_2" ON "_u_2"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_2"."" IS NULL AND NOT "patient"."admissionweight" IS NULL ORDER BY "patient"."unitadmittime" FETCH FIRST 1 ROWS ONLY) | 0.791992 |
CREATE TABLE table_51620 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
| Who played Melbourne as the home team? | SELECT "Home team" FROM table_51620 WHERE "Away team" = 'melbourne' | SELECT "Home team" FROM "table_51620" WHERE "Away team" = 'melbourne' | 0.067383 |
CREATE TABLE table_name_81 (position VARCHAR2, round VARCHAR2, overall VARCHAR2)
| What is the position of the player with a round less than 8 and an overall of 48? | SELECT position FROM table_name_81 WHERE round < 8 AND overall = 48 | SELECT "position" FROM "table_name_81" WHERE "overall" = 48 AND "round" < 8 | 0.073242 |
CREATE TABLE table_name_41 (score VARCHAR2, opponent_in_the_final VARCHAR2)
| What is the score of the tournament with olivier dela tre as the opponent in the final? | SELECT score FROM table_name_41 WHERE opponent_in_the_final = "olivier delaître" | SELECT "score" FROM "table_name_41" WHERE "olivier delaître" = "opponent_in_the_final" | 0.083984 |
CREATE TABLE table_27666856_3 (team VARCHAR2, position_in_table VARCHAR2)
| Name the number of team for 19th position | SELECT COUNT(team) FROM table_27666856_3 WHERE position_in_table = "19th" | SELECT COUNT("team") FROM "table_27666856_3" WHERE "19th" = "position_in_table" | 0.077148 |
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
| what were the top three most common diagnoses of patients aged 30s until 2102. | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', diagnosis.diagnosistime) <= '2102' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3 | WITH "_u_0" AS (SELECT "patient"."patientunitstayid" FROM "patient" WHERE "patient"."age" <= 39 AND "patient"."age" >= 30 GROUP BY "patientunitstayid"), "t1" AS (SELECT "diagnosis"."diagnosisname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "diagnosis" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "diagnosis"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL AND STRFTIME('%y', "diagnosis"."diagnosistime") <= '2102' GROUP BY "diagnosis"."diagnosisname") SELECT "t1"."diagnosisname" FROM "t1" "t1" WHERE "t1"."c1" <= 3 | 0.511719 |
CREATE TABLE table_74274 ("Pick" FLOAT, "Player" CLOB, "Position" CLOB, "Nationality" CLOB, "NHL team" CLOB, "College/junior/club team" CLOB)
| Name the college for andrej podkonicky | SELECT "College/junior/club team" FROM table_74274 WHERE "Player" = 'Andrej Podkonicky' | SELECT "College/junior/club team" FROM "table_74274" WHERE "Player" = 'Andrej Podkonicky' | 0.086914 |
CREATE TABLE table_17355933_1 (title VARCHAR2, directed_by VARCHAR2)
| Which season titles were directed by Laura Innes? | SELECT title FROM table_17355933_1 WHERE directed_by = "Laura Innes" | SELECT "title" FROM "table_17355933_1" WHERE "Laura Innes" = "directed_by" | 0.072266 |
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| what is subject name of subject id 65652? | SELECT demographic.name FROM demographic WHERE demographic.subject_id = "65652" | SELECT "demographic"."name" FROM "demographic" WHERE "65652" = "demographic"."subject_id" | 0.086914 |
CREATE TABLE table_name_53 (total_time___s__ VARCHAR2, horse VARCHAR2)
| What is the total time (s) for the horse Pinot Grigio? | SELECT total_time___s__ FROM table_name_53 WHERE horse = "pinot grigio" | SELECT "total_time___s__" FROM "table_name_53" WHERE "horse" = "pinot grigio" | 0.075195 |
CREATE TABLE table_name_81 (inclination VARCHAR2, eccentricity VARCHAR2)
| What Inclination has Eccentricity of 0.06 +0.06 0.11? | SELECT inclination FROM table_name_81 WHERE eccentricity = "0.06 +0.06 −0.11" | SELECT "inclination" FROM "table_name_81" WHERE "0.06 +0.06 −0.11" = "eccentricity" | 0.081055 |
CREATE TABLE table_35722 ("Result" CLOB, "Date" CLOB, "Race" CLOB, "Venue" CLOB, "Group" CLOB, "Distance" CLOB, "Weight ( kg ) " FLOAT, "Jockey" CLOB, "Winner/2nd" CLOB)
| How far did p. carbery run to get 2nd? | SELECT "Distance" FROM table_35722 WHERE "Jockey" = 'p. carbery' AND "Result" = '2nd' | SELECT "Distance" FROM "table_35722" WHERE "Jockey" = 'p. carbery' AND "Result" = '2nd' | 0.084961 |
CREATE TABLE table_name_4 (season VARCHAR2, european_cup VARCHAR2, national_cup VARCHAR2)
| Which season is Euroleague with Greek Cup? | SELECT season FROM table_name_4 WHERE european_cup = "euroleague" AND national_cup = "greek cup" | SELECT "season" FROM "table_name_4" WHERE "euroleague" = "european_cup" AND "greek cup" = "national_cup" | 0.101563 |
CREATE TABLE table_10648 ("Tournament" CLOB, "Winner" CLOB, "Runner-up" CLOB, "Score" CLOB, "Third Place" CLOB)
| Tell me the runner-up for majorca | SELECT "Runner-up" FROM table_10648 WHERE "Tournament" = 'majorca' | SELECT "Runner-up" FROM "table_10648" WHERE "Tournament" = 'majorca' | 0.066406 |
CREATE TABLE table_name_97 (lomavren VARCHAR2, hindi VARCHAR2)
| What Lomavren word has the same meaning as the Hindi word do? | SELECT lomavren FROM table_name_97 WHERE hindi = "do" | SELECT "lomavren" FROM "table_name_97" WHERE "do" = "hindi" | 0.057617 |
CREATE TABLE basketball_match (Team_ID NUMBER, School_ID NUMBER, Team_Name CLOB, ACC_Regular_Season CLOB, ACC_Percent CLOB, ACC_Home CLOB, ACC_Road CLOB, All_Games CLOB, All_Games_Percent NUMBER, All_Home CLOB, All_Road CLOB, All_Neutral CLOB)
CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB)
| Visualize a bar chart about the distribution of All_Home and School_ID , and group by attribute ACC_Home. | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home | SELECT "All_Home", "School_ID" FROM "basketball_match" GROUP BY "ACC_Home", "All_Home" | 0.083984 |
CREATE TABLE table_19401346_1 (title VARCHAR2, original_air_date VARCHAR2)
| What's the title of the episode originally aired on September 23, 2008? | SELECT title FROM table_19401346_1 WHERE original_air_date = "September 23, 2008" | SELECT "title" FROM "table_19401346_1" WHERE "September 23, 2008" = "original_air_date" | 0.084961 |
CREATE TABLE table_name_97 (date VARCHAR2, event VARCHAR2)
| What date was the 1500 m freestyle competition? | SELECT date FROM table_name_97 WHERE event = "1500 m freestyle" | SELECT "date" FROM "table_name_97" WHERE "1500 m freestyle" = "event" | 0.067383 |
CREATE TABLE table_name_22 (city VARCHAR2, event VARCHAR2)
| What city was the Dick Weber Open in? | SELECT city FROM table_name_22 WHERE event = "dick weber open" | SELECT "city" FROM "table_name_22" WHERE "dick weber open" = "event" | 0.066406 |
CREATE TABLE Guests (guest_id NUMBER, gender_code CHAR, guest_first_name VARCHAR2, guest_last_name VARCHAR2, date_of_birth DATETIME)
CREATE TABLE Apartment_Facilities (apt_id NUMBER, facility_code CHAR)
CREATE TABLE View_Unit_Status (apt_id NUMBER, apt_booking_id NUMBER, status_date DATETIME, available_yn BIT)
CREATE TABLE Apartments (apt_id NUMBER, building_id NUMBER, apt_type_code CHAR, apt_number CHAR, bathroom_count NUMBER, bedroom_count NUMBER, room_count CHAR)
CREATE TABLE Apartment_Bookings (apt_booking_id NUMBER, apt_id NUMBER, guest_id NUMBER, booking_status_code CHAR, booking_start_date DATETIME, booking_end_date DATETIME)
CREATE TABLE Apartment_Buildings (building_id NUMBER, building_short_name CHAR, building_full_name VARCHAR2, building_description VARCHAR2, building_address VARCHAR2, building_manager VARCHAR2, building_phone VARCHAR2)
| A pie chart for what are the number of the facility codes of the apartments with more than four bedrooms? | SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code | SELECT "facility_code", COUNT("facility_code") FROM "Apartment_Facilities" "T1" JOIN "Apartments" "T2" ON "T1"."apt_id" = "T2"."apt_id" AND "T2"."bedroom_count" > 4 GROUP BY "facility_code" | 0.18457 |
CREATE TABLE table_713 ("District" CLOB, "Incumbent" CLOB, "Party" CLOB, "First elected" FLOAT, "Result" CLOB, "Candidates" CLOB)
| What is the result for barney frank? | SELECT "Result" FROM table_713 WHERE "Incumbent" = 'Barney Frank' | SELECT "Result" FROM "table_713" WHERE "Incumbent" = 'Barney Frank' | 0.06543 |
CREATE TABLE table_69493 ("Date" CLOB, "Visitor" CLOB, "Score" CLOB, "Home" CLOB, "Decision" CLOB, "Attendance" FLOAT, "Record" CLOB)
| Name the record for february 25 | SELECT "Record" FROM table_69493 WHERE "Date" = 'february 25' | SELECT "Record" FROM "table_69493" WHERE "Date" = 'february 25' | 0.061523 |
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
| what were the four most frequent drugs that were prescribed to male patients in the 60 or above in the same hospital visit after being diagnosed with status-post ptca since 2105? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'status-post ptca') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2105') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id IN (SELECT patients.subject_id FROM patients WHERE patients.gender = 'm') AND admissions.age >= 60 AND STRFTIME('%y', prescriptions.startdate) >= '2105') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND t1.hadm_id = t2.hadm_id GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 4 | WITH "_u_1" AS (SELECT "patients"."subject_id" FROM "patients" WHERE "patients"."gender" = 'm' GROUP BY "subject_id"), "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."drug", "prescriptions"."startdate", "admissions"."hadm_id" FROM "prescriptions" JOIN "admissions" ON "admissions"."age" >= 60 AND "admissions"."hadm_id" = "prescriptions"."hadm_id" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "admissions"."subject_id" WHERE NOT "_u_1"."" IS NULL AND STRFTIME('%y', "prescriptions"."startdate") >= '2105'), "t3" AS (SELECT "t2"."drug", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) 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" = 'status-post ptca' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" JOIN "t2" "t2" ON "admissions"."hadm_id" = "t2"."hadm_id" AND "admissions"."subject_id" = "t2"."subject_id" AND "diagnoses_icd"."charttime" < "t2"."startdate" WHERE STRFTIME('%y', "diagnoses_icd"."charttime") >= '2105' GROUP BY "t2"."drug") SELECT "t3"."drug" FROM "t3" "t3" WHERE "t3"."c1" <= 4 | 1.097656 |
CREATE TABLE table_name_45 (giant_slalom VARCHAR2, career VARCHAR2, victories VARCHAR2, slalom VARCHAR2)
| What Giant Slalom has Victories larger than 27, a Slalom of , and a Career of 1996 2009? | SELECT giant_slalom FROM table_name_45 WHERE victories > 27 AND slalom = "–" AND career = "1996–2009" | SELECT "giant_slalom" FROM "table_name_45" WHERE "1996–2009" = "career" AND "slalom" = "–" AND "victories" > 27 | 0.108398 |
CREATE TABLE table_name_94 (against VARCHAR2, opponents VARCHAR2)
| Who was against the opponents, m d lina gojnea monica niculescu? | SELECT against FROM table_name_94 WHERE opponents = "mădălina gojnea monica niculescu" | SELECT "against" FROM "table_name_94" WHERE "mădălina gojnea monica niculescu" = "opponents" | 0.089844 |
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
| give me the number of patients whose death status is 1 and diagnoses icd9 code is v5883? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "V5883" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "V5883" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "1" = "demographic"."expire_flag" | 0.208984 |
CREATE TABLE table_68630 ("Nation" CLOB, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
| Name the least silver for nation of total when bronze is more than 24 | SELECT MIN("Silver") FROM table_68630 WHERE "Nation" = 'total' AND "Bronze" > '24' | SELECT MIN("Silver") FROM "table_68630" WHERE "Bronze" > '24' AND "Nation" = 'total' | 0.082031 |
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
| list the ids of patients who have been diagnosed with acute pulmonary edema - due to myocardial ischemia or infarction since 5 years ago. | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'acute pulmonary edema - due to myocardial ischemia or infarction' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-5 year')) | WITH "_u_0" AS (SELECT "diagnosis"."patientunitstayid" FROM "diagnosis" WHERE "diagnosis"."diagnosisname" = 'acute pulmonary edema - due to myocardial ischemia or infarction' AND DATETIME("diagnosis"."diagnosistime") >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY "patientunitstayid") SELECT "patient"."uniquepid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL | 0.416016 |
CREATE TABLE table_36815 ("Player" CLOB, "County" CLOB, "Tally" CLOB, "Total" FLOAT, "Matches" FLOAT, "Average" FLOAT)
| With a Total of less than 29, what is Ian Ryan's most Matches? | SELECT MAX("Matches") FROM table_36815 WHERE "Player" = 'ian ryan' AND "Total" < '29' | SELECT MAX("Matches") FROM "table_36815" WHERE "Player" = 'ian ryan' AND "Total" < '29' | 0.084961 |
CREATE TABLE table_name_90 (wins VARCHAR2, year VARCHAR2, class VARCHAR2, points VARCHAR2, team VARCHAR2)
| How many wins for bikes with under 54 points, team yamaha, a 250cc bike, and before 1977? | SELECT COUNT(wins) FROM table_name_90 WHERE points < 54 AND team = "yamaha" AND class = "250cc" AND year < 1977 | SELECT COUNT("wins") FROM "table_name_90" WHERE "250cc" = "class" AND "points" < 54 AND "team" = "yamaha" AND "year" < 1977 | 0.120117 |
CREATE TABLE table_train_137 ("id" NUMBER, "hbv" BOOLEAN, "systolic_blood_pressure_sbp" NUMBER, "hemoglobin_a1c_hba1c" FLOAT, "substance_dependence" BOOLEAN, "hcv" BOOLEAN, "schizophrenia" BOOLEAN, "neutrophil_count" NUMBER, "renal_disease" BOOLEAN, "creatinine_clearance_cl" FLOAT, "platelet_count" FLOAT, "diastolic_greater_than" NUMBER, "pulse_rate" NUMBER, "bipolar_disorder" BOOLEAN, "delusional_disorder" BOOLEAN, "serum_creatinine" FLOAT, "alcohol_abuse" BOOLEAN, "primary_psychotic_disorder" BOOLEAN, "bilirubin" FLOAT, "schizoaffective_disorder" BOOLEAN, "NOUSE" FLOAT)
| patient has a systolic blood pressure ( sitting ) of greater than 150 mmhg, a diastolic ( sitting ) greater than 95 mmhg, a decrease in systolic blood pressure of more than 30 mmhg upon standing for 2 minutes from a sitting or supine position, or a pulse ( sitting or supine ) less than 55 or greater than 85 . | SELECT * FROM table_train_137 WHERE (systolic_blood_pressure_sbp > 150 OR diastolic_greater_than > 95) OR (pulse_rate < 55 OR pulse_rate > 85) | SELECT * FROM "table_train_137" WHERE "diastolic_greater_than" > 95 OR "pulse_rate" < 55 OR "pulse_rate" > 85 OR "systolic_blood_pressure_sbp" > 150 | 0.144531 |
CREATE TABLE customer_contact_channels (customer_id NUMBER, channel_code CLOB, active_from_date TIME, active_to_date TIME, contact_number CLOB)
CREATE TABLE order_items (order_id NUMBER, product_id NUMBER, order_quantity CLOB)
CREATE TABLE customer_orders (order_id NUMBER, customer_id NUMBER, order_status CLOB, order_date TIME, order_details CLOB)
CREATE TABLE customers (customer_id NUMBER, payment_method CLOB, customer_name CLOB, date_became_customer TIME, other_customer_details CLOB)
CREATE TABLE products (product_id NUMBER, product_details CLOB)
CREATE TABLE addresses (address_id NUMBER, address_content CLOB, city CLOB, zip_postcode CLOB, state_province_county CLOB, country CLOB, other_address_details CLOB)
CREATE TABLE customer_addresses (customer_id NUMBER, address_id NUMBER, date_address_from TIME, address_type CLOB, date_address_to TIME)
| What is the average time span of contact channels in the database? | SELECT AVG(active_to_date - active_from_date) FROM customer_contact_channels | SELECT AVG("active_to_date" - "active_from_date") FROM "customer_contact_channels" | 0.080078 |
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| what is the number of patients whose gender is m and procedure icd9 code is 9703? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "9703" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "9703" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "M" = "demographic"."gender" | 0.206055 |
CREATE TABLE table_6859 ("Couple" CLOB, "Style" CLOB, "Music" CLOB, "Choreographer ( s ) " CLOB, "Chosen by" CLOB)
| What is Choreographer(s), when Chosen By is Mary Murphy, and when Couple is Katee Shean Stephen 'Twitch' Boss? | SELECT "Choreographer(s)" FROM table_6859 WHERE "Chosen by" = 'mary murphy' AND "Couple" = 'katee shean stephen "twitch" boss' | SELECT "Choreographer(s)" FROM "table_6859" WHERE "Chosen by" = 'mary murphy' AND "Couple" = 'katee shean stephen "twitch" boss' | 0.125 |
CREATE TABLE table_191 ("Team" CLOB, "Head Coach" CLOB, "President" CLOB, "Home Ground" CLOB, "Location" CLOB, "Founded" FLOAT, "Website" CLOB)
| The head coach, steve radoslavic, is related to which websites? | SELECT "Website" FROM table_191 WHERE "Head Coach" = 'Steve Radoslavic' | SELECT "Website" FROM "table_191" WHERE "Head Coach" = 'Steve Radoslavic' | 0.071289 |
CREATE TABLE table_9006 ("Place" CLOB, "Player" CLOB, "Country" CLOB, "Score" CLOB, "To par" CLOB, "Money ( $ ) " FLOAT)
| What is the Money of the Player with a Score of 71-66-74-67=278? | SELECT AVG("Money ( $ )") FROM table_9006 WHERE "Score" = '71-66-74-67=278' | SELECT AVG("Money ( $ )") FROM "table_9006" WHERE "Score" = '71-66-74-67=278' | 0.075195 |
CREATE TABLE table_27833469_1 (series__number VARCHAR2, season__number VARCHAR2)
| What is the series number for the episode number 10 of the season? | SELECT series__number FROM table_27833469_1 WHERE season__number = "10" | SELECT "series__number" FROM "table_27833469_1" WHERE "10" = "season__number" | 0.075195 |
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
| For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the phone_number by a bar chart, list by the names from high to low. | SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC | SELECT "PHONE_NUMBER", "COMMISSION_PCT" FROM "employees" WHERE NOT "DEPARTMENT_ID" IN (SELECT "DEPARTMENT_ID" FROM "departments" WHERE "MANAGER_ID" <= 200 AND "MANAGER_ID" >= 100) ORDER BY "PHONE_NUMBER" DESC | 0.203125 |
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
| when was the first time patient 30296 has been diagnosed with liver transplant status since 2105? | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'liver transplant status') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30296) AND STRFTIME('%y', diagnoses_icd.charttime) >= '2105' ORDER BY diagnoses_icd.charttime LIMIT 1 | WITH "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 30296 GROUP BY "hadm_id") SELECT "diagnoses_icd"."charttime" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'liver transplant status' LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "diagnoses_icd"."hadm_id" WHERE NOT "_u_1"."" IS NULL AND STRFTIME('%y', "diagnoses_icd"."charttime") >= '2105' ORDER BY "diagnoses_icd"."charttime" FETCH FIRST 1 ROWS ONLY | 0.52832 |
CREATE TABLE table_name_1 (venue VARCHAR2, score VARCHAR2)
| What venue had a Score of 120-108? | SELECT venue FROM table_name_1 WHERE score = "120-108" | SELECT "venue" FROM "table_name_1" WHERE "120-108" = "score" | 0.058594 |
CREATE TABLE table_2102714_1 (episode VARCHAR2, viewers__in_millions_ VARCHAR2)
| What episode had 9.7 million viewers? | SELECT episode FROM table_2102714_1 WHERE viewers__in_millions_ = "9.7" | SELECT "episode" FROM "table_2102714_1" WHERE "9.7" = "viewers__in_millions_" | 0.075195 |
CREATE TABLE table_71777 ("Res." CLOB, "Record" CLOB, "Opponent" CLOB, "Method" CLOB, "Event" CLOB, "Round" FLOAT, "Time" CLOB, "Location" CLOB)
| Which opponent had a time of 1:26? | SELECT "Opponent" FROM table_71777 WHERE "Time" = '1:26' | SELECT "Opponent" FROM "table_71777" WHERE "Time" = '1:26' | 0.056641 |
CREATE TABLE table_71457 ("Entrant" CLOB, "Constructor" CLOB, "Chassis" CLOB, "Engine \\u2020" CLOB, "Tyre" CLOB, "Driver" CLOB, "Rounds" CLOB)
| Which tyre is on the car driven by Pedro de la Rosa? | SELECT "Tyre" FROM table_71457 WHERE "Driver" = 'pedro de la rosa' | SELECT "Tyre" FROM "table_71457" WHERE "Driver" = 'pedro de la rosa' | 0.066406 |
CREATE TABLE table_41310 ("Album" CLOB, "Release date" CLOB, "Label" CLOB, "Format" CLOB, "Covered Song" CLOB, "Original Song" CLOB)
| What is the Label when the album shows cover version vi? | SELECT "Label" FROM table_41310 WHERE "Album" = 'cover version vi' | SELECT "Label" FROM "table_41310" WHERE "Album" = 'cover version vi' | 0.066406 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| give me the number of patients whose admission type is elective and procedure icd9 code is 3613? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "3613" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "3613" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "ELECTIVE" = "demographic"."admission_type" | 0.220703 |
CREATE TABLE Claims (Claim_ID NUMBER, Policy_ID NUMBER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed NUMBER, Amount_Settled NUMBER)
CREATE TABLE Customers (Customer_ID NUMBER, Customer_Details VARCHAR2)
CREATE TABLE Payments (Payment_ID NUMBER, Settlement_ID NUMBER, Payment_Method_Code VARCHAR2, Date_Payment_Made DATE, Amount_Payment NUMBER)
CREATE TABLE Customer_Policies (Policy_ID NUMBER, Customer_ID NUMBER, Policy_Type_Code CHAR, Start_Date DATE, End_Date DATE)
CREATE TABLE Settlements (Settlement_ID NUMBER, Claim_ID NUMBER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed NUMBER, Amount_Settled NUMBER, Customer_Policy_ID NUMBER)
| Return a trend line to show the average amount of payment by each payment day. | SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments GROUP BY Date_Payment_Made ORDER BY Date_Payment_Made | SELECT "Date_Payment_Made", AVG("Amount_Payment") FROM "Payments" GROUP BY "Date_Payment_Made" ORDER BY "Date_Payment_Made" | 0.120117 |
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2)
| Which of the classes do n't have lab sessions ? | SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' | SELECT DISTINCT "name", "number" FROM "course" WHERE "department" = 'EECS' AND "has_lab" = 'N' | 0.091797 |
CREATE TABLE basketball_match (Team_ID NUMBER, School_ID NUMBER, Team_Name CLOB, ACC_Regular_Season CLOB, ACC_Percent CLOB, ACC_Home CLOB, ACC_Road CLOB, All_Games CLOB, All_Games_Percent NUMBER, All_Home CLOB, All_Road CLOB, All_Neutral CLOB)
CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB)
| Give me the comparison about Team_ID over the All_Neutral , and display in asc by the bars. | SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral | SELECT "All_Neutral", "Team_ID" FROM "basketball_match" ORDER BY "All_Neutral" | 0.076172 |
CREATE TABLE table_name_38 (no_in_series NUMBER, director VARCHAR2, production_code VARCHAR2)
| What is the total series numbers that is directed by Jefferson Kibbee and has a production code of 2398191? | SELECT SUM(no_in_series) FROM table_name_38 WHERE director = "jefferson kibbee" AND production_code = "2398191" | SELECT SUM("no_in_series") FROM "table_name_38" WHERE "2398191" = "production_code" AND "director" = "jefferson kibbee" | 0.116211 |
CREATE TABLE table_28211103_1 (hawthorn_score VARCHAR2, year VARCHAR2)
| What is the hawthorn score at the year 2000? | SELECT hawthorn_score FROM table_28211103_1 WHERE year = 2000 | SELECT "hawthorn_score" FROM "table_28211103_1" WHERE "year" = 2000 | 0.06543 |
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
| Just show the employee's last name and their manager's id using a bar chart, show in ascending by the x-axis. | SELECT LAST_NAME, MANAGER_ID FROM employees ORDER BY LAST_NAME | SELECT "LAST_NAME", "MANAGER_ID" FROM "employees" ORDER BY "LAST_NAME" | 0.068359 |
CREATE TABLE table_18858 ("District" CLOB, "2012 Commission" CLOB, "2010 Commission" CLOB, "2007 Commission" CLOB, "2002 Commission" CLOB, "1999 Commission" CLOB)
| Who was on the 2012 commission and the 1999 commission with john wilborn? | SELECT "2012 Commission" FROM table_18858 WHERE "1999 Commission" = 'John Wilborn' | SELECT "2012 Commission" FROM "table_18858" WHERE "1999 Commission" = 'John Wilborn' | 0.082031 |
CREATE TABLE table_19072602_1 (score VARCHAR2, team_europe VARCHAR2)
| What was the score when Tore Torgersen played for Team Europe? | SELECT score FROM table_19072602_1 WHERE team_europe = "Tore Torgersen" | SELECT "score" FROM "table_19072602_1" WHERE "Tore Torgersen" = "team_europe" | 0.075195 |
CREATE TABLE table_name_82 (date VARCHAR2, label VARCHAR2, catalog VARCHAR2)
| What is the date of the item with a label of Sony BMG, Epic and a Catalog number 5187482? | SELECT date FROM table_name_82 WHERE label = "sony bmg, epic" AND catalog = "5187482" | SELECT "date" FROM "table_name_82" WHERE "5187482" = "catalog" AND "label" = "sony bmg, epic" | 0.09082 |
CREATE TABLE table_5788 ("Date" CLOB, "Tournament" CLOB, "Surface" CLOB, "Partnering" CLOB, "Opponents in the final" CLOB, "Score" CLOB)
| When has a Score of 6 3, 6 4? | SELECT "Date" FROM table_5788 WHERE "Score" = '6–3, 6–4' | SELECT "Date" FROM "table_5788" WHERE "Score" = '6–3, 6–4' | 0.056641 |
CREATE TABLE table_name_96 (week NUMBER, attendance VARCHAR2)
| What was the highest week with 84,856 in attendance? | SELECT MAX(week) FROM table_name_96 WHERE attendance = "84,856" | SELECT MAX("week") FROM "table_name_96" WHERE "84,856" = "attendance" | 0.067383 |
CREATE TABLE machine (machine_id NUMBER, making_year NUMBER, class CLOB, team CLOB, machine_series CLOB, value_points NUMBER, quality_rank NUMBER)
CREATE TABLE repair (repair_id NUMBER, name CLOB, launch_date CLOB, notes CLOB)
CREATE TABLE technician (technician_id NUMBER, name CLOB, team CLOB, starting_year NUMBER, age NUMBER)
CREATE TABLE repair_assignment (technician_id NUMBER, repair_id NUMBER, machine_id NUMBER)
| Show names of technicians in ascending order of quality rank of the machine they are assigned. | SELECT T3.name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_id = T3.technician_id ORDER BY T2.quality_rank | SELECT "T3"."name" FROM "repair_assignment" "T1" JOIN "machine" "T2" ON "T1"."machine_id" = "T2"."machine_id" JOIN "technician" "T3" ON "T1"."technician_id" = "T3"."technician_id" ORDER BY "T2"."quality_rank" | 0.203125 |
CREATE TABLE Scientists (SSN NUMBER, Name CHAR)
CREATE TABLE AssignedTo (Scientist NUMBER, Project CHAR)
CREATE TABLE Projects (Code CHAR, Name CHAR, Hours NUMBER)
| Visualize a bar chart for what are the naems of all the projects, and how many scientists were assigned to each of them?, and rank x axis from high to low order. | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY Name DESC | SELECT "Name", COUNT(*) FROM "Projects" "T1" JOIN "AssignedTo" "T2" ON "T1"."Code" = "T2"."Project" GROUP BY "T1"."Name" ORDER BY "Name" DESC | 0.137695 |
CREATE TABLE table_3215 ("Region" CLOB, "HDI" CLOB, "Life expectancy at birth ( 2001-2002 ) " CLOB, "Adult literacy rate ( 2009 ) " CLOB, "Combined gross enrollment ratio ( 2009 ) " CLOB, "GDP ( PPP ) per capita ( 2008 ) " FLOAT)
| How many regions had a life expectancy at birth in 2001-2002 of 75.9? | SELECT COUNT("HDI") FROM table_3215 WHERE "Life expectancy at birth (2001-2002)" = '75.9' | SELECT COUNT("HDI") FROM "table_3215" WHERE "Life expectancy at birth (2001-2002)" = '75.9' | 0.088867 |
CREATE TABLE table_51299 ("Pick #" FLOAT, "CFL Team" CLOB, "Player" CLOB, "Position" CLOB, "College" CLOB)
| What position did the Saskatchewan player get drafted as? | SELECT "Position" FROM table_51299 WHERE "College" = 'saskatchewan' | SELECT "Position" FROM "table_51299" WHERE "College" = 'saskatchewan' | 0.067383 |
CREATE TABLE Attribute_Definitions (attribute_id NUMBER, attribute_name VARCHAR2, attribute_data_type VARCHAR2)
CREATE TABLE Catalog_Contents_Additional_Attributes (catalog_entry_id NUMBER, catalog_level_number NUMBER, attribute_id NUMBER, attribute_value VARCHAR2)
CREATE TABLE Catalog_Structure (catalog_level_number NUMBER, catalog_id NUMBER, catalog_level_name VARCHAR2)
CREATE TABLE Catalogs (catalog_id NUMBER, catalog_name VARCHAR2, catalog_publisher VARCHAR2, date_of_publication DATETIME, date_of_latest_revision DATETIME)
CREATE TABLE Catalog_Contents (catalog_entry_id NUMBER, catalog_level_number NUMBER, parent_entry_id NUMBER, previous_entry_id NUMBER, next_entry_id NUMBER, catalog_entry_name VARCHAR2, product_stock_number VARCHAR2, price_in_dollars DOUBLE PRECISION, price_in_euros DOUBLE PRECISION, price_in_pounds DOUBLE PRECISION, capacity VARCHAR2, length VARCHAR2, height VARCHAR2, width VARCHAR2)
| A pie chart for finding the number of the names of catalog entries with level number 8. | SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name | SELECT "catalog_entry_name", COUNT("catalog_entry_name") FROM "Catalog_Contents" "t1" JOIN "Catalog_Contents_Additional_Attributes" "t2" ON "8" = "t2"."catalog_level_number" AND "t1"."catalog_entry_id" = "t2"."catalog_entry_id" GROUP BY "catalog_entry_name" | 0.250977 |
CREATE TABLE table_name_58 (rank NUMBER, heat NUMBER)
| Which Rank has a Heat larger than 7? | SELECT MAX(rank) FROM table_name_58 WHERE heat > 7 | SELECT MAX("rank") FROM "table_name_58" WHERE "heat" > 7 | 0.054688 |
CREATE TABLE View_Unit_Status (apt_id NUMBER, apt_booking_id NUMBER, status_date DATETIME, available_yn BIT)
CREATE TABLE Guests (guest_id NUMBER, gender_code CHAR, guest_first_name VARCHAR2, guest_last_name VARCHAR2, date_of_birth DATETIME)
CREATE TABLE Apartment_Bookings (apt_booking_id NUMBER, apt_id NUMBER, guest_id NUMBER, booking_status_code CHAR, booking_start_date DATETIME, booking_end_date DATETIME)
CREATE TABLE Apartment_Facilities (apt_id NUMBER, facility_code CHAR)
CREATE TABLE Apartments (apt_id NUMBER, building_id NUMBER, apt_type_code CHAR, apt_number CHAR, bathroom_count NUMBER, bedroom_count NUMBER, room_count CHAR)
CREATE TABLE Apartment_Buildings (building_id NUMBER, building_short_name CHAR, building_full_name VARCHAR2, building_description VARCHAR2, building_address VARCHAR2, building_manager VARCHAR2, building_phone VARCHAR2)
| Show the number of apartment bookings in each weekday and bin booking end date by weekday with a bar chart, sort from low to high by the total number. | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings ORDER BY COUNT(booking_end_date) | SELECT "booking_end_date", COUNT("booking_end_date") FROM "Apartment_Bookings" ORDER BY COUNT("booking_end_date") | 0.110352 |
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
| what were the three most commonly ordered specimen tests for patients who were diagnosed with poison-antipsychotic nec before within 2 months last year? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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 = 'poison-antipsychotic nec') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id WHERE DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t2.charttime) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month') GROUP BY t2.spec_type_desc) AS t3 WHERE t3.c1 <= 3 | WITH "t2" AS (SELECT "admissions"."subject_id", "microbiologyevents"."spec_type_desc", "microbiologyevents"."charttime" FROM "microbiologyevents" JOIN "admissions" ON "admissions"."hadm_id" = "microbiologyevents"."hadm_id" WHERE DATETIME("microbiologyevents"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')), "t3" AS (SELECT "t2"."spec_type_desc", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) 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" = 'poison-antipsychotic nec' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" JOIN "t2" "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND "diagnoses_icd"."charttime" < "t2"."charttime" AND DATETIME("diagnoses_icd"."charttime") <= DATETIME("t2"."charttime") AND DATETIME("diagnoses_icd"."charttime", '+2 month') >= DATETIME("t2"."charttime") WHERE DATETIME("diagnoses_icd"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY "t2"."spec_type_desc") SELECT "t3"."spec_type_desc" FROM "t3" "t3" WHERE "t3"."c1" <= 3 | 1.135742 |
CREATE TABLE table_54368 ("Season" CLOB, "Winner" CLOB, "Team" CLOB, "Position" CLOB, "Win #" FLOAT)
| Which season was harrisburg lunatics in? | SELECT "Season" FROM table_54368 WHERE "Team" = 'harrisburg lunatics' | SELECT "Season" FROM "table_54368" WHERE "Team" = 'harrisburg lunatics' | 0.069336 |
CREATE TABLE table_12454156_1 (prize_money VARCHAR2, runner_up VARCHAR2)
| What was the total prize money where John Tabatabai was the runner-up? | SELECT prize_money FROM table_12454156_1 WHERE runner_up = "John Tabatabai" | SELECT "prize_money" FROM "table_12454156_1" WHERE "John Tabatabai" = "runner_up" | 0.079102 |
CREATE TABLE table_71570 ("Rank" FLOAT, "Name" CLOB, "Nationality" CLOB, "Score" CLOB, "Perfection" CLOB)
| Who had a perfection percentage of 73.24%? | SELECT "Name" FROM table_71570 WHERE "Perfection" = '73.24%' | SELECT "Name" FROM "table_71570" WHERE "Perfection" = '73.24%' | 0.060547 |
CREATE TABLE volume (Volume_ID NUMBER, Volume_Issue CLOB, Issue_Date CLOB, Weeks_on_Top FLOAT, Song CLOB, Artist_ID NUMBER)
CREATE TABLE artist (Artist_ID NUMBER, Artist CLOB, Age NUMBER, Famous_Title CLOB, Famous_Release_date CLOB)
CREATE TABLE music_festival (ID NUMBER, Music_Festival CLOB, Date_of_ceremony CLOB, Category CLOB, Volume NUMBER, Result CLOB)
| A pie chart for returning the number of the categories of music festivals that have the result 'Awarded'. | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category | SELECT "Category", COUNT("Category") FROM "music_festival" WHERE "Awarded" = "Result" GROUP BY "Category" | 0.102539 |
CREATE TABLE table_25810656_3 (title VARCHAR2, no_in_series VARCHAR2)
| Name the number of title for number in series being 25 | SELECT COUNT(title) FROM table_25810656_3 WHERE no_in_series = 25 | SELECT COUNT("title") FROM "table_25810656_3" WHERE "no_in_series" = 25 | 0.069336 |
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
| list all the flights that takeoff from MKE | SELECT DISTINCT flight.flight_id FROM airport, flight WHERE airport.airport_code = 'MKE' AND flight.from_airport = airport.airport_code | SELECT DISTINCT "flight"."flight_id" FROM "airport" JOIN "flight" ON "airport"."airport_code" = "flight"."from_airport" WHERE "airport"."airport_code" = 'MKE' | 0.154297 |
CREATE TABLE table_name_34 (county VARCHAR2, bush_number VARCHAR2)
| Which county had a Bush number of votes of 566? | SELECT county FROM table_name_34 WHERE bush_number = 566 | SELECT "county" FROM "table_name_34" WHERE "bush_number" = 566 | 0.060547 |
CREATE TABLE table_name_22 (remixed_by VARCHAR2, year VARCHAR2, version VARCHAR2)
| Who remixed a music video in 1985? | SELECT remixed_by FROM table_name_22 WHERE year = 1985 AND version = "music video" | SELECT "remixed_by" FROM "table_name_22" WHERE "music video" = "version" AND "year" = 1985 | 0.087891 |
CREATE TABLE table_42223 ("Former kingdom" CLOB, "Province" CLOB, "Hangul" CLOB, "Hanja" CLOB, "Capital" CLOB, "Modern equivalent" CLOB)
| What is the capital of the province with in Hanja? | SELECT "Capital" FROM table_42223 WHERE "Hanja" = '漢州' | SELECT "Capital" FROM "table_42223" WHERE "Hanja" = '漢州' | 0.054688 |
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
| For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of job_id and department_id , and list in ascending by the DEPARTMENT_ID please. | SELECT JOB_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID | SELECT "JOB_ID", "DEPARTMENT_ID" FROM "employees" WHERE NOT "DEPARTMENT_ID" IN (SELECT "DEPARTMENT_ID" FROM "departments" WHERE "MANAGER_ID" <= 200 AND "MANAGER_ID" >= 100) ORDER BY "DEPARTMENT_ID" | 0.192383 |
CREATE TABLE table_146 ("Team" CLOB, "Stadium" CLOB, "Capacity" FLOAT, "Highest" FLOAT, "Lowest" FLOAT, "Average" FLOAT)
| What was the highest amount of people that attended the elgin city team? | SELECT COUNT("Highest") FROM table_146 WHERE "Team" = 'Elgin City' | SELECT COUNT("Highest") FROM "table_146" WHERE "Team" = 'Elgin City' | 0.066406 |
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
| Leet' Users (reputation of precisely 1337). Return the DisplayName of currently 'Leet' users. | SELECT DisplayName FROM Users WHERE Reputation = 1337 | SELECT "DisplayName" FROM "Users" WHERE "Reputation" = 1337 | 0.057617 |
CREATE TABLE table_29584601_1 (written_by VARCHAR2, no_in_series VARCHAR2)
| How many different pairs of writers wrote the episode with series number 56? | SELECT COUNT(written_by) FROM table_29584601_1 WHERE no_in_series = 56 | SELECT COUNT("written_by") FROM "table_29584601_1" WHERE "no_in_series" = 56 | 0.074219 |
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
| Python posts with minimum score of 15. | SELECT Title, Body, CreationDate, Id AS "post_link", Tags, Score FROM Posts WHERE PostTypeId IN (1) AND CreationDate > '2020-01-01' AND CreationDate < '2020-12-31' AND Tags LIKE ('%python%') AND Score >= 15 ORDER BY CreationDate DESC | SELECT "Title", "Body", "CreationDate", "Id" AS "post_link", "Tags", "Score" FROM "Posts" WHERE "CreationDate" < '2020-12-31' AND "CreationDate" > '2020-01-01' AND "PostTypeId" IN (1) AND "Score" >= 15 AND "Tags" LIKE '%python%' ORDER BY "CreationDate" DESC | 0.250977 |
CREATE TABLE table_name_74 (name VARCHAR2, nickname VARCHAR2)
| What is the Name listed for the Nickname of Storm? | SELECT name FROM table_name_74 WHERE nickname = "storm" | SELECT "name" FROM "table_name_74" WHERE "nickname" = "storm" | 0.05957 |
CREATE TABLE table_17917 ("Team" CLOB, "Location" CLOB, "Stadium" CLOB, "Founded" FLOAT, "Joined" FLOAT, "Head Coach" CLOB, "Captain" CLOB)
| Where is Westpac Stadium located? | SELECT "Location" FROM table_17917 WHERE "Stadium" = 'Westpac Stadium' | SELECT "Location" FROM "table_17917" WHERE "Stadium" = 'Westpac Stadium' | 0.070313 |
CREATE TABLE table_54845 ("Team" CLOB, "Nation" CLOB, "From" CLOB, "Matches" FLOAT, "Drawn" FLOAT, "Lost" FLOAT, "Win %" FLOAT)
| Name the sum of drawn for 30 october 2006 and win % more than 43.2 | SELECT SUM("Drawn") FROM table_54845 WHERE "From" = '30 october 2006' AND "Win %" > '43.2' | SELECT SUM("Drawn") FROM "table_54845" WHERE "From" = '30 october 2006' AND "Win %" > '43.2' | 0.089844 |
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
| For those employees who was hired before 2002-06-21, give me the comparison about the average of manager_id over the hire_date bin hire_date by time, list in asc by the Y-axis. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID) | SELECT "HIRE_DATE", AVG("MANAGER_ID") FROM "employees" WHERE "HIRE_DATE" < '2002-06-21' ORDER BY AVG("MANAGER_ID") | 0.111328 |
CREATE TABLE table_1341604_10 (candidates VARCHAR2, result VARCHAR2)
| how many candidates with result being new seat democratic gain | SELECT COUNT(candidates) FROM table_1341604_10 WHERE result = "New seat Democratic gain" | SELECT COUNT("candidates") FROM "table_1341604_10" WHERE "New seat Democratic gain" = "result" | 0.091797 |
CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
| 498 has a lab , right ? | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 498 | SELECT COUNT(*) > 0 FROM "course" WHERE "department" = 'EECS' AND "has_lab" = 'Y' AND "number" = 498 | 0.097656 |
CREATE TABLE table_53428 ("Name" CLOB, "League" FLOAT, "FA Cup" FLOAT, "League Cup" FLOAT, "Total" FLOAT)
| What is the sum of goals scored in regular league play by Mustoe where he scored 0 goals in the League Cup? | SELECT SUM("League") FROM table_53428 WHERE "Name" = 'mustoe' AND "League Cup" < '0' | SELECT SUM("League") FROM "table_53428" WHERE "League Cup" < '0' AND "Name" = 'mustoe' | 0.083984 |
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| provide the number of patients whose year of birth is less than 2121 and lab test fluid is pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2121" AND lab.fluid = "Pleural" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Pleural" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "2121" > "demographic"."dob_year" | 0.189453 |
CREATE TABLE table_56095 ("Round" CLOB, "Pick" CLOB, "Player" CLOB, "Position" CLOB, "Nationality" CLOB, "Team" CLOB, "College" CLOB)
| Which player went to the College of Wyoming? | SELECT "Player" FROM table_56095 WHERE "College" = 'wyoming' | SELECT "Player" FROM "table_56095" WHERE "College" = 'wyoming' | 0.060547 |
CREATE TABLE table_38970 ("Year" CLOB, "Men's singles" CLOB, "Women's singles" CLOB, "Men's doubles" CLOB, "Women's doubles" CLOB, "Mixed doubles" CLOB)
| Name the men's doubles for anneke feinya agustin nitya krishinda maheswari | SELECT "Men's doubles" FROM table_38970 WHERE "Women's doubles" = 'anneke feinya agustin nitya krishinda maheswari' | SELECT "Men's doubles" FROM "table_38970" WHERE "Women's doubles" = 'anneke feinya agustin nitya krishinda maheswari' | 0.114258 |
CREATE TABLE table_203_699 (id NUMBER, "name" CLOB, "parentage" CLOB, "size" CLOB, "flower colour" CLOB, "flower type" CLOB)
| how many flowers have the same type as the freedom bell ? | SELECT COUNT("name") FROM table_203_699 WHERE "name" <> 'freedom bell' AND "flower type" = (SELECT "flower type" FROM table_203_699 WHERE "name" = 'freedom bell') | SELECT COUNT("name") FROM "table_203_699" WHERE "flower type" = (SELECT "flower type" FROM "table_203_699" WHERE "name" = 'freedom bell') AND "name" <> 'freedom bell' | 0.162109 |
CREATE TABLE table_name_81 (home_team VARCHAR2, tie_no VARCHAR2, away_team VARCHAR2)
| Who was the home team that had a replay of Tie Number and played against the Bolton Wanderers? | SELECT home_team FROM table_name_81 WHERE tie_no = "replay" AND away_team = "bolton wanderers" | SELECT "home_team" FROM "table_name_81" WHERE "away_team" = "bolton wanderers" AND "replay" = "tie_no" | 0.099609 |
CREATE TABLE table_name_5 (date VARCHAR2, score VARCHAR2)
| What's the date the score was 379? | SELECT date FROM table_name_5 WHERE score = "379" | SELECT "date" FROM "table_name_5" WHERE "379" = "score" | 0.053711 |