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 vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime 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)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
| what was patient 031-23724's weight the last time in 08/last year? | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', patient.unitadmittime) = '08' ORDER BY patient.unitadmittime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '031-23724' GROUP BY "patienthealthsystemstayid") SELECT "patient"."admissionweight" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE DATETIME("patient"."unitadmittime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_0"."" IS NULL AND NOT "patient"."admissionweight" IS NULL AND STRFTIME('%m', "patient"."unitadmittime") = '08' ORDER BY "patient"."unitadmittime" DESC FETCH FIRST 1 ROWS ONLY | 0.569336 |
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 d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label 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 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 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 procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod 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 microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
| what is the daily minimum cerebral drain l ventricular drain output that patient 49036 has had until 10/02/2105? | SELECT MIN(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49036)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'cerebral drain l ventricular drain' AND d_items.linksto = 'outputevents') AND STRFTIME('%y-%m-%d', outputevents.charttime) <= '2105-10-02' GROUP BY STRFTIME('%y-%m-%d', outputevents.charttime) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 49036 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'cerebral drain l ventricular drain' AND "d_items"."linksto" = 'outputevents' GROUP BY "itemid") SELECT MIN("outputevents"."value") FROM "outputevents" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "outputevents"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "outputevents"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%y-%m-%d', "outputevents"."charttime") <= '2105-10-02' GROUP BY STRFTIME('%y-%m-%d', "outputevents"."charttime") | 0.81543 |
CREATE TABLE table_36697 ("Game" CLOB, "Date" CLOB, "Home Team" CLOB, "Result" CLOB, "Road Team" CLOB, "TV Time" CLOB)
| What was the TV time for the road game against Phoenix where the score was 98-99? | SELECT "TV Time" FROM table_36697 WHERE "Home Team" = 'phoenix' AND "Result" = '98-99' | SELECT "TV Time" FROM "table_36697" WHERE "Home Team" = 'phoenix' AND "Result" = '98-99' | 0.085938 |
CREATE TABLE table_204_605 (id NUMBER, "date" CLOB, "round" CLOB, "opponents" CLOB, "h / a" CLOB, "result\ f-a" CLOB, "scorers" CLOB, "attendance" NUMBER)
| what is the most amount of people to attend a single game this season ? | SELECT MAX("attendance") FROM table_204_605 | SELECT MAX("attendance") FROM "table_204_605" | 0.043945 |
CREATE TABLE table_40746 ("Television service" CLOB, "Country" CLOB, "Language" CLOB, "Content" CLOB, "HDTV" CLOB, "Package/Option" CLOB)
| Which television service has italian for its language? | SELECT "Television service" FROM table_40746 WHERE "Language" = 'italian' | SELECT "Television service" FROM "table_40746" WHERE "Language" = 'italian' | 0.073242 |
CREATE TABLE table_16441561_5 (position VARCHAR2, player VARCHAR2)
| How many players named Jeff Brown were drafted | SELECT COUNT(position) FROM table_16441561_5 WHERE player = "Jeff Brown" | SELECT COUNT("position") FROM "table_16441561_5" WHERE "Jeff Brown" = "player" | 0.076172 |
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 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 program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction 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 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 semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
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 comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
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 gsi (course_offering_id NUMBER, student_id NUMBER)
| Did Prof. Janet Kinney make an examination for 634 last time she taught it ? | SELECT DISTINCT course_offering.has_final_exam FROM course_offering INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offering.semester = (SELECT MAX(SEMESTERalias0.semester_id) FROM semester AS SEMESTERalias0 INNER JOIN course_offering AS COURSE_OFFERINGalias1 ON SEMESTERalias0.semester_id = COURSE_OFFERINGalias1.semester INNER JOIN course AS COURSEalias1 ON COURSEalias1.course_id = COURSE_OFFERINGalias1.course_id INNER JOIN offering_instructor AS OFFERING_INSTRUCTORalias1 ON OFFERING_INSTRUCTORalias1.offering_id = COURSE_OFFERINGalias1.offering_id INNER JOIN instructor AS INSTRUCTORalias1 ON OFFERING_INSTRUCTORalias1.instructor_id = INSTRUCTORalias1.instructor_id WHERE COURSEalias1.department = 'EECS' AND COURSEalias1.number = 634 AND INSTRUCTORalias1.name LIKE '%Janet Kinney%' AND SEMESTERalias0.year < 2016) AND course.department = 'EECS' AND course.number = 634 AND instructor.name LIKE '%Janet Kinney%' | WITH "_u_0" AS (SELECT MAX("SEMESTERalias0"."semester_id") FROM "semester" "SEMESTERalias0" JOIN "course_offering" "COURSE_OFFERINGalias1" ON "COURSE_OFFERINGalias1"."semester" = "SEMESTERalias0"."semester_id" JOIN "course" "COURSEalias1" ON "COURSE_OFFERINGalias1"."course_id" = "COURSEalias1"."course_id" AND "COURSEalias1"."department" = 'EECS' AND "COURSEalias1"."number" = 634 JOIN "offering_instructor" "OFFERING_INSTRUCTORalias1" ON "COURSE_OFFERINGalias1"."offering_id" = "OFFERING_INSTRUCTORalias1"."offering_id" JOIN "instructor" "INSTRUCTORalias1" ON "INSTRUCTORalias1"."instructor_id" = "OFFERING_INSTRUCTORalias1"."instructor_id" AND "INSTRUCTORalias1"."name" LIKE '%Janet Kinney%' WHERE "SEMESTERalias0"."year" < 2016) SELECT DISTINCT "course_offering"."has_final_exam" FROM "course_offering" JOIN "_u_0" "_u_0" ON "_u_0"."" = "course_offering"."semester" JOIN "course" ON "course"."course_id" = "course_offering"."course_id" AND "course"."department" = 'EECS' AND "course"."number" = 634 JOIN "offering_instructor" ON "course_offering"."offering_id" = "offering_instructor"."offering_id" JOIN "instructor" ON "instructor"."instructor_id" = "offering_instructor"."instructor_id" AND "instructor"."name" LIKE '%Janet Kinney%' | 1.208984 |
CREATE TABLE table_99 ("Pick #" FLOAT, "CFL Team" CLOB, "Player" CLOB, "Position" CLOB, "College" CLOB)
| How many people were pick #30? | SELECT COUNT("Position") FROM table_99 WHERE "Pick #" = '30' | SELECT COUNT("Position") FROM "table_99" WHERE "Pick #" = '30' | 0.060547 |
CREATE TABLE table_53079 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
| How many people were in the crowd when the away team was north melbourne? | SELECT SUM("Crowd") FROM table_53079 WHERE "Away team" = 'north melbourne' | SELECT SUM("Crowd") FROM "table_53079" WHERE "Away team" = 'north melbourne' | 0.074219 |
CREATE TABLE table_1990460_1 (division NUMBER, regular_season VARCHAR2)
| What's the lowest division number of the 6th, Great Lakes season? | SELECT MIN(division) FROM table_1990460_1 WHERE regular_season = "6th, Great Lakes" | SELECT MIN("division") FROM "table_1990460_1" WHERE "6th, Great Lakes" = "regular_season" | 0.086914 |
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 class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
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 ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
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 time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
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 equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id 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 compartment_class (compartment VARCHAR2, class_type 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 airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
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 dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name 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)
| i need a flight from MONTREAL QUEBEC to SAN DIEGO CALIFORNIA leaving this sunday | 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, date_day, days, flight, state AS STATE_0, state AS STATE_1 WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND STATE_1.state_code = CITY_1.state_code AND STATE_1.state_name = 'CALIFORNIA') AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MONTREAL' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND STATE_0.state_code = CITY_0.state_code AND STATE_0.state_name = 'QUEBEC' | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "date_day" ON "date_day"."day_number" = 27 AND "date_day"."month_number" = 8 AND "date_day"."year" = 1991 JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'MONTREAL' JOIN "days" ON "date_day"."day_name" = "days"."day_name" JOIN "state" "STATE_0" ON "CITY_0"."state_code" = "STATE_0"."state_code" AND "STATE_0"."state_name" = 'QUEBEC' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "days"."days_code" = "flight"."flight_days" JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'SAN DIEGO' JOIN "state" "STATE_1" ON "CITY_1"."state_code" = "STATE_1"."state_code" AND "STATE_1"."state_name" = 'CALIFORNIA' | 0.916992 |
CREATE TABLE table_name_5 (score_composer VARCHAR2, year VARCHAR2)
| Who was the score composer of the film released in 1967? | SELECT score_composer FROM table_name_5 WHERE year = 1967 | SELECT "score_composer" FROM "table_name_5" WHERE "year" = 1967 | 0.061523 |
CREATE TABLE course_authors_and_tutors (author_id NUMBER, author_tutor_atb CLOB, login_name CLOB, password CLOB, personal_name CLOB, middle_name CLOB, family_name CLOB, gender_mf CLOB, address_line_1 CLOB)
CREATE TABLE subjects (subject_id NUMBER, subject_name CLOB)
CREATE TABLE students (student_id NUMBER, date_of_registration TIME, date_of_latest_logon TIME, login_name CLOB, password CLOB, personal_name CLOB, middle_name CLOB, family_name CLOB)
CREATE TABLE student_course_enrolment (registration_id NUMBER, student_id NUMBER, course_id NUMBER, date_of_enrolment TIME, date_of_completion TIME)
CREATE TABLE courses (course_id NUMBER, author_id NUMBER, subject_id NUMBER, course_name CLOB, course_description CLOB)
CREATE TABLE student_tests_taken (registration_id NUMBER, date_test_taken TIME, test_result CLOB)
| How many students have personal names that contain the word 'son'? | SELECT COUNT(*) FROM students WHERE personal_name LIKE "%son%" | SELECT COUNT(*) FROM "students" WHERE "personal_name" LIKE "%son%" | 0.064453 |
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 (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 program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text 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 program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id 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)
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 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 area (course_id NUMBER, area VARCHAR2)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
| Are undergraduates able to take 504 ? | SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 504 | SELECT DISTINCT "advisory_requirement", "enforced_requirement", "name" FROM "course" WHERE "department" = 'EECS' AND "number" = 504 | 0.12793 |
CREATE TABLE table_23031 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "U.S. viewers ( millions ) " CLOB)
| Name the original air date for 15.74 viewers | SELECT "Original air date" FROM table_23031 WHERE "U.S. viewers (millions)" = '15.74' | SELECT "Original air date" FROM "table_23031" WHERE "U.S. viewers (millions)" = '15.74' | 0.084961 |
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime 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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount 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 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 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 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 d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name 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 labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
| count the number of prescribed drugs patient 92397 has. | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92397) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 92397 GROUP BY "hadm_id") SELECT COUNT(*) FROM "prescriptions" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE NOT "_u_0"."" IS NULL | 0.24707 |
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 allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
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 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 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 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)
| what is the monthly minimum amount of foley cath that patient 006-224208 had until 08/17/2103? | SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-224208')) AND intakeoutput.celllabel = 'foley cath' AND intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) <= '2103-08-17' GROUP BY STRFTIME('%y-%m', intakeoutput.intakeoutputtime) | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '006-224208' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT MIN("intakeoutput"."cellvaluenumeric") FROM "intakeoutput" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = 'foley cath' AND "intakeoutput"."cellpath" LIKE '%output%' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m-%d', "intakeoutput"."intakeoutputtime") <= '2103-08-17' GROUP BY STRFTIME('%y-%m', "intakeoutput"."intakeoutputtime") | 0.735352 |
CREATE TABLE table_name_68 (name VARCHAR2, qual_2 VARCHAR2, team VARCHAR2)
| Who had a Qualifying 2 time over 58.669 for Team Australia? | SELECT name FROM table_name_68 WHERE qual_2 > 58.669 AND team = "team australia" | SELECT "name" FROM "table_name_68" WHERE "qual_2" > 58.669 AND "team australia" = "team" | 0.085938 |
CREATE TABLE table_name_19 (attendance NUMBER, week VARCHAR2)
| How many people were in attendance at week 16? | SELECT AVG(attendance) FROM table_name_19 WHERE week = 16 | SELECT AVG("attendance") FROM "table_name_19" WHERE "week" = 16 | 0.061523 |
CREATE TABLE Accounts (account_id NUMBER, customer_id NUMBER, date_account_opened DATETIME, account_name VARCHAR2, other_account_details VARCHAR2)
CREATE TABLE Order_Items (order_item_id NUMBER, order_id NUMBER, product_id NUMBER, product_quantity VARCHAR2, other_order_item_details VARCHAR2)
CREATE TABLE Financial_Transactions (transaction_id NUMBER, account_id NUMBER, invoice_number NUMBER, transaction_type VARCHAR2, transaction_date DATETIME, transaction_amount NUMBER, transaction_comment VARCHAR2, other_transaction_details VARCHAR2)
CREATE TABLE Orders (order_id NUMBER, customer_id NUMBER, date_order_placed DATETIME, order_details VARCHAR2)
CREATE TABLE Product_Categories (production_type_code VARCHAR2, product_type_description VARCHAR2, vat_rating NUMBER)
CREATE TABLE Invoices (invoice_number NUMBER, order_id NUMBER, invoice_date DATETIME)
CREATE TABLE Products (product_id NUMBER, parent_product_id NUMBER, production_type_code VARCHAR2, unit_price NUMBER, product_name VARCHAR2, product_color VARCHAR2, product_size VARCHAR2)
CREATE TABLE Invoice_Line_Items (order_item_id NUMBER, invoice_number NUMBER, product_id NUMBER, product_title VARCHAR2, product_quantity VARCHAR2, product_price NUMBER, derived_product_cost NUMBER, derived_vat_payable NUMBER, derived_total_cost NUMBER)
CREATE TABLE Customers (customer_id NUMBER, customer_first_name VARCHAR2, customer_middle_initial VARCHAR2, customer_last_name VARCHAR2, gender VARCHAR2, email_address VARCHAR2, login_name VARCHAR2, login_password VARCHAR2, phone_number VARCHAR2, town_city VARCHAR2, state_county_province VARCHAR2, country VARCHAR2)
| Give me a pie to show how many other account details from different other account details. | SELECT other_account_details, COUNT(other_account_details) FROM Accounts GROUP BY other_account_details | SELECT "other_account_details", COUNT("other_account_details") FROM "Accounts" GROUP BY "other_account_details" | 0.108398 |
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)
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 diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| what is the number of patients whose admission type is emergency and drug route is ivpca? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "IVPCA" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "IVPCA" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "EMERGENCY" = "demographic"."admission_type" | 0.227539 |
CREATE TABLE table_68045 ("Date" CLOB, "Visitor" CLOB, "Score" CLOB, "Home" CLOB, "Record" CLOB)
| What was the record after the January 18 game? | SELECT "Record" FROM table_68045 WHERE "Date" = 'january 18' | SELECT "Record" FROM "table_68045" WHERE "Date" = 'january 18' | 0.060547 |
CREATE TABLE table_76710 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Result" CLOB, "Attendance" CLOB, "Record" CLOB)
| What was the date of the game with an attendance of 20,874 fans? | SELECT "Date" FROM table_76710 WHERE "Attendance" = '20,874' | SELECT "Date" FROM "table_76710" WHERE "Attendance" = '20,874' | 0.060547 |
CREATE TABLE Apartment_Bookings (booking_status_code VARCHAR2)
| Show the booking status code and the corresponding number of bookings. | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code | SELECT "booking_status_code", COUNT(*) FROM "Apartment_Bookings" GROUP BY "booking_status_code" | 0.092773 |
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 city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
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 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 time_interval (period CLOB, begin_time NUMBER, end_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 date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE days (days_code VARCHAR2, day_name 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 state (state_code CLOB, state_name CLOB, country_name CLOB)
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 dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id 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 compartment_class (compartment VARCHAR2, class_type VARCHAR2)
| what flights are available from DALLAS to ATLANTA with one way economy fares | 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, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND fare_basis.economy = 'YES' AND fare.fare_basis_code = fare_basis.fare_basis_code AND fare.round_trip_required = 'NO' AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code | 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" = 'DALLAS' 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 "flight_fare" ON "flight"."flight_id" = "flight_fare"."flight_id" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'ATLANTA' JOIN "fare" ON "fare"."fare_id" = "flight_fare"."fare_id" AND "fare"."round_trip_required" = 'NO' JOIN "fare_basis" ON "fare"."fare_basis_code" = "fare_basis"."fare_basis_code" AND "fare_basis"."economy" = 'YES' | 0.757813 |
CREATE TABLE department (dept_code CLOB, dept_name CLOB, school_code CLOB, emp_num NUMBER, dept_address CLOB, dept_extension CLOB)
CREATE TABLE course (crs_code CLOB, dept_code CLOB, crs_description CLOB, crs_credit NUMBER)
CREATE TABLE class (class_code CLOB, crs_code CLOB, class_section CLOB, class_time CLOB, class_room CLOB, prof_num NUMBER)
CREATE TABLE student (stu_num NUMBER, stu_lname CLOB, stu_fname CLOB, stu_init CLOB, stu_dob TIME, stu_hrs NUMBER, stu_class CLOB, stu_gpa NUMBER, stu_transfer NUMBER, dept_code CLOB, stu_phone CLOB, prof_num NUMBER)
CREATE TABLE enroll (class_code CLOB, stu_num NUMBER, enroll_grade CLOB)
CREATE TABLE professor (emp_num NUMBER, dept_code CLOB, prof_office CLOB, prof_extension CLOB, prof_high_degree CLOB)
CREATE TABLE employee (emp_num NUMBER, emp_lname CLOB, emp_fname CLOB, emp_initial CLOB, emp_jobcode CLOB, emp_hiredate TIME, emp_dob TIME)
| How many professors teach a class with the code ACCT-211? | SELECT COUNT(DISTINCT prof_num) FROM class WHERE crs_code = "ACCT-211" | SELECT COUNT(DISTINCT "prof_num") FROM "class" WHERE "ACCT-211" = "crs_code" | 0.074219 |
CREATE TABLE Transactions_Lots (transaction_id NUMBER, lot_id NUMBER)
CREATE TABLE Transactions (transaction_id NUMBER, investor_id NUMBER, transaction_type_code VARCHAR2, date_of_transaction DATETIME, amount_of_transaction NUMBER, share_count VARCHAR2, other_details VARCHAR2)
CREATE TABLE Lots (lot_id NUMBER, investor_id NUMBER, lot_details VARCHAR2)
CREATE TABLE Sales (sales_transaction_id NUMBER, sales_details VARCHAR2)
CREATE TABLE Investors (investor_id NUMBER, Investor_details VARCHAR2)
CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR2, transaction_type_description VARCHAR2)
CREATE TABLE Purchases (purchase_transaction_id NUMBER, purchase_details VARCHAR2)
| What are the purchase details of transactions with amount bigger than 10000, and count them by a bar chart, list by the the number of purchase details from low to high. | SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY COUNT(purchase_details) | SELECT "purchase_details", COUNT("purchase_details") FROM "Purchases" "T1" JOIN "Transactions" "T2" ON "T1"."purchase_transaction_id" = "T2"."transaction_id" AND "T2"."amount_of_transaction" > 10000 GROUP BY "purchase_details" ORDER BY COUNT("purchase_details") | 0.254883 |
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME 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 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 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)
| For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the sum of department_id bin hire_date by time, and visualize them by a bar chart, and display by the Y-axis in desc please. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(DEPARTMENT_ID) DESC | SELECT "HIRE_DATE", SUM("DEPARTMENT_ID") FROM "employees" WHERE NOT "DEPARTMENT_ID" IN (SELECT "DEPARTMENT_ID" FROM "departments" WHERE "MANAGER_ID" <= 200 AND "MANAGER_ID" >= 100) ORDER BY SUM("DEPARTMENT_ID") DESC | 0.209961 |
CREATE TABLE table_27620 ("Letters" CLOB, "Organization" CLOB, "Nickname" CLOB, "Founding Date" CLOB, "Founding University" CLOB, "Type" CLOB)
| How many letters were given to the organization with a founding date of 1997-12-12? | SELECT COUNT("Letters") FROM table_27620 WHERE "Founding Date" = '1997-12-12' | SELECT COUNT("Letters") FROM "table_27620" WHERE "Founding Date" = '1997-12-12' | 0.077148 |
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 microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
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)
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 diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
| what is patient 011-49649's average value for urinary osmolality in 02/last year? | SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-49649')) AND lab.labname = 'urinary osmolality' AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', lab.labresulttime) = '02' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '011-49649' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT AVG("lab"."labresult") FROM "lab" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'urinary osmolality' AND DATETIME("lab"."labresulttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_1"."" IS NULL AND STRFTIME('%m', "lab"."labresulttime") = '02' | 0.671875 |
CREATE TABLE fires (fire_year NUMBER, discovery_date NUMBER, discovery_doy NUMBER, discovery_time CLOB, stat_cause_code NUMBER, stat_cause_descr CLOB, cont_date CLOB, cont_doy CLOB, cont_time CLOB, fire_size NUMBER, fire_size_class CLOB, latitude NUMBER, longitude NUMBER, owner_code NUMBER, owner_descr CLOB, state CLOB, county CLOB, fips_code CLOB, fips_name CLOB)
| How many acres burned in 2000s and 1990s? | SELECT SUM(fire_size) FROM fires WHERE state = "TX" AND fire_year BETWEEN 2000 AND 2010 UNION SELECT SUM(fire_size) FROM fires WHERE state = "TX" AND fire_year BETWEEN 1990 AND 2000 | SELECT SUM("fire_size") FROM "fires" WHERE "TX" = "state" AND "fire_year" <= 2010 AND "fire_year" >= 2000 UNION SELECT SUM("fire_size") FROM "fires" WHERE "TX" = "state" AND "fire_year" <= 2000 AND "fire_year" >= 1990 | 0.211914 |
CREATE TABLE table_name_65 (opponent VARCHAR2, week VARCHAR2)
| Who is the opponent in week 15? | SELECT opponent FROM table_name_65 WHERE week = 15 | SELECT "opponent" FROM "table_name_65" WHERE "week" = 15 | 0.054688 |
CREATE TABLE table_76366 ("Poll source" CLOB, "Dates administered" CLOB, "Arlen Specter*" CLOB, "Pat Toomey" CLOB, "Tom Ridge*" CLOB, "Peg Luksik" CLOB)
| Which Tom Ridge* has a Pat Toomey of 60%, and a Poll source of suffolk? | SELECT "Tom Ridge*" FROM table_76366 WHERE "Pat Toomey" = '60%' AND "Poll source" = 'suffolk' | SELECT "Tom Ridge*" FROM "table_76366" WHERE "Pat Toomey" = '60%' AND "Poll source" = 'suffolk' | 0.092773 |
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
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 program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
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 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 semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname 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 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 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)
| Which 300 -level courses are easy ? | SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND program_course.course_id = course.course_id AND program_course.workload < 3 ORDER BY program_course.workload | SELECT DISTINCT "course"."name", "course"."number", "program_course"."workload" FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."workload" < 3 WHERE "course"."department" = 'EECS' AND "course"."number" <= 400 AND "course"."number" >= 300 ORDER BY "program_course"."workload" | 0.330078 |
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 cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto 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 chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom 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 labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label 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 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 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 diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
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)
| what was the drug that patient 5905 had been prescribed two times until 10/2101. | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5905) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2101-10' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 = 2 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 5905 GROUP BY "hadm_id"), "t1" AS (SELECT "prescriptions"."drug", COUNT("prescriptions"."startdate") AS "c1" FROM "prescriptions" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND STRFTIME('%y-%m', "prescriptions"."startdate") <= '2101-10' GROUP BY "prescriptions"."drug") SELECT "t1"."drug" FROM "t1" "t1" WHERE "t1"."c1" = 2 | 0.459961 |
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 the number of patients whose diagnosis short title is intracerebral hemorrhage and whose lab test abnormal status is delta. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Intracerebral hemorrhage" AND lab.flag = "delta" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Intracerebral hemorrhage" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "lab" ON "delta" = "lab"."flag" AND "demographic"."hadm_id" = "lab"."hadm_id" | 0.271484 |
CREATE TABLE table_50749 ("2010 ARWU Rankings" CLOB, "2010 QS World Rankings" CLOB, "2010 QS Asian Rankings" CLOB, "2010 eduniversal Rankings" CLOB, "2009 QS Asian Rankings: Intpars_m_singlel faculty review" CLOB, "2009 QS Asian Rankings: Intpars_m_singlel student review" FLOAT, "2000 Singapore \\u201cAsiaweek\\u201d Rankings" CLOB, "University" CLOB, "Local" CLOB, "Median ranks" FLOAT)
| What's the ARWU ranking that has the int' student review of 144, a median rank of less than 10, and 2000 Singapore Asiaweek of none? | SELECT "2010 ARWU Rankings" FROM table_50749 WHERE "2000 Singapore \u201cAsiaweek\u201d Rankings" = 'none' AND "Median ranks" < '10' AND "2009 QS Asian Rankings: Int\u2019l student review" = '144' | SELECT "2010 ARWU Rankings" FROM "table_50749" WHERE "2000 Singapore \u201cAsiaweek\u201d Rankings" = 'none' AND "2009 QS Asian Rankings: Int\u2019l student review" = '144' AND "Median ranks" < '10' | 0.193359 |
CREATE TABLE table_70330 ("Tournament" CLOB, "2008" CLOB, "2010" CLOB, "2011" CLOB, "2012" CLOB, "2013" CLOB)
| Name the 2012 for 2011 being 1r | SELECT "2012" FROM table_70330 WHERE "2011" = '1r' | SELECT "2012" FROM "table_70330" WHERE "2011" = '1r' | 0.050781 |
CREATE TABLE table_45988 ("Gatchaman" CLOB, "Battle of the Planets" CLOB, "G-Force" CLOB, "Eagle Riders" CLOB, "OVA ( Harmony Gold Dub ) " CLOB, "Rank" CLOB, "Bird Uniform" CLOB, "Weapon" CLOB, "Mecha" CLOB, "Japanese voice actor" CLOB, "Voice actor ( BOTP ) " CLOB, "Voice actor ( G-Force ) " CLOB, "Voice actor ( Harmony Gold OVA Dub ) " CLOB, "Voice actor ( Eagle Riders ) " CLOB, "Voice actor ( ADV TV/Sentai OVA dub ) " CLOB)
| Who was the voice actor (ADV TV/Sentai OVA dub) for the Gatchaman, jun? | SELECT "Voice actor (ADV TV/Sentai OVA dub)" FROM table_45988 WHERE "Gatchaman" = 'jun' | SELECT "Voice actor (ADV TV/Sentai OVA dub)" FROM "table_45988" WHERE "Gatchaman" = 'jun' | 0.086914 |
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime 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 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 intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime 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 microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
| how did patient 021-155303 last visit the hospital? | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '021-155303' ORDER BY patient.hospitaladmittime DESC LIMIT 1 | SELECT "patient"."hospitaladmitsource" FROM "patient" WHERE "patient"."uniquepid" = '021-155303' ORDER BY "patient"."hospitaladmittime" DESC FETCH FIRST 1 ROWS ONLY | 0.160156 |
CREATE TABLE table_48106 ("Rank" FLOAT, "Title" CLOB, "Studio" CLOB, "Director" CLOB, "Worldwide Gross" CLOB)
| What was the worldwide gross for the film directed by joe pytka? | SELECT "Worldwide Gross" FROM table_48106 WHERE "Director" = 'joe pytka' | SELECT "Worldwide Gross" FROM "table_48106" WHERE "Director" = 'joe pytka' | 0.072266 |
CREATE TABLE table_1473672_3 (college_junior_club_team VARCHAR2, player VARCHAR2)
| Which colle/junior/club team did Michel Boudreau play for? | SELECT college_junior_club_team FROM table_1473672_3 WHERE player = "Michel Boudreau" | SELECT "college_junior_club_team" FROM "table_1473672_3" WHERE "Michel Boudreau" = "player" | 0.088867 |
CREATE TABLE table_name_98 (catalog VARCHAR2, region VARCHAR2)
| What is the catalog with the region of the United States? | SELECT catalog FROM table_name_98 WHERE region = "united states" | SELECT "catalog" FROM "table_name_98" WHERE "region" = "united states" | 0.068359 |
CREATE TABLE table_19286 ("Series" CLOB, "Main presenter" CLOB, "Co-presenter" CLOB, "Comedian" CLOB, "UK co-presenter" CLOB)
| Who is the UK co-presenters that have Joe Swash as a co-presenter of the series Eleven (2011)? | SELECT "UK co-presenter" FROM table_19286 WHERE "Co-presenter" = 'Joe Swash' AND "Series" = 'Eleven (2011)' | SELECT "UK co-presenter" FROM "table_19286" WHERE "Co-presenter" = 'Joe Swash' AND "Series" = 'Eleven (2011)' | 0.106445 |
CREATE TABLE table_name_57 (total NUMBER, gold VARCHAR2, rank VARCHAR2, nation VARCHAR2)
| What is the highest Total with a Rank that is smaller than 4 and a Nation of tunisia (tun) with a Gold that is smaller than 2? | SELECT MAX(total) FROM table_name_57 WHERE rank < 4 AND nation = "tunisia (tun)" AND gold < 2 | SELECT MAX("total") FROM "table_name_57" WHERE "gold" < 2 AND "nation" = "tunisia (tun)" AND "rank" < 4 | 0.100586 |
CREATE TABLE table_59168 ("Place" CLOB, "Player" CLOB, "Country" CLOB, "Score" CLOB, "To par" CLOB)
| What is the score of Player Tom Kite? | SELECT "Score" FROM table_59168 WHERE "Player" = 'tom kite' | SELECT "Score" FROM "table_59168" WHERE "Player" = 'tom kite' | 0.05957 |
CREATE TABLE table_name_2 (flight_day VARCHAR2, artist VARCHAR2)
| On what flight day was U2 played? | SELECT flight_day FROM table_name_2 WHERE artist = "u2" | SELECT "flight_day" FROM "table_name_2" WHERE "artist" = "u2" | 0.05957 |
CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR, Budget_Type_Description VARCHAR2)
CREATE TABLE Documents_with_Expenses (Document_ID NUMBER, Budget_Type_Code CHAR, Document_Details VARCHAR2)
CREATE TABLE Accounts (Account_ID NUMBER, Statement_ID NUMBER, Account_Details VARCHAR2)
CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR, Document_Type_Name VARCHAR2, Document_Type_Description VARCHAR2)
CREATE TABLE Projects (Project_ID NUMBER, Project_Details VARCHAR2)
CREATE TABLE Statements (Statement_ID NUMBER, Statement_Details VARCHAR2)
CREATE TABLE Documents (Document_ID NUMBER, Document_Type_Code CHAR, Project_ID NUMBER, Document_Date DATETIME, Document_Name VARCHAR2, Document_Description VARCHAR2, Other_Details VARCHAR2)
| Show the number of documents created in each day and bin document date by year interval with a line chart, and I want to rank Document_Date in asc order. | SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY Document_Date | SELECT "Document_Date", COUNT("Document_Date") FROM "Ref_Document_Types" "T1" JOIN "Documents" "T2" ON "T1"."Document_Type_Code" = "T2"."Document_Type_Code" ORDER BY "Document_Date" | 0.176758 |
CREATE TABLE table_79549 ("Round" FLOAT, "Pick" FLOAT, "Player" CLOB, "Nationality" CLOB, "College/junior/club team" CLOB)
| Which College/junior/club team has a Round of 2? | SELECT "College/junior/club team" FROM table_79549 WHERE "Round" = '2' | SELECT "College/junior/club team" FROM "table_79549" WHERE "Round" = '2' | 0.070313 |
CREATE TABLE table_29992 ("Pick" FLOAT, "Player" CLOB, "Position" CLOB, "Nationality" CLOB, "NHL team" CLOB, "College/junior/club team" CLOB)
| What player belongs to the Chicago Blackhawks? | SELECT "Player" FROM table_29992 WHERE "NHL team" = 'Chicago Blackhawks' | SELECT "Player" FROM "table_29992" WHERE "NHL team" = 'Chicago Blackhawks' | 0.072266 |
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)
| specify the icd9 code of patient paul edwards | SELECT diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Paul Edwards" | SELECT "diagnoses"."short_title" FROM "demographic" JOIN "diagnoses" ON "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "Paul Edwards" = "demographic"."name" | 0.15918 |
CREATE TABLE table_5769 ("Date" CLOB, "Time" CLOB, "Opponent" CLOB, "Result" CLOB, "Attendance" CLOB)
| What time was the match that had an attendance of 22,329? | SELECT "Time" FROM table_5769 WHERE "Attendance" = '22,329' | SELECT "Time" FROM "table_5769" WHERE "Attendance" = '22,329' | 0.05957 |
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 microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime 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 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)
| how many of the current patients are 50s? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 50 AND 59 | SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "patient" WHERE "patient"."age" <= 59 AND "patient"."age" >= 50 AND "patient"."hospitaldischargetime" IS NULL | 0.155273 |
CREATE TABLE table_name_76 (colliery VARCHAR2, death_toll VARCHAR2)
| Which Colliery has a Death toll of 7? | SELECT colliery FROM table_name_76 WHERE death_toll = 7 | SELECT "colliery" FROM "table_name_76" WHERE "death_toll" = 7 | 0.05957 |
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 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)
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)
| what is the number of patients whose diagnoses long title is candidiasis of mouth? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Candidiasis of mouth" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Candidiasis of mouth" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" | 0.185547 |
CREATE TABLE table_46152 ("Game" CLOB, "Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Location/Attendance" CLOB, "Record" CLOB)
| When they played at Chicago Bulls, what was the Location/Attendance? | SELECT "Location/Attendance" FROM table_46152 WHERE "Opponent" = 'at chicago bulls' | SELECT "Location/Attendance" FROM "table_46152" WHERE "Opponent" = 'at chicago bulls' | 0.083008 |
CREATE TABLE table_name_81 (pick NUMBER, round VARCHAR2, college VARCHAR2)
| What was the average pick of northwestern state college under round 3? | SELECT AVG(pick) FROM table_name_81 WHERE round < 3 AND college = "northwestern state" | SELECT AVG("pick") FROM "table_name_81" WHERE "college" = "northwestern state" AND "round" < 3 | 0.091797 |
CREATE TABLE table_name_41 (incumbent VARCHAR2, first_elected VARCHAR2, district VARCHAR2)
| Who is the incumbent who was first elected before 2002 from the maryland 3 district? | SELECT incumbent FROM table_name_41 WHERE first_elected < 2002 AND district = "maryland 3" | SELECT "incumbent" FROM "table_name_41" WHERE "district" = "maryland 3" AND "first_elected" < 2002 | 0.095703 |
CREATE TABLE table_26250155_1 (original_artist VARCHAR2, theme VARCHAR2)
| Who was the original artist of the First solo theme? | SELECT original_artist FROM table_26250155_1 WHERE theme = "First Solo" | SELECT "original_artist" FROM "table_26250155_1" WHERE "First Solo" = "theme" | 0.075195 |
CREATE TABLE player (player_id CLOB, birth_year CLOB, birth_month CLOB, birth_day CLOB, birth_country CLOB, birth_state CLOB, birth_city CLOB, death_year CLOB, death_month CLOB, death_day CLOB, death_country CLOB, death_state CLOB, death_city CLOB, name_first CLOB, name_last CLOB, name_given CLOB, weight CLOB)
CREATE TABLE hall_of_fame (player_id CLOB, yearid NUMBER, votedby CLOB, ballots CLOB, needed CLOB, votes CLOB, inducted CLOB, category CLOB, needed_note CLOB)
CREATE TABLE player_award (player_id CLOB, award_id CLOB, year NUMBER, league_id CLOB, tie CLOB, notes CLOB)
CREATE TABLE player_award_vote (award_id CLOB, year NUMBER, league_id CLOB, player_id CLOB, points_won NUMBER, points_max NUMBER, votes_first CLOB)
CREATE TABLE salary (year NUMBER, team_id CLOB, league_id CLOB, player_id CLOB, salary NUMBER)
| What is the average age of players from USA? | SELECT AVG(death_year - birth_year) FROM player WHERE birth_country = "USA" | SELECT AVG("death_year" - "birth_year") FROM "player" WHERE "USA" = "birth_country" | 0.081055 |
CREATE TABLE table_name_86 (college VARCHAR2, pick VARCHAR2)
| Which college's pick was 14? | SELECT college FROM table_name_86 WHERE pick = "14" | SELECT "college" FROM "table_name_86" WHERE "14" = "pick" | 0.055664 |
CREATE TABLE table_9615 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Stadium" CLOB, "Result" CLOB, "Record" CLOB, "Streak" CLOB, "Attendance" FLOAT)
| What was the result in week 14? | SELECT "Result" FROM table_9615 WHERE "Week" = '14' | SELECT "Result" FROM "table_9615" WHERE "Week" = '14' | 0.051758 |
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_Road and School_ID , could you sort total number from high to low order? | SELECT All_Road, School_ID FROM basketball_match ORDER BY School_ID DESC | SELECT "All_Road", "School_ID" FROM "basketball_match" ORDER BY "School_ID" DESC | 0.078125 |
CREATE TABLE table_2008 ("Branding" CLOB, "Callsign" CLOB, "Frequency" CLOB, "Power ( kW ) " CLOB, "Location" CLOB)
| What is the brand in Metro Manila? | SELECT "Branding" FROM table_2008 WHERE "Location" = 'Metro Manila' | SELECT "Branding" FROM "table_2008" WHERE "Location" = 'Metro Manila' | 0.067383 |
CREATE TABLE table_name_8 (lane NUMBER, time NUMBER)
| Which Lane has a Time larger than 47.83? | SELECT AVG(lane) FROM table_name_8 WHERE time > 47.83 | SELECT AVG("lane") FROM "table_name_8" WHERE "time" > 47.83 | 0.057617 |
CREATE TABLE writes (paperid NUMBER, authorid NUMBER)
CREATE TABLE paper (paperid NUMBER, title VARCHAR2, venueid NUMBER, year NUMBER, numciting NUMBER, numcitedby NUMBER, journalid NUMBER)
CREATE TABLE field (fieldid NUMBER)
CREATE TABLE venue (venueid NUMBER, venuename VARCHAR2)
CREATE TABLE cite (citingpaperid NUMBER, citedpaperid NUMBER)
CREATE TABLE author (authorid NUMBER, authorname VARCHAR2)
CREATE TABLE keyphrase (keyphraseid NUMBER, keyphrasename VARCHAR2)
CREATE TABLE paperfield (fieldid NUMBER, paperid NUMBER)
CREATE TABLE dataset (datasetid NUMBER, datasetname VARCHAR2)
CREATE TABLE journal (journalid NUMBER, journalname VARCHAR2)
CREATE TABLE paperdataset (paperid NUMBER, datasetid NUMBER)
CREATE TABLE paperkeyphrase (paperid NUMBER, keyphraseid NUMBER)
| keyphrases by srinivasan iyer | SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'srinivasan iyer' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | SELECT DISTINCT "keyphrase"."keyphraseid" FROM "author" JOIN "writes" ON "author"."authorid" = "writes"."authorid" JOIN "paper" ON "paper"."paperid" = "writes"."paperid" JOIN "paperkeyphrase" ON "paper"."paperid" = "paperkeyphrase"."paperid" JOIN "keyphrase" ON "keyphrase"."keyphraseid" = "paperkeyphrase"."keyphraseid" WHERE "author"."authorname" = 'srinivasan iyer' | 0.359375 |
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 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 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)
| count the number of patients whose death status is 1 and diagnoses long title is tietze's disease? | 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.long_title = "Tietze's disease" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Tietze's disease" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "1" = "demographic"."expire_flag" | 0.220703 |
CREATE TABLE Products (product_id NUMBER, product_type_code VARCHAR2, product_name VARCHAR2, product_price DOUBLE PRECISION)
CREATE TABLE Customer_Address_History (customer_id NUMBER, address_id NUMBER, date_from DATETIME, date_to DATETIME)
CREATE TABLE Addresses (address_id NUMBER, line_1_number_building VARCHAR2, city VARCHAR2, zip_postcode VARCHAR2, state_province_county VARCHAR2, country VARCHAR2)
CREATE TABLE Contacts (contact_id NUMBER, customer_id NUMBER, gender VARCHAR2, first_name VARCHAR2, last_name VARCHAR2, contact_phone VARCHAR2)
CREATE TABLE Customer_Orders (order_id NUMBER, customer_id NUMBER, order_date DATETIME, order_status_code VARCHAR2)
CREATE TABLE Order_Items (order_item_id NUMBER, order_id NUMBER, product_id NUMBER, order_quantity VARCHAR2)
CREATE TABLE Customers (customer_id NUMBER, payment_method_code VARCHAR2, customer_number VARCHAR2, customer_name VARCHAR2, customer_address VARCHAR2, customer_phone VARCHAR2, customer_email VARCHAR2)
| Show the proportion of the number of customers for each payment method code in a pie chart. | SELECT payment_method_code, COUNT(payment_method_code) FROM Customers GROUP BY payment_method_code | SELECT "payment_method_code", COUNT("payment_method_code") FROM "Customers" GROUP BY "payment_method_code" | 0.103516 |
CREATE TABLE table_3210 ("Region" CLOB, "Median income ( Intl.$ ) " FLOAT, "Below 40% of median income" CLOB, "Below 50% of median income" CLOB, "Below 60% of median income" CLOB)
| In what region do 18.6% of the people make less than 50% of the median income? | SELECT "Region" FROM table_3210 WHERE "Below 50% of median income" = '18.6%' | SELECT "Region" FROM "table_3210" WHERE "Below 50% of median income" = '18.6%' | 0.076172 |
CREATE TABLE table_name_88 (date VARCHAR2, result VARCHAR2)
| Which Date has a Result of l 14 13? | SELECT date FROM table_name_88 WHERE result = "l 14–13" | SELECT "date" FROM "table_name_88" WHERE "l 14–13" = "result" | 0.05957 |
CREATE TABLE table_22365 ("Voting order" FLOAT, "Country" CLOB, "Spokespersons" CLOB, "Commentator" CLOB, "Broadcaster" CLOB)
| list the spokespersons where voting order is 9 | SELECT "Spokespersons" FROM table_22365 WHERE "Voting order" = '9' | SELECT "Spokespersons" FROM "table_22365" WHERE "Voting order" = '9' | 0.066406 |
CREATE TABLE table_66848 ("Vehicle Flight #" CLOB, "Date" CLOB, "Pilot" CLOB, "Mach" FLOAT, "Velocity ( km/h ) " FLOAT, "Altitude ( ft ) " FLOAT, "Duration" CLOB)
| Who is the pilot on September 27, 1972? | SELECT "Pilot" FROM table_66848 WHERE "Date" = 'september 27, 1972' | SELECT "Pilot" FROM "table_66848" WHERE "Date" = 'september 27, 1972' | 0.067383 |
CREATE TABLE customers (customer_id CLOB, address_id NUMBER, customer_name CLOB, customer_phone CLOB, customer_email_address CLOB, other_details CLOB)
CREATE TABLE performers_in_bookings (order_id NUMBER, performer_id NUMBER)
CREATE TABLE services (service_id NUMBER, service_type_code CLOB, workshop_group_id NUMBER, product_description CLOB, product_name CLOB, product_price NUMBER, other_product_service_details CLOB)
CREATE TABLE ref_service_types (service_type_code CLOB, parent_service_type_code CLOB, service_type_description CLOB)
CREATE TABLE ref_payment_methods (payment_method_code CLOB, payment_method_description CLOB)
CREATE TABLE clients (client_id NUMBER, address_id NUMBER, customer_email_address CLOB, customer_name CLOB, customer_phone CLOB, other_details CLOB)
CREATE TABLE order_items (order_item_id NUMBER, order_id NUMBER, product_id NUMBER, order_quantity CLOB, other_item_details CLOB)
CREATE TABLE stores (store_id CLOB, address_id NUMBER, marketing_region_code CLOB, store_name CLOB, store_phone CLOB, store_email_address CLOB, other_details CLOB)
CREATE TABLE addresses (address_id CLOB, line_1 CLOB, line_2 CLOB, city_town CLOB, state_county CLOB, other_details CLOB)
CREATE TABLE marketing_regions (marketing_region_code CLOB, marketing_region_name CLOB, marketing_region_descriptrion CLOB, other_details CLOB)
CREATE TABLE drama_workshop_groups (workshop_group_id NUMBER, address_id NUMBER, currency_code CLOB, marketing_region_code CLOB, store_name CLOB, store_phone CLOB, store_email_address CLOB, other_details CLOB)
CREATE TABLE products (product_id CLOB, product_name CLOB, product_price NUMBER, product_description CLOB, other_product_service_details CLOB)
CREATE TABLE bookings (booking_id NUMBER, customer_id NUMBER, workshop_group_id CLOB, status_code CLOB, store_id NUMBER, order_date TIME, planned_delivery_date TIME, actual_delivery_date TIME, other_order_details CLOB)
CREATE TABLE invoice_items (invoice_item_id NUMBER, invoice_id NUMBER, order_id NUMBER, order_item_id NUMBER, product_id NUMBER, order_quantity NUMBER, other_item_details CLOB)
CREATE TABLE performers (performer_id NUMBER, address_id NUMBER, customer_name CLOB, customer_phone CLOB, customer_email_address CLOB, other_details CLOB)
CREATE TABLE invoices (invoice_id NUMBER, order_id NUMBER, payment_method_code CLOB, product_id NUMBER, order_quantity CLOB, other_item_details CLOB, order_item_id NUMBER)
CREATE TABLE customer_orders (order_id NUMBER, customer_id NUMBER, store_id NUMBER, order_date TIME, planned_delivery_date TIME, actual_delivery_date TIME, other_order_details CLOB)
CREATE TABLE bookings_services (order_id NUMBER, product_id NUMBER)
| What are the phone and email for customer Harold? | SELECT customer_phone, customer_email_address FROM customers WHERE customer_name = "Harold" | SELECT "customer_phone", "customer_email_address" FROM "customers" WHERE "Harold" = "customer_name" | 0.09668 |
CREATE TABLE table_44983 ("Name" CLOB, "Latitude" CLOB, "Longitude" CLOB, "Diameter ( km ) " FLOAT, "Year named" FLOAT)
| Which Diameter (km) has a Name of alma-merghen planitia, and a Year named smaller than 1997? | SELECT MAX("Diameter (km)") FROM table_44983 WHERE "Name" = 'alma-merghen planitia' AND "Year named" < '1997' | SELECT MAX("Diameter (km)") FROM "table_44983" WHERE "Name" = 'alma-merghen planitia' AND "Year named" < '1997' | 0.108398 |
CREATE TABLE table_7025 ("Name" CLOB, "Status" CLOB, "Authors" CLOB, "Unit" CLOB, "Location" CLOB)
| Who is the author for the malasaurus? | SELECT "Authors" FROM table_7025 WHERE "Name" = 'malasaurus' | SELECT "Authors" FROM "table_7025" WHERE "Name" = 'malasaurus' | 0.060547 |
CREATE TABLE table_name_96 (rank VARCHAR2, bronze VARCHAR2, nation VARCHAR2)
| Where does Norway rank in total medals among countries with fewer than 7 bronzes? | SELECT rank FROM table_name_96 WHERE bronze < 7 AND nation = "norway" | SELECT "rank" FROM "table_name_96" WHERE "bronze" < 7 AND "nation" = "norway" | 0.075195 |
CREATE TABLE table_16398 ("Pick #" FLOAT, "CFL Team" CLOB, "Player" CLOB, "Position" CLOB, "College" CLOB)
| How many times were players named brett ralph were selected? | SELECT COUNT("Pick #") FROM table_16398 WHERE "Player" = 'Brett Ralph' | SELECT COUNT("Pick #") FROM "table_16398" WHERE "Player" = 'Brett Ralph' | 0.070313 |
CREATE TABLE table_7754 ("Television service" CLOB, "Country" CLOB, "Content" CLOB, "HDTV" CLOB, "Package/Option" CLOB)
| What is the content of the Television service of Vesti? | SELECT "Content" FROM table_7754 WHERE "Television service" = 'vesti' | SELECT "Content" FROM "table_7754" WHERE "Television service" = 'vesti' | 0.069336 |
CREATE TABLE table_name_6 (region VARCHAR2, date VARCHAR2)
| Name the region for february 14, 2002 | SELECT region FROM table_name_6 WHERE date = "february 14, 2002" | SELECT "region" FROM "table_name_6" WHERE "date" = "february 14, 2002" | 0.068359 |
CREATE TABLE table_name_42 (drawn NUMBER, played NUMBER)
| What is the whole of Drawn that has a Played larger than 14? | SELECT SUM(drawn) FROM table_name_42 WHERE played > 14 | SELECT SUM("drawn") FROM "table_name_42" WHERE "played" > 14 | 0.058594 |
CREATE TABLE table_14562 ("Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Loss" CLOB, "Attendance" CLOB, "Record" CLOB)
| Which Date has a Record of 7-9? | SELECT "Date" FROM table_14562 WHERE "Record" = '7-9' | SELECT "Date" FROM "table_14562" WHERE "Record" = '7-9' | 0.053711 |
CREATE TABLE table_14003108_1 (team VARCHAR2, stadium VARCHAR2)
| what's the team with stadium being borough briggs | SELECT team FROM table_14003108_1 WHERE stadium = "Borough Briggs" | SELECT "team" FROM "table_14003108_1" WHERE "Borough Briggs" = "stadium" | 0.070313 |
CREATE TABLE table_26131 ("Election Year" FLOAT, "Assembly" CLOB, "Winning Party/Coalition" CLOB, "Chief Minister" CLOB, "Speaker" CLOB)
| What is the name of the speaker if the chief minister is M.G. Ramachandran? | SELECT "Speaker" FROM table_26131 WHERE "Chief Minister" = 'M.G. Ramachandran' | SELECT "Speaker" FROM "table_26131" WHERE "Chief Minister" = 'M.G. Ramachandran' | 0.078125 |
CREATE TABLE table_14751 ("Country" CLOB, "Film title used in nomination" CLOB, "Language" CLOB, "Original name" CLOB, "Director" CLOB)
| What is the original name of the film that used the title Olympics 40 in nomination? | SELECT "Original name" FROM table_14751 WHERE "Film title used in nomination" = 'olympics 40' | SELECT "Original name" FROM "table_14751" WHERE "Film title used in nomination" = 'olympics 40' | 0.092773 |
CREATE TABLE table_999 ("Total#" FLOAT, "Series#" FLOAT, "Title" CLOB, "Writer" CLOB, "Director" CLOB, "Original air date" CLOB)
| What's the title of the episode that Rob Heyland wrote? | SELECT "Title" FROM table_999 WHERE "Writer" = 'Rob Heyland' | SELECT "Title" FROM "table_999" WHERE "Writer" = 'Rob Heyland' | 0.060547 |
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
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 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 Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId 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 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 PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name 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 VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE ReviewTaskResultTypes (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 PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE FlagTypes (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 PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
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 PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
| Almost dead zombie finder on C++ tag. | SELECT q.Id AS "post_link", MAX(a.Score) AS "best_answer_score" FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND q.AnswerCount > 0 AND q.AcceptedAnswerId IS NULL AND a.PostTypeId = 2 AND q.Tags LIKE 'c++' GROUP BY q.Id HAVING MAX(a.Score) = 0 | SELECT "q"."Id" AS "post_link", MAX("a"."Score") AS "best_answer_score" FROM "Posts" "q" JOIN "Posts" "a" ON "a"."ParentId" = "q"."Id" AND "a"."PostTypeId" = 2 WHERE "q"."AcceptedAnswerId" IS NULL AND "q"."AnswerCount" > 0 AND "q"."PostTypeId" = 1 AND "q"."Tags" LIKE 'c++' GROUP BY "q"."Id" HAVING MAX("a"."Score") = 0 | 0.311523 |
CREATE TABLE table_57081 ("Player" CLOB, "Nationality" CLOB, "Position" CLOB, "Years for Jazz" CLOB, "School/Club Team" CLOB)
| Which position was active in Jazz in 2002-03? | SELECT "Position" FROM table_57081 WHERE "Years for Jazz" = '2002-03' | SELECT "Position" FROM "table_57081" WHERE "Years for Jazz" = '2002-03' | 0.069336 |
CREATE TABLE table_79238 ("Name" CLOB, "Height" CLOB, "Weight" CLOB, "Spike" CLOB, "2008 club" CLOB)
| What is the spike for the 2008 club of Lokomotiv Novosibirsk? | SELECT "Spike" FROM table_79238 WHERE "2008 club" = 'lokomotiv novosibirsk' | SELECT "Spike" FROM "table_79238" WHERE "2008 club" = 'lokomotiv novosibirsk' | 0.075195 |
CREATE TABLE table_56120 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
| How many people attended the game with an away team score of 10.8 (68)? | SELECT COUNT("Crowd") FROM table_56120 WHERE "Away team score" = '10.8 (68)' | SELECT COUNT("Crowd") FROM "table_56120" WHERE "Away team score" = '10.8 (68)' | 0.076172 |
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 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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount 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 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 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 outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod 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 microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_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)
| until 28 months ago, what was the first drug patient 27172 was prescribed via the iv drip route? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27172) AND prescriptions.route = 'iv drip' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-28 month') ORDER BY prescriptions.startdate LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 27172 GROUP BY "hadm_id") SELECT "prescriptions"."drug" FROM "prescriptions" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE "prescriptions"."route" = 'iv drip' AND DATETIME("prescriptions"."startdate") <= DATETIME(CURRENT_TIME(), '-28 month') AND NOT "_u_0"."" IS NULL ORDER BY "prescriptions"."startdate" FETCH FIRST 1 ROWS ONLY | 0.44043 |
CREATE TABLE track (seating NUMBER)
| What is the minimum, maximum, and average seating for all tracks. | SELECT MIN(seating), MAX(seating), AVG(seating) FROM track | SELECT MIN("seating"), MAX("seating"), AVG("seating") FROM "track" | 0.064453 |
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 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime 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 allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
| what are the five most commonly ordered specimen test for a patient who was previously diagnosed with chronic respiratory failure during the same month until 2104? | SELECT t3.culturesite FROM (SELECT t2.culturesite, 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 = 'chronic respiratory failure' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid, microlab.culturesite, microlab.culturetakentime FROM microlab JOIN patient ON microlab.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', microlab.culturetakentime) <= '2104') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.culturetakentime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.culturetakentime, 'start of month') GROUP BY t2.culturesite) AS t3 WHERE t3.c1 <= 5 | WITH "t2" AS (SELECT "patient"."uniquepid", "microlab"."culturesite", "microlab"."culturetakentime" FROM "microlab" JOIN "patient" ON "microlab"."patientunitstayid" = "patient"."patientunitstayid" WHERE STRFTIME('%y', "microlab"."culturetakentime") <= '2104'), "t3" AS (SELECT "t2"."culturesite", 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"."culturetakentime" AND "patient"."uniquepid" = "t2"."uniquepid" AND DATETIME("diagnosis"."diagnosistime", 'start of month') = DATETIME("t2"."culturetakentime", 'start of month') WHERE "diagnosis"."diagnosisname" = 'chronic respiratory failure' AND STRFTIME('%y', "diagnosis"."diagnosistime") <= '2104' GROUP BY "t2"."culturesite") SELECT "t3"."culturesite" FROM "t3" "t3" WHERE "t3"."c1" <= 5 | 0.871094 |
CREATE TABLE table_58660 ("Mininera DFL" CLOB, "Wins" FLOAT, "Byes" FLOAT, "Losses" FLOAT, "Draws" FLOAT, "Against" FLOAT)
| How many Againsts have more than 15 wins? | SELECT COUNT("Against") FROM table_58660 WHERE "Wins" > '15' | SELECT COUNT("Against") FROM "table_58660" WHERE "Wins" > '15' | 0.060547 |
CREATE TABLE table_name_95 (theme VARCHAR2, issue_price VARCHAR2)
| What is the Theme of the coin with an Issue Price of $89.95? | SELECT theme FROM table_name_95 WHERE issue_price = "$89.95" | SELECT "theme" FROM "table_name_95" WHERE "$89.95" = "issue_price" | 0.064453 |
CREATE TABLE table_69443 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Attendance" FLOAT)
| What week 14 has the lowest attendance? | SELECT MIN("Attendance") FROM table_69443 WHERE "Week" = '14' | SELECT MIN("Attendance") FROM "table_69443" WHERE "Week" = '14' | 0.061523 |
CREATE TABLE table_73418 ("Year" FLOAT, "Mens Singles" CLOB, "Womens Singles" CLOB, "Mens Doubles" CLOB, "Womens Doubles" CLOB, "A Mixed Doubles" CLOB, "B Mixed Doubles" CLOB)
| What is the least year when men's singles is Raju Rai? | SELECT MIN("Year") FROM table_73418 WHERE "Mens Singles" = 'Raju Rai' | SELECT MIN("Year") FROM "table_73418" WHERE "Mens Singles" = 'Raju Rai' | 0.069336 |
CREATE TABLE table_203_695 (id NUMBER, "draw" NUMBER, "artist" CLOB, "song" CLOB, "points" NUMBER, "place" CLOB)
| name one song that did not earn 60 points . | SELECT "song" FROM table_203_695 WHERE "points" < 60 | SELECT "song" FROM "table_203_695" WHERE "points" < 60 | 0.052734 |
CREATE TABLE table_57607 ("Country" CLOB, "Abbreviation" CLOB, "Assets US$Billion" CLOB, "Inception" CLOB, "Origin" CLOB)
| What's the origin for the country abbreviated atf? | SELECT "Origin" FROM table_57607 WHERE "Abbreviation" = 'atf' | SELECT "Origin" FROM "table_57607" WHERE "Abbreviation" = 'atf' | 0.061523 |
CREATE TABLE table_train_9 ("id" NUMBER, "pregnancy_or_lactation" BOOLEAN, "intention_to_arterial_catheter" BOOLEAN, "intention_to_central_venous_catheter" BOOLEAN, "surgery" BOOLEAN, "hypotension" BOOLEAN, "chest_trauma" BOOLEAN, "burn_injury" NUMBER, "impossible_transthoracic_echocardiogram_tte" BOOLEAN, "NOUSE" FLOAT)
| contraindication to central venous catheterization or arterial catheterization | SELECT * FROM table_train_9 WHERE intention_to_arterial_catheter = 0 OR intention_to_central_venous_catheter = 0 | SELECT * FROM "table_train_9" WHERE "intention_to_arterial_catheter" = 0 OR "intention_to_central_venous_catheter" = 0 | 0.115234 |
CREATE TABLE table_name_91 (neon VARCHAR2, atomic_property VARCHAR2)
| Which Neon has Atomic property of average valence electron energy (avee)? | SELECT neon FROM table_name_91 WHERE atomic_property = "average valence electron energy (avee)" | SELECT "neon" FROM "table_name_91" WHERE "atomic_property" = "average valence electron energy (avee)" | 0.098633 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.