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 Rooms (RoomId CLOB, roomName CLOB, beds NUMBER, bedType CLOB, maxOccupancy NUMBER, basePrice NUMBER, decor CLOB)
CREATE TABLE Reservations (Code NUMBER, Room CLOB, CheckIn CLOB, CheckOut CLOB, Rate FLOAT, LastName CLOB, FirstName CLOB, Adults NUMBER, Kids NUMBER)
| Draw a bar chart of decor versus minimal baseprice, could you show in ascending by the names? | SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor ORDER BY decor | SELECT "decor", MIN("basePrice") FROM "Rooms" GROUP BY "decor" ORDER BY "decor" | 0.077148 |
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE 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 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
| calculate the three year survival probability of patients to whom sodium chloride 0.9 % was prescribed after they were diagnosed with change in mental status. | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'change in mental status' GROUP BY patient.uniquepid HAVING MIN(diagnosis.diagnosistime) = diagnosis.diagnosistime) AS t1) AS t2 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'sodium chloride 0.9 %') AS t3 ON t2.uniquepid = t3.uniquepid WHERE t2.diagnosistime < t3.drugstarttime) AS t4 JOIN patient ON t4.uniquepid = patient.uniquepid | WITH "t1" AS (SELECT "patient"."uniquepid", "diagnosis"."diagnosistime" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" WHERE "diagnosis"."diagnosisname" = 'change in mental status' GROUP BY "patient"."uniquepid" HAVING "diagnosis"."diagnosistime" = MIN("diagnosis"."diagnosistime")), "t3" AS (SELECT "patient"."uniquepid", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" WHERE "medication"."drugname" = 'sodium chloride 0.9 %') SELECT SUM(CASE WHEN "patient"."hospitaldischargestatus" = 'alive' THEN 1 WHEN STRFTIME('%j', "patient"."hospitaldischargetime") - STRFTIME('%j', "t1"."diagnosistime") > 1095 THEN 1 ELSE 0 END) * 100 / NULLIF(COUNT(*), 0) FROM "t1" "t1" JOIN "t3" "t3" ON "t1"."diagnosistime" < "t3"."drugstarttime" AND "t1"."uniquepid" = "t3"."uniquepid" JOIN "patient" ON "patient"."uniquepid" = "t1"."uniquepid" | 0.936523 |
CREATE TABLE table_49461 ("Rider" CLOB, "Manufacturer" CLOB, "Laps" FLOAT, "Time" CLOB, "Grid" FLOAT)
| What is the fewest amount of laps when the grid was larger than 1 and 42:31.153? | SELECT MIN("Laps") FROM table_49461 WHERE "Time" = '42:31.153' AND "Grid" > '1' | SELECT MIN("Laps") FROM "table_49461" WHERE "Grid" > '1' AND "Time" = '42:31.153' | 0.079102 |
CREATE TABLE table_16688 ("Country" CLOB, "Total" FLOAT, "Marathon ( mens ) " FLOAT, "Marathon ( womens ) " FLOAT, "Half Marathon ( mens ) " FLOAT, "Half Marathon ( womens ) " FLOAT)
| How many times is Moldova the winner of half marathon (womens)? | SELECT COUNT("Half Marathon (womens)") FROM table_16688 WHERE "Country" = 'Moldova' | SELECT COUNT("Half Marathon (womens)") FROM "table_16688" WHERE "Country" = 'Moldova' | 0.083008 |
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
| For all employees who have the letters D or S in their first name, return a line chart about the change of employee_id over hire_date , and I want to list by the HIRE_DATE in desc. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC | SELECT "HIRE_DATE", "EMPLOYEE_ID" FROM "employees" WHERE "FIRST_NAME" LIKE '%D%' OR "FIRST_NAME" LIKE '%S%' ORDER BY "HIRE_DATE" DESC | 0.129883 |
CREATE TABLE table_64933 ("Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Loss" CLOB, "Attendance" FLOAT, "Record" CLOB, "Arena" CLOB, "Points" FLOAT)
| How much Attendance has an Arena of arrowhead pond of anaheim, and Points of 5? | SELECT SUM("Attendance") FROM table_64933 WHERE "Arena" = 'arrowhead pond of anaheim' AND "Points" = '5' | SELECT SUM("Attendance") FROM "table_64933" WHERE "Arena" = 'arrowhead pond of anaheim' AND "Points" = '5' | 0.103516 |
CREATE TABLE table_name_44 (crowd NUMBER, away_team VARCHAR2)
| What is the sum of crowd(s) when richmond is the away squad? | SELECT SUM(crowd) FROM table_name_44 WHERE away_team = "richmond" | SELECT SUM("crowd") FROM "table_name_44" WHERE "away_team" = "richmond" | 0.069336 |
CREATE TABLE table_21340 ("Game" FLOAT, "Date" CLOB, "Opponent" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location/Attendance" CLOB, "Record" CLOB)
| In the game resulting in a 5-11 record, who scored the high rebounds? | SELECT "High rebounds" FROM table_21340 WHERE "Record" = '5-11' | SELECT "High rebounds" FROM "table_21340" WHERE "Record" = '5-11' | 0.063477 |
CREATE TABLE table_name_96 (productions VARCHAR2, herbie VARCHAR2)
| Which production had Rex Robbins as Herbie? | SELECT productions FROM table_name_96 WHERE herbie = "rex robbins" | SELECT "productions" FROM "table_name_96" WHERE "herbie" = "rex robbins" | 0.070313 |
CREATE TABLE table_11333 ("Municipalities" CLOB, "Extension km\\u00b2" CLOB, "Population ( hab ) " CLOB, "Density ( hab/ km\\u00b2 ) " CLOB, "Altitude m" CLOB, "Distance Medell\\u00edn Downtown ( km ) " CLOB)
| What is the Density (hab/ km ) when the population (hab) is 58 414*? | SELECT "Density (hab/ km\u00b2 )" FROM table_11333 WHERE "Population (hab)" = '58 414*' | SELECT "Density (hab/ km\u00b2 )" FROM "table_11333" WHERE "Population (hab)" = '58 414*' | 0.086914 |
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 offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id 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 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 (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE area (course_id NUMBER, area 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 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 student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
| What does STRATEGY 564 entail ? | SELECT DISTINCT description, name FROM course WHERE department = 'STRATEGY' AND number = 564 | SELECT DISTINCT "description", "name" FROM "course" WHERE "department" = 'STRATEGY' AND "number" = 564 | 0.099609 |
CREATE TABLE entrepreneur (entrepreneur_id NUMBER, people_id NUMBER, company CLOB, money_requested NUMBER, investor CLOB)
CREATE TABLE people (people_id NUMBER, name CLOB, height NUMBER, weight NUMBER, date_of_birth CLOB)
| Return the weights of entrepreneurs, ordered descending by amount of money requested. | SELECT T2.weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id ORDER BY T1.money_requested DESC | SELECT "T2"."weight" FROM "entrepreneur" "T1" JOIN "people" "T2" ON "T1"."people_id" = "T2"."people_id" ORDER BY "T1"."money_requested" DESC | 0.136719 |
CREATE TABLE table_74330 ("Team" CLOB, "Stadium" CLOB, "Home Games" FLOAT, "Average Attendance" FLOAT, "Total Attendance" FLOAT, "Capacity Percentage" CLOB)
| What is the name of the stadium when the capacity percentage is 83.9% | SELECT "Stadium" FROM table_74330 WHERE "Capacity Percentage" = '83.9%' | SELECT "Stadium" FROM "table_74330" WHERE "Capacity Percentage" = '83.9%' | 0.071289 |
CREATE TABLE table_9035 ("Official Name" CLOB, "Status" CLOB, "Area km 2" FLOAT, "Population" FLOAT, "Census Ranking" CLOB)
| What status has 10 as the population? | SELECT "Status" FROM table_9035 WHERE "Population" = '10' | SELECT "Status" FROM "table_9035" WHERE "Population" = '10' | 0.057617 |
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE 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 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 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 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 ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id 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 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 airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE days (days_code VARCHAR2, day_name 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 flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
| cheapest fare from INDIANAPOLIS to SEATTLE | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'INDIANAPOLIS' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'SEATTLE' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code | WITH "_u_0" AS (SELECT MIN("FAREalias1"."one_direction_cost") FROM "airport_service" "AIRPORT_SERVICEalias2" JOIN "city" "CITYalias2" ON "AIRPORT_SERVICEalias2"."city_code" = "CITYalias2"."city_code" AND "CITYalias2"."city_name" = 'INDIANAPOLIS' JOIN "flight" "FLIGHTalias1" ON "AIRPORT_SERVICEalias2"."airport_code" = "FLIGHTalias1"."from_airport" JOIN "airport_service" "AIRPORT_SERVICEalias3" ON "AIRPORT_SERVICEalias3"."airport_code" = "FLIGHTalias1"."to_airport" JOIN "flight_fare" "FLIGHT_FAREalias1" ON "FLIGHT_FAREalias1"."flight_id" = "FLIGHTalias1"."flight_id" JOIN "city" "CITYalias3" ON "AIRPORT_SERVICEalias3"."city_code" = "CITYalias3"."city_code" AND "CITYalias3"."city_name" = 'SEATTLE' JOIN "fare" "FAREalias1" ON "FAREalias1"."fare_id" = "FLIGHT_FAREalias1"."fare_id") SELECT DISTINCT "fare"."fare_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" = 'INDIANAPOLIS' 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" = 'SEATTLE' JOIN "fare" ON "fare"."fare_id" = "flight_fare"."fare_id" JOIN "_u_0" "_u_0" ON "_u_0"."" = "fare"."one_direction_cost" | 1.438477 |
CREATE TABLE Affiliated_With (Physician NUMBER, Department NUMBER, PrimaryAffiliation BOOLEAN)
CREATE TABLE Undergoes (Patient NUMBER, Procedures NUMBER, Stay NUMBER, DateUndergoes DATETIME, Physician NUMBER, AssistingNurse NUMBER)
CREATE TABLE Procedures (Code NUMBER, Name VARCHAR2, Cost FLOAT)
CREATE TABLE Trained_In (Physician NUMBER, Treatment NUMBER, CertificationDate DATETIME, CertificationExpires DATETIME)
CREATE TABLE Stay (StayID NUMBER, Patient NUMBER, Room NUMBER, StayStart DATETIME, StayEnd DATETIME)
CREATE TABLE On_Call (Nurse NUMBER, BlockFloor NUMBER, BlockCode NUMBER, OnCallStart DATETIME, OnCallEnd DATETIME)
CREATE TABLE Patient (SSN NUMBER, Name VARCHAR2, Address VARCHAR2, Phone VARCHAR2, InsuranceID NUMBER, PCP NUMBER)
CREATE TABLE Room (RoomNumber NUMBER, RoomType VARCHAR2, BlockFloor NUMBER, BlockCode NUMBER, Unavailable BOOLEAN)
CREATE TABLE Medication (Code NUMBER, Name VARCHAR2, Brand VARCHAR2, Description VARCHAR2)
CREATE TABLE Physician (EmployeeID NUMBER, Name VARCHAR2, Position VARCHAR2, SSN NUMBER)
CREATE TABLE Nurse (EmployeeID NUMBER, Name VARCHAR2, Position VARCHAR2, Registered BOOLEAN, SSN NUMBER)
CREATE TABLE Department (DepartmentID NUMBER, Name VARCHAR2, Head NUMBER)
CREATE TABLE Prescribes (Physician NUMBER, Patient NUMBER, Medication NUMBER, Date DATETIME, Appointment NUMBER, Dose VARCHAR2)
CREATE TABLE Block (BlockFloor NUMBER, BlockCode NUMBER)
CREATE TABLE Appointment (AppointmentID NUMBER, Patient NUMBER, PrepNurse NUMBER, Physician NUMBER, Start DATETIME, End DATETIME, ExaminationRoom CLOB)
| A bar chart for listing the number of the name of physicians who took some appointment, list from low to high by the bars please. | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Physician AS T2 ON T1.Physician = T2.EmployeeID GROUP BY Name ORDER BY Name | SELECT "Name", COUNT("Name") FROM "Appointment" "T1" JOIN "Physician" "T2" ON "T1"."Physician" = "T2"."EmployeeID" GROUP BY "Name" ORDER BY "Name" | 0.142578 |
CREATE TABLE table_8057 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
| What were the high rebounds when the score was l 101 109 (ot)? | SELECT "High rebounds" FROM table_8057 WHERE "Score" = 'l 101–109 (ot)' | SELECT "High rebounds" FROM "table_8057" WHERE "Score" = 'l 101–109 (ot)' | 0.071289 |
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 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 diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label 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)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name 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 chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom 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 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)
| when did patient 3516 first receive a lab test for potassium since 04/2103? | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3516) AND STRFTIME('%y-%m', labevents.charttime) >= '2103-04' ORDER BY labevents.charttime LIMIT 1 | WITH "_u_0" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'potassium' GROUP BY "itemid"), "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 3516 GROUP BY "hadm_id") SELECT "labevents"."charttime" FROM "labevents" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "labevents"."itemid" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "labevents"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m', "labevents"."charttime") >= '2103-04' ORDER BY "labevents"."charttime" FETCH FIRST 1 ROWS ONLY | 0.567383 |
CREATE TABLE table_13150274_1 (country VARCHAR2, area_of_operation VARCHAR2)
| In what country is the El Hamada area of operation? | SELECT country FROM table_13150274_1 WHERE area_of_operation = "El Hamada" | SELECT "country" FROM "table_13150274_1" WHERE "El Hamada" = "area_of_operation" | 0.078125 |
CREATE TABLE table_name_27 (year_of_most_recent_appearance NUMBER, year_of_first_appearance VARCHAR2, corps_name VARCHAR2)
| What is the average year of the most recent appearance of the Boston Crusaders, who had their first appearance after 1976? | SELECT AVG(year_of_most_recent_appearance) FROM table_name_27 WHERE year_of_first_appearance > 1976 AND corps_name = "boston crusaders" | SELECT AVG("year_of_most_recent_appearance") FROM "table_name_27" WHERE "boston crusaders" = "corps_name" AND "year_of_first_appearance" > 1976 | 0.139648 |
CREATE TABLE table_55560 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
| In the game where Collingwood is the home team what is the score of the away team? | SELECT "Away team score" FROM table_55560 WHERE "Home team" = 'collingwood' | SELECT "Away team score" FROM "table_55560" WHERE "Home team" = 'collingwood' | 0.075195 |
CREATE TABLE table_35593 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
| What team did the Heat play against at the TD Waterhouse Centre? | SELECT "Team" FROM table_35593 WHERE "Location Attendance" = 'td waterhouse centre' | SELECT "Team" FROM "table_35593" WHERE "Location Attendance" = 'td waterhouse centre' | 0.083008 |
CREATE TABLE table_52828 ("Player" CLOB, "Nationality" CLOB, "Position" CLOB, "Years for Jazz" CLOB, "School/Club Team" CLOB)
| What years did Eddie Hughes play for the Jazz? | SELECT "Years for Jazz" FROM table_52828 WHERE "Player" = 'eddie hughes' | SELECT "Years for Jazz" FROM "table_52828" WHERE "Player" = 'eddie hughes' | 0.072266 |
CREATE TABLE table_17487395_1 (callsign VARCHAR2, frequency VARCHAR2)
| What is the call sign of the station with the frequency of 90.3mhz | SELECT callsign FROM table_17487395_1 WHERE frequency = "90.3MHz" | SELECT "callsign" FROM "table_17487395_1" WHERE "90.3MHz" = "frequency" | 0.069336 |
CREATE TABLE allergy_type (allergy CLOB, allergytype CLOB)
CREATE TABLE student (stuid NUMBER, lname CLOB, fname CLOB, age NUMBER, sex CLOB, major NUMBER, advisor NUMBER, city_code CLOB)
CREATE TABLE has_allergy (stuid NUMBER, allergy CLOB)
| How many students have a food allergy? | SELECT COUNT(*) FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food" | SELECT COUNT(*) FROM "has_allergy" "T1" JOIN "allergy_type" "T2" ON "T1"."allergy" = "T2"."allergy" AND "T2"."allergytype" = "food" | 0.12793 |
CREATE TABLE table_39790 ("Year" FLOAT, "Award" CLOB, "Category" CLOB, "Nominated Work" CLOB, "Result" CLOB)
| How many years has the Mercury Prize award been given? | SELECT COUNT("Year") FROM table_39790 WHERE "Award" = 'mercury prize' | SELECT COUNT("Year") FROM "table_39790" WHERE "Award" = 'mercury prize' | 0.069336 |
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 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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| how many patients are below 62 years of age and hospital stay is above 6 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "62" AND demographic.days_stay > "6" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "6" < "demographic"."days_stay" AND "62" > "demographic"."age" | 0.133789 |
CREATE TABLE table_name_67 (organized VARCHAR2, occupation VARCHAR2)
| What is the organized date of the stake with an occupation of senior buyer for Wal-mart? | SELECT organized FROM table_name_67 WHERE occupation = "senior buyer for wal-mart" | SELECT "organized" FROM "table_name_67" WHERE "occupation" = "senior buyer for wal-mart" | 0.085938 |
CREATE TABLE table_34357 ("Region" CLOB, "Date" CLOB, "Label" CLOB, "Format" CLOB, "Catalogue" CLOB)
| Which region has and eyeball label and catalogue 7200222? | SELECT "Region" FROM table_34357 WHERE "Label" = 'eyeball' AND "Catalogue" = '7200222' | SELECT "Region" FROM "table_34357" WHERE "Catalogue" = '7200222' AND "Label" = 'eyeball' | 0.085938 |
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 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 lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
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)
| among the patients who have been prescribed with haloperidol lactate after having been diagnosed with hyperlipidemia give me the three year survival probability. | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperlipidemia' GROUP BY patient.uniquepid HAVING MIN(diagnosis.diagnosistime) = diagnosis.diagnosistime) AS t1) AS t2 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'haloperidol lactate') AS t3 ON t2.uniquepid = t3.uniquepid WHERE t2.diagnosistime < t3.drugstarttime) AS t4 JOIN patient ON t4.uniquepid = patient.uniquepid | WITH "t1" AS (SELECT "patient"."uniquepid", "diagnosis"."diagnosistime" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" WHERE "diagnosis"."diagnosisname" = 'hyperlipidemia' GROUP BY "patient"."uniquepid" HAVING "diagnosis"."diagnosistime" = MIN("diagnosis"."diagnosistime")), "t3" AS (SELECT "patient"."uniquepid", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" WHERE "medication"."drugname" = 'haloperidol lactate') SELECT SUM(CASE WHEN "patient"."hospitaldischargestatus" = 'alive' THEN 1 WHEN STRFTIME('%j', "patient"."hospitaldischargetime") - STRFTIME('%j', "t1"."diagnosistime") > 1095 THEN 1 ELSE 0 END) * 100 / NULLIF(COUNT(*), 0) FROM "t1" "t1" JOIN "t3" "t3" ON "t1"."diagnosistime" < "t3"."drugstarttime" AND "t1"."uniquepid" = "t3"."uniquepid" JOIN "patient" ON "patient"."uniquepid" = "t1"."uniquepid" | 0.925781 |
CREATE TABLE table_47028 ("Branding" CLOB, "Callsign" CLOB, "Frequency" CLOB, "Power ( kW ) " CLOB, "Location" CLOB)
| What is the Power (kW) for the station with the frequency of 98.7mhz? | SELECT "Power (kW)" FROM table_47028 WHERE "Frequency" = '98.7mhz' | SELECT "Power (kW)" FROM "table_47028" WHERE "Frequency" = '98.7mhz' | 0.066406 |
CREATE TABLE table_22748 ("Player" CLOB, "Original Season" CLOB, "Gender" CLOB, "Eliminated" CLOB, "Placing" CLOB)
| What was the season where Evelyn Smith was on? | SELECT "Original Season" FROM table_22748 WHERE "Player" = 'Evelyn Smith' | SELECT "Original Season" FROM "table_22748" WHERE "Player" = 'Evelyn Smith' | 0.073242 |
CREATE TABLE table_3032 ("Series No." FLOAT, "Episode No." FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "UK Ratings ( BBC2 Rank ) " CLOB, "Original air date" CLOB)
| Name the least series number | SELECT MIN("Series No.") FROM table_3032 | SELECT MIN("Series No.") FROM "table_3032" | 0.041016 |
CREATE TABLE table_74624 ("Year" FLOAT, "Player" CLOB, "Nation of citizenship" CLOB, "Team represented" CLOB, "Position primarily played" CLOB)
| What is the sum of all the years that Landon Donovan won the ESPY award? | SELECT COUNT("Year") FROM table_74624 WHERE "Player" = 'landon donovan' | SELECT COUNT("Year") FROM "table_74624" WHERE "Player" = 'landon donovan' | 0.071289 |
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_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)
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)
| For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of hire_date and the sum of salary bin hire_date by time in a bar chart, and sort total number of salary from high to low order please. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(SALARY) DESC | SELECT "HIRE_DATE", SUM("SALARY") FROM "employees" WHERE ("COMMISSION_PCT" <> "null" OR "DEPARTMENT_ID" <> 40) AND ("DEPARTMENT_ID" <> 40 OR "SALARY" <= 12000) AND ("DEPARTMENT_ID" <> 40 OR "SALARY" >= 8000) ORDER BY SUM("SALARY") DESC | 0.229492 |
CREATE TABLE weather (date CLOB, max_temperature_f NUMBER, mean_temperature_f NUMBER, min_temperature_f NUMBER, max_dew_point_f NUMBER, mean_dew_point_f NUMBER, min_dew_point_f NUMBER, max_humidity NUMBER, mean_humidity NUMBER, min_humidity NUMBER, max_sea_level_pressure_inches NUMBER, mean_sea_level_pressure_inches NUMBER, min_sea_level_pressure_inches NUMBER, max_visibility_miles NUMBER, mean_visibility_miles NUMBER, min_visibility_miles NUMBER, max_wind_Speed_mph NUMBER, mean_wind_speed_mph NUMBER, max_gust_speed_mph NUMBER, precipitation_inches NUMBER, cloud_cover NUMBER, events CLOB, wind_dir_degrees NUMBER, zip_code NUMBER)
CREATE TABLE status (station_id NUMBER, bikes_available NUMBER, docks_available NUMBER, time CLOB)
CREATE TABLE station (id NUMBER, name CLOB, lat NUMBER, long NUMBER, dock_count NUMBER, city CLOB, installation_date CLOB)
CREATE TABLE trip (id NUMBER, duration NUMBER, start_date CLOB, start_station_name CLOB, start_station_id NUMBER, end_date CLOB, end_station_name CLOB, end_station_id NUMBER, bike_id NUMBER, subscription_type CLOB, zip_code NUMBER)
| Show me how many long by long in a histogram, could you rank from low to high by the y axis? | SELECT long, COUNT(long) FROM station ORDER BY COUNT(long) | SELECT "long", COUNT("long") FROM "station" ORDER BY COUNT("long") | 0.064453 |
CREATE TABLE table_203_763 (id NUMBER, "year" NUMBER, "competition" CLOB, "venue" CLOB, "position" CLOB, "notes" CLOB)
| how many of the competitions that took place were based in a venue in the united states ? | SELECT COUNT("competition") FROM table_203_763 WHERE "venue" = 'united states' | SELECT COUNT("competition") FROM "table_203_763" WHERE "venue" = 'united states' | 0.078125 |
CREATE TABLE table_name_89 (round VARCHAR2, name VARCHAR2)
| What were Will Rackley's total rounds? | SELECT COUNT(round) FROM table_name_89 WHERE name = "will rackley" | SELECT COUNT("round") FROM "table_name_89" WHERE "name" = "will rackley" | 0.070313 |
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 ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskResultTypes (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 Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
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 CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
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 Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
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 PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE 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 Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
| Low score unanswered & unclosed questions. | SELECT Id AS "post_link", Score, DATEADD(DAY, -3, GETDATE()) FROM Posts WHERE CreationDate > DATEADD(DAY, -5, GETDATE()) ORDER BY Score | SELECT "Id" AS "post_link", "Score", DATEADD("DAY", -3, GETDATE()) FROM "Posts" WHERE "CreationDate" > DATEADD("DAY", -5, GETDATE()) ORDER BY "Score" | 0.145508 |
CREATE TABLE table_23553 ("#" CLOB, "Original title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original airdate" CLOB, "Prod. code" CLOB, "Viewers" FLOAT)
| When 'the postcard' is the original title what is the production code? | SELECT "Prod. code" FROM table_23553 WHERE "Original title" = 'The Postcard' | SELECT "Prod. code" FROM "table_23553" WHERE "Original title" = 'The Postcard' | 0.076172 |
CREATE TABLE Rating (rID NUMBER, mID NUMBER, stars NUMBER, ratingDate DATE)
CREATE TABLE Movie (mID NUMBER, title CLOB, year NUMBER, director CLOB)
CREATE TABLE Reviewer (rID NUMBER, name CLOB)
| Ignore movies whose director is NULL For each director, what are the titles and ratings for all the movies they reviewed? Show the result by a bar chart, and I want to display X from low to high order please. | SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" ORDER BY title | SELECT "title", "stars" FROM "Rating" "T1" JOIN "Movie" "T2" ON "T1"."mID" = "T2"."mID" WHERE "director" <> "null" ORDER BY "title" | 0.12793 |
CREATE TABLE table_203_145 (id NUMBER, "position" NUMBER, "club" CLOB, "played" NUMBER, "points" CLOB, "wins" NUMBER, "draws" NUMBER, "losses" NUMBER, "goals for" NUMBER, "goals against" NUMBER, "goal difference" NUMBER)
| did any clubs have no losses ? | SELECT (SELECT COUNT("club") FROM table_203_145 WHERE "losses" = 0) > 0 | SELECT (SELECT COUNT("club") FROM "table_203_145" WHERE "losses" = 0) > 0 | 0.071289 |
CREATE TABLE table_name_27 (winning_driver VARCHAR2, constructor VARCHAR2)
| Who is the winning driver that has a construction of brm? | SELECT winning_driver FROM table_name_27 WHERE constructor = "brm" | SELECT "winning_driver" FROM "table_name_27" WHERE "brm" = "constructor" | 0.070313 |
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight 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 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 date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description 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 airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
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 month (month_number NUMBER, month_name CLOB)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description 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 city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id 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 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 airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
| list all flights from BURBANK to DENVER | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BURBANK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'BURBANK' 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 "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'DENVER' | 0.481445 |
CREATE TABLE table_48363 ("Branding" CLOB, "Callsign" CLOB, "Frequency" CLOB, "Power" CLOB, "Location" CLOB)
| What is the Location of the Frequency with a Callsign of DXBL? | SELECT "Location" FROM table_48363 WHERE "Callsign" = 'dxbl' | SELECT "Location" FROM "table_48363" WHERE "Callsign" = 'dxbl' | 0.060547 |
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 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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| provide the number of patients whose admission location is clinic referral/premature and primary disease is s/p hanging. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "S/P HANGING" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "CLINIC REFERRAL/PREMATURE" = "demographic"."admission_location" AND "S/P HANGING" = "demographic"."diagnosis" | 0.180664 |
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 allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
| how many days has it been since patient 012-66291 dext 5%-nacl 0.9% 1000 ml lvp was last prescribed on this hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-66291') AND patient.hospitaldischargetime IS NULL) AND medication.drugname = 'dext 5%-nacl 0.9% 1000 ml lvp' ORDER BY medication.drugstarttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '012-66291' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE "patient"."hospitaldischargetime" IS NULL AND NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "medication"."drugstarttime")) FROM "medication" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "medication"."patientunitstayid" WHERE "medication"."drugname" = 'dext 5%-nacl 0.9% 1000 ml lvp' AND NOT "_u_1"."" IS NULL ORDER BY "medication"."drugstarttime" DESC FETCH FIRST 1 ROWS ONLY | 0.720703 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE 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)
| give me the number of patients with po route of drug administration born before 1846. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1846" AND prescriptions.route = "PO" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "PO" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "1846" > "demographic"."dob_year" | 0.213867 |
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 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)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| what is the number of patients whose lab test name is potassium, urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Potassium, Urine" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Potassium, Urine" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" | 0.15918 |
CREATE TABLE table_64734 ("Township" CLOB, "County" CLOB, "Pop. ( 2010 ) " FLOAT, "Land ( sqmi ) " FLOAT, "Water ( sqmi ) " FLOAT, "Latitude" FLOAT, "Longitude" FLOAT, "GEO ID" FLOAT, "ANSI code" FLOAT)
| In what county is the latitude less than 46.935364 and GEO ID is 3801700500? | SELECT "County" FROM table_64734 WHERE "Latitude" < '46.935364' AND "GEO ID" = '3801700500' | SELECT "County" FROM "table_64734" WHERE "GEO ID" = '3801700500' AND "Latitude" < '46.935364' | 0.09082 |
CREATE TABLE table_42861 ("Television service" CLOB, "Country" CLOB, "Language" CLOB, "Content" CLOB, "HDTV" CLOB, "Package/Option" CLOB)
| What country has Tematico Content, and a package with sky TV and the Lei television service? | SELECT "Country" FROM table_42861 WHERE "Content" = 'tematico' AND "Package/Option" = 'sky tv' AND "Television service" = 'lei' | SELECT "Country" FROM "table_42861" WHERE "Content" = 'tematico' AND "Package/Option" = 'sky tv' AND "Television service" = 'lei' | 0.125977 |
CREATE TABLE table_11482 ("Year" FLOAT, "Chassis" CLOB, "Engine" CLOB, "Tyres" CLOB, "Points" FLOAT)
| Tell me the total number of points with chassis of tf103 | SELECT COUNT("Points") FROM table_11482 WHERE "Chassis" = 'tf103' | SELECT COUNT("Points") FROM "table_11482" WHERE "Chassis" = 'tf103' | 0.06543 |
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 lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE 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 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)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
| is the sao2 of patient 033-22108 second measured on the current intensive care unit visit greater than first measured on the current intensive care unit visit? | SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-22108') AND patient.unitdischargetime IS NULL) AND NOT vitalperiodic.sao2 IS NULL ORDER BY vitalperiodic.observationtime LIMIT 1 OFFSET 1) > (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-22108') AND patient.unitdischargetime IS NULL) AND NOT vitalperiodic.sao2 IS NULL ORDER BY vitalperiodic.observationtime LIMIT 1) | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '033-22108' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE "patient"."unitdischargetime" IS NULL AND NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid"), "_u_4" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_3" ON "_u_3"."" = "patient"."patienthealthsystemstayid" WHERE "patient"."unitdischargetime" IS NULL AND NOT "_u_3"."" IS NULL GROUP BY "patientunitstayid") SELECT (SELECT "vitalperiodic"."sao2" FROM "vitalperiodic" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "vitalperiodic"."patientunitstayid" WHERE NOT "_u_1"."" IS NULL AND NOT "vitalperiodic"."sao2" IS NULL ORDER BY "vitalperiodic"."observationtime" OFFSET 1 ROWS FETCH FIRST 1 ROWS ONLY) > (SELECT "vitalperiodic"."sao2" FROM "vitalperiodic" LEFT JOIN "_u_4" "_u_4" ON "_u_4"."" = "vitalperiodic"."patientunitstayid" WHERE NOT "_u_4"."" IS NULL AND NOT "vitalperiodic"."sao2" IS NULL ORDER BY "vitalperiodic"."observationtime" FETCH FIRST 1 ROWS ONLY) | 1.15625 |
CREATE TABLE table_name_51 (record VARCHAR2, finish VARCHAR2, year VARCHAR2, manager VARCHAR2)
| what is the record when the year is after 1992, manager is tom kotchman and finish is 2nd? | SELECT record FROM table_name_51 WHERE year > 1992 AND manager = "tom kotchman" AND finish = "2nd" | SELECT "record" FROM "table_name_51" WHERE "2nd" = "finish" AND "manager" = "tom kotchman" AND "year" > 1992 | 0.105469 |
CREATE TABLE table_7397 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Attendance" CLOB)
| How many weeks have l 3-17 as the result? | SELECT SUM("Week") FROM table_7397 WHERE "Result" = 'l 3-17' | SELECT SUM("Week") FROM "table_7397" WHERE "Result" = 'l 3-17' | 0.060547 |
CREATE TABLE table_25384 ("Player" CLOB, "Games Played" FLOAT, "Field Goals" FLOAT, "Three Pointers" FLOAT, "Free Throws" FLOAT, "Rebounds" FLOAT, "Assists" FLOAT, "Blocks" FLOAT, "Steals" FLOAT, "Points" FLOAT)
| Name the total number of player for 51 points | SELECT COUNT("Player") FROM table_25384 WHERE "Points" = '51' | SELECT COUNT("Player") FROM "table_25384" WHERE "Points" = '51' | 0.061523 |
CREATE TABLE claims_documents (claim_id NUMBER, document_type_code CLOB, created_by_staff_id NUMBER, created_date NUMBER)
CREATE TABLE claims_processing (claim_processing_id NUMBER, claim_id NUMBER, claim_outcome_code CLOB, claim_stage_id NUMBER, staff_id NUMBER)
CREATE TABLE claims_processing_stages (claim_stage_id NUMBER, next_claim_stage_id NUMBER, claim_status_name CLOB, claim_status_description CLOB)
CREATE TABLE claim_headers (claim_header_id NUMBER, claim_status_code CLOB, claim_type_code CLOB, policy_id NUMBER, date_of_claim TIME, date_of_settlement TIME, amount_claimed NUMBER, amount_piad NUMBER)
CREATE TABLE staff (staff_id NUMBER, staff_details CLOB)
CREATE TABLE policies (policy_id NUMBER, customer_id NUMBER, policy_type_code CLOB, start_date TIME, end_date TIME)
CREATE TABLE customers (customer_id NUMBER, customer_details CLOB)
| What is the name of the customer who has made the largest amount of claim in a single claim? | SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_claimed = (SELECT MAX(amount_claimed) FROM claim_headers) | SELECT "t3"."customer_details" FROM "claim_headers" "t1" JOIN "policies" "t2" ON "t1"."policy_id" = "t2"."policy_id" JOIN "customers" "t3" ON "t2"."customer_id" = "t3"."customer_id" WHERE "t1"."amount_claimed" = (SELECT MAX("amount_claimed") FROM "claim_headers") | 0.256836 |
CREATE TABLE table_name_66 (replaced_by VARCHAR2, outgoing_manager VARCHAR2)
| What is Replaced By, when Outgoing Manager is ' nal Karaman'? | SELECT replaced_by FROM table_name_66 WHERE outgoing_manager = "ünal karaman" | SELECT "replaced_by" FROM "table_name_66" WHERE "outgoing_manager" = "ünal karaman" | 0.081055 |
CREATE TABLE table_22883 ("Performer" CLOB, "Performances" FLOAT, "Category" CLOB, "First performance" CLOB, "Last performance" CLOB)
| what is the first performance of the last performance on 03/29/1957 | SELECT "First performance" FROM table_22883 WHERE "Last performance" = '03/29/1957' | SELECT "First performance" FROM "table_22883" WHERE "Last performance" = '03/29/1957' | 0.083008 |
CREATE TABLE table_74252 ("Date/Location" CLOB, "Mens singles" CLOB, "Womens Singles" CLOB, "U21 Mens" CLOB, "U21 Womens" CLOB, "Mixed Restricted" CLOB, "Mixed Veteran" CLOB)
| Who won the mixed restricted when Tomasz Rzeszotko won the mixed veteran and Karina Le Fevre won the U21 womens? | SELECT "Mixed Restricted" FROM table_74252 WHERE "Mixed Veteran" = 'Tomasz Rzeszotko' AND "U21 Womens" = 'Karina Le Fevre' | SELECT "Mixed Restricted" FROM "table_74252" WHERE "Mixed Veteran" = 'Tomasz Rzeszotko' AND "U21 Womens" = 'Karina Le Fevre' | 0.121094 |
CREATE TABLE table_name_64 (position VARCHAR2, pick__number VARCHAR2, overall VARCHAR2, round VARCHAR2)
| Which was the position for overall less than 254, round less than 5 and pick number less than 13? | SELECT position FROM table_name_64 WHERE overall < 254 AND round < 5 AND pick__number < 13 | SELECT "position" FROM "table_name_64" WHERE "overall" < 254 AND "pick__number" < 13 AND "round" < 5 | 0.097656 |
CREATE TABLE classroom (building CLOB, room_number CLOB, capacity NUMBER)
CREATE TABLE student (id CLOB, name CLOB, dept_name CLOB, tot_cred NUMBER)
CREATE TABLE teaches (id CLOB, course_id CLOB, sec_id CLOB, semester CLOB, year NUMBER)
CREATE TABLE takes (id CLOB, course_id CLOB, sec_id CLOB, semester CLOB, year NUMBER, grade CLOB)
CREATE TABLE instructor (id CLOB, name CLOB, dept_name CLOB, salary NUMBER)
CREATE TABLE section (course_id CLOB, sec_id CLOB, semester CLOB, year NUMBER, building CLOB, room_number CLOB, time_slot_id CLOB)
CREATE TABLE advisor (s_id CLOB, i_id CLOB)
CREATE TABLE course (course_id CLOB, title CLOB, dept_name CLOB, credits NUMBER)
CREATE TABLE time_slot (time_slot_id CLOB, day CLOB, start_hr NUMBER, start_min NUMBER, end_hr NUMBER, end_min NUMBER)
CREATE TABLE department (dept_name CLOB, building CLOB, budget NUMBER)
CREATE TABLE prereq (course_id CLOB, prereq_id CLOB)
| Find the total number of students and total number of instructors for each department. | SELECT COUNT(DISTINCT T2.id), COUNT(DISTINCT T3.id), T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name GROUP BY T3.dept_name | SELECT COUNT(DISTINCT "T2"."id"), COUNT(DISTINCT "T3"."id"), "T3"."dept_name" FROM "department" "T1" JOIN "student" "T2" ON "T1"."dept_name" = "T2"."dept_name" JOIN "instructor" "T3" ON "T1"."dept_name" = "T3"."dept_name" GROUP BY "T3"."dept_name" | 0.241211 |
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 ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
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 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 (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_prerequisite (pre_course_id NUMBER, course_id 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 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 instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
| Does CS offer any upper elective courses ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%ULCS%' | 0.205078 |
CREATE TABLE table_3059 ("Name of Award" CLOB, "Name of Film" CLOB, "Language" CLOB, "Awardee ( s ) " CLOB, "Cash Prize" CLOB)
| Name the total number of awardees for best screenplay | SELECT COUNT("Awardee(s)") FROM table_3059 WHERE "Name of Award" = 'Best Screenplay' | SELECT COUNT("Awardee(s)") FROM "table_3059" WHERE "Name of Award" = 'Best Screenplay' | 0.083984 |
CREATE TABLE table_13812785_8 (high_points VARCHAR2, date VARCHAR2)
| Who had the high points dated march 13? | SELECT high_points FROM table_13812785_8 WHERE date = "March 13" | SELECT "high_points" FROM "table_13812785_8" WHERE "March 13" = "date" | 0.068359 |
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 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 lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| provide the number of patients whose gender is m and ethnicity is hispanic or latino? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "HISPANIC OR LATINO" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "HISPANIC OR LATINO" = "demographic"."ethnicity" AND "M" = "demographic"."gender" | 0.152344 |
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE 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 allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime 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 diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
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 cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
| what are the three most frequently ordered procedures until 3 years ago? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 3 | WITH "t1" AS (SELECT "treatment"."treatmentname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "treatment" WHERE DATETIME("treatment"."treatmenttime") <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY "treatment"."treatmentname") SELECT "t1"."treatmentname" FROM "t1" "t1" WHERE "t1"."c1" <= 3 | 0.294922 |
CREATE TABLE table_63920 ("Club" CLOB, "Wins" FLOAT, "Losses" FLOAT, "Draws" FLOAT, "Against" FLOAT)
| what is the average wins when draws is less than 0? | SELECT AVG("Wins") FROM table_63920 WHERE "Draws" < '0' | SELECT AVG("Wins") FROM "table_63920" WHERE "Draws" < '0' | 0.055664 |
CREATE TABLE table_25320 ("Game" CLOB, "Date" CLOB, "Champion" CLOB, "Score" CLOB, "Runner Up" CLOB, "Stadium" CLOB, "City" CLOB, "Ted Morris Memorial Trophy ( Game MVP ) " CLOB, "Bruce Coulter Award" CLOB)
| Nam the total number for bruce coulter award for 9th game | SELECT COUNT("Bruce Coulter Award") FROM table_25320 WHERE "Game" = '9th' | SELECT COUNT("Bruce Coulter Award") FROM "table_25320" WHERE "Game" = '9th' | 0.073242 |
CREATE TABLE climber (Name VARCHAR2, Points VARCHAR2)
| List the names of climbers in descending order of points. | SELECT Name FROM climber ORDER BY Points DESC | SELECT "Name" FROM "climber" ORDER BY "Points" DESC | 0.049805 |
CREATE TABLE table_name_82 (position VARCHAR2, pick VARCHAR2, team VARCHAR2)
| What is the position of the player with a pick less than 3 from team san diego? | SELECT position FROM table_name_82 WHERE pick < 3 AND team = "san diego" | SELECT "position" FROM "table_name_82" WHERE "pick" < 3 AND "san diego" = "team" | 0.078125 |
CREATE TABLE table_name_93 (director VARCHAR2, title VARCHAR2)
| Who is the director of Last Window: The Secret of Cape West 3? | SELECT director FROM table_name_93 WHERE title = "last window: the secret of cape west 3" | SELECT "director" FROM "table_name_93" WHERE "last window: the secret of cape west 3" = "title" | 0.092773 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| Count the number of patients who died in or before year 2112 and used the drug named dextrose 50% | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.drug = "Dextrose 50%" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "Dextrose 50%" = "prescriptions"."drug" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "2112.0" >= "demographic"."dod_year" | 0.225586 |
CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB)
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)
| Give me a bar chart for the average of team id of each acc road, and rank ACC_Road from high to low order. | SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC | SELECT "ACC_Road", AVG("Team_ID") FROM "basketball_match" GROUP BY "ACC_Road" ORDER BY "ACC_Road" DESC | 0.099609 |
CREATE TABLE table_name_9 (total NUMBER, bronze VARCHAR2, gold VARCHAR2, silver VARCHAR2)
| What average total has a gold greater than 0, and a silver greater than 0, with a bronze greater than 2? | SELECT AVG(total) FROM table_name_9 WHERE gold > 0 AND silver > 0 AND bronze > 2 | SELECT AVG("total") FROM "table_name_9" WHERE "bronze" > 2 AND "gold" > 0 AND "silver" > 0 | 0.087891 |
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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| count the number of patients admitted before 2110 with the diagnoses of mitral valve disorders. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2110" AND diagnoses.long_title = "Mitral valve disorders" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Mitral valve disorders" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "2110" > "demographic"."admityear" | 0.227539 |
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
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 instructor (instructor_id NUMBER, name VARCHAR2, uniqname 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 offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id 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 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_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text 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)
| During the Spring term are any PreMajor or MDE courses offered ? | SELECT DISTINCT course.department, course.name, course.number, program_course.category FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category IN ('PreMajor', 'MDE') AND program_course.course_id = course.course_id AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester AND semester.year = 2016 GROUP BY course.department, course.number | SELECT DISTINCT "course"."department", "course"."name", "course"."number", "program_course"."category" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" IN ('PreMajor', 'MDE') JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'Spring' AND "semester"."year" = 2016 GROUP BY "course"."department", "course"."number" | 0.505859 |
CREATE TABLE film (Film_ID NUMBER, Rank_in_series NUMBER, Number_in_season NUMBER, Title CLOB, Directed_by CLOB, Original_air_date CLOB, Production_code CLOB)
CREATE TABLE cinema (Cinema_ID NUMBER, Name CLOB, Openning_year NUMBER, Capacity NUMBER, Location CLOB)
CREATE TABLE schedule (Cinema_ID NUMBER, Film_ID NUMBER, Date CLOB, Show_times_per_day NUMBER, Price FLOAT)
| For each record in schedule, show average of the price for each day in a bar chart, and could you order in ascending by the y-axis? | SELECT Date, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY AVG(Price) | SELECT "Date", AVG("Price") FROM "schedule" "T1" JOIN "film" "T2" ON "T1"."Film_ID" = "T2"."Film_ID" JOIN "cinema" "T3" ON "T1"."Cinema_ID" = "T3"."Cinema_ID" GROUP BY "Date" ORDER BY AVG("Price") | 0.191406 |
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 FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
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 PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE 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 ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
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 VoteTypes (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 PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
| SELECT * FROM Posts WHERE Id < 50. | SELECT * FROM Posts WHERE Id < 5000 | SELECT * FROM "Posts" WHERE "Id" < 5000 | 0.038086 |
CREATE TABLE table_19422 ("School Year" CLOB, "Class A" CLOB, "Class AA" CLOB, "Class AAA" CLOB, "Class AAAA" CLOB, "Class AAAAA" CLOB)
| Name the number of class aaaaa for 1988-89 | SELECT COUNT("Class AAAAA") FROM table_19422 WHERE "School Year" = '1988-89' | SELECT COUNT("Class AAAAA") FROM "table_19422" WHERE "School Year" = '1988-89' | 0.076172 |
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE d_icd_procedures (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 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_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value 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 icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_icd_diagnoses (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 microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod 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)
| what is the yearly maximum of the weight of patient 32168 until 4 years ago? | SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32168)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY STRFTIME('%y', chartevents.charttime) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 32168 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" = 'admit wt' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT MAX("chartevents"."valuenum") FROM "chartevents" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE DATETIME("chartevents"."charttime") <= DATETIME(CURRENT_TIME(), '-4 year') AND NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL GROUP BY STRFTIME('%y', "chartevents"."charttime") | 0.791016 |
CREATE TABLE table_name_96 (second VARCHAR2, third VARCHAR2)
| What is the name of the second who has Caroline Reed as third? | SELECT second FROM table_name_96 WHERE third = "caroline reed" | SELECT "second" FROM "table_name_96" WHERE "caroline reed" = "third" | 0.066406 |
CREATE TABLE table_name_3 (attendance NUMBER, week VARCHAR2)
| What's the lowest Attendance for a Week of 2? | SELECT MIN(attendance) FROM table_name_3 WHERE week = 2 | SELECT MIN("attendance") FROM "table_name_3" WHERE "week" = 2 | 0.05957 |
CREATE TABLE table_40865 ("Played" CLOB, "Wins" CLOB, "Losses" CLOB, "Tied" CLOB, "Win %" CLOB)
| Which win has a loss of IPL? | SELECT "Wins" FROM table_40865 WHERE "Losses" = 'ipl' | SELECT "Wins" FROM "table_40865" WHERE "Losses" = 'ipl' | 0.053711 |
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 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 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 diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
| when was the first time of hospital discharge of patient 027-107035 since 2105? | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '027-107035' AND STRFTIME('%y', patient.hospitaldischargetime) >= '2105' ORDER BY patient.hospitaldischargetime LIMIT 1 | SELECT "patient"."hospitaldischargetime" FROM "patient" WHERE "patient"."uniquepid" = '027-107035' AND STRFTIME('%y', "patient"."hospitaldischargetime") >= '2105' ORDER BY "patient"."hospitaldischargetime" FETCH FIRST 1 ROWS ONLY | 0.223633 |
CREATE TABLE table_1341453_40 (first_elected VARCHAR2, district VARCHAR2)
| When was Chaka Fattah first elected in the Pennsylvania 2 district? | SELECT first_elected FROM table_1341453_40 WHERE district = "Pennsylvania 2" | SELECT "first_elected" FROM "table_1341453_40" WHERE "Pennsylvania 2" = "district" | 0.080078 |
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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| what is maximum age of patients whose admission type is emergency and primary disease is angioedema? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "ANGIOEDEMA" | SELECT MAX("demographic"."age") FROM "demographic" WHERE "ANGIOEDEMA" = "demographic"."diagnosis" AND "EMERGENCY" = "demographic"."admission_type" | 0.142578 |
CREATE TABLE table_name_78 (team_nickname VARCHAR2, joined_tschl NUMBER)
| what is the team nickname that joined tschl after 2010? | SELECT team_nickname FROM table_name_78 WHERE joined_tschl > 2010 | SELECT "team_nickname" FROM "table_name_78" WHERE "joined_tschl" > 2010 | 0.069336 |
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code 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 class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
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 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 ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
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 date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
| what 's the earliest flight i can get between BOSTON and DALLAS | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.departure_time = (SELECT MIN(FLIGHTalias1.departure_time) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, flight AS FLIGHTalias1 WHERE CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'BOSTON' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'DALLAS' AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) | WITH "_u_0" AS (SELECT MIN("FLIGHTalias1"."departure_time") FROM "airport_service" "AIRPORT_SERVICEalias2" JOIN "city" "CITYalias2" ON "AIRPORT_SERVICEalias2"."city_code" = "CITYalias2"."city_code" AND "CITYalias2"."city_name" = 'BOSTON' JOIN "flight" "FLIGHTalias1" ON "AIRPORT_SERVICEalias2"."airport_code" = "FLIGHTalias1"."from_airport" JOIN "airport_service" "AIRPORT_SERVICEalias3" ON "AIRPORT_SERVICEalias3"."airport_code" = "FLIGHTalias1"."to_airport" JOIN "city" "CITYalias3" ON "AIRPORT_SERVICEalias3"."city_code" = "CITYalias3"."city_code" AND "CITYalias3"."city_name" = 'DALLAS') 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" = 'BOSTON' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "_u_0" "_u_0" ON "_u_0"."" = "flight"."departure_time" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'DALLAS' | 1.117188 |
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE d_icd_diagnoses (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 prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE 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 diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime 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 d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
| has there ever been any e 24 fe fs ng given to patient 2514 in 06/this year? | SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2514)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'e 24 fe fs ng' AND d_items.linksto = 'inputevents_cv') AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', inputevents_cv.charttime) = '06' | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 2514 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" = 'e 24 fe fs ng' AND "d_items"."linksto" = 'inputevents_cv' GROUP BY "itemid") SELECT COUNT(*) > 0 FROM "inputevents_cv" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "inputevents_cv"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "inputevents_cv"."itemid" WHERE DATETIME("inputevents_cv"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%m', "inputevents_cv"."charttime") = '06' | 0.830078 |
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 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)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| find the number of divorced patients who have blood gas lab test category. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab."CATEGORY" = "Blood Gas" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Blood Gas" = "lab"."CATEGORY" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "DIVORCED" = "demographic"."marital_status" | 0.204102 |
CREATE TABLE dorm (dorm_name VARCHAR2, dormid VARCHAR2)
CREATE TABLE student (stuid VARCHAR2, age NUMBER)
CREATE TABLE lives_in (stuid VARCHAR2, dormid VARCHAR2)
| Find the number of students who is older than 20 in each dorm. | SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name | SELECT COUNT(*), "T3"."dorm_name" FROM "student" "T1" JOIN "lives_in" "T2" ON "T1"."stuid" = "T2"."stuid" JOIN "dorm" "T3" ON "T2"."dormid" = "T3"."dormid" WHERE "T1"."age" > 20 GROUP BY "T3"."dorm_name" | 0.198242 |
CREATE TABLE table_31259 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "Production code" FLOAT)
| How many different pairs of writers wrote the episode with series number 56? | SELECT COUNT("Written by") FROM table_31259 WHERE "No. in series" = '56' | SELECT COUNT("Written by") FROM "table_31259" WHERE "No. in series" = '56' | 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 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 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)
| Give me the list of patients born before 2071 who prefer spanish. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.dob_year < "2071" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2071" > "demographic"."dob_year" AND "SPAN" = "demographic"."language" | 0.142578 |
CREATE TABLE table_name_73 (order_year VARCHAR2, fleet_series__quantity_ VARCHAR2)
| Which order year has a Fleet Series (Quantity) of 12081-12090 (10)? | SELECT order_year FROM table_name_73 WHERE fleet_series__quantity_ = "12081-12090 (10)" | SELECT "order_year" FROM "table_name_73" WHERE "12081-12090 (10)" = "fleet_series__quantity_" | 0.09082 |
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 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 intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
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 diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
| count how many times patient 032-12408 has received a digoxin procedure since 2105. | SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-12408')) AND treatment.treatmentname = 'digoxin' AND STRFTIME('%y', treatment.treatmenttime) >= '2105' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '032-12408' 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 COUNT(*) FROM "treatment" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "treatment"."patientunitstayid" WHERE "treatment"."treatmentname" = 'digoxin' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y', "treatment"."treatmenttime") >= '2105' | 0.574219 |
CREATE TABLE department (school_code VARCHAR2, dept_address VARCHAR2)
| How many different locations does each school have? | SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code | SELECT COUNT(DISTINCT "dept_address"), "school_code" FROM "department" GROUP BY "school_code" | 0.09082 |
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year 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 program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text 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 instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
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 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 program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip 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 requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
| What Winter term classes are there that are GTBOOKS ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'GTBOOKS' AND semester.semester = 'Winter' | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'Winter' WHERE "course"."department" = 'GTBOOKS' | 0.310547 |
CREATE TABLE table_name_81 (matches VARCHAR2, name VARCHAR2)
| What was the total amount of matches for Alan Shearer? | SELECT COUNT(matches) FROM table_name_81 WHERE name = "alan shearer" | SELECT COUNT("matches") FROM "table_name_81" WHERE "alan shearer" = "name" | 0.072266 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| let me know the death date of patient with patient id 3343. | SELECT demographic.dod FROM demographic WHERE demographic.subject_id = "3343" | SELECT "demographic"."dod" FROM "demographic" WHERE "3343" = "demographic"."subject_id" | 0.084961 |
Subsets and Splits