schema
stringlengths
29
5.42k
question
stringlengths
0
752
rejected
stringlengths
2
4.44k
chosen
stringlengths
4
8.94k
weight
float64
0
8.73
CREATE TABLE table_name_39 (year NUMBER, attendance VARCHAR2, runner_up VARCHAR2)
What is the sum of the years where the attendance was 95,000 and the runner-up was dresdner sc?
SELECT SUM(year) FROM table_name_39 WHERE attendance = "95,000" AND runner_up = "dresdner sc"
SELECT SUM("year") FROM "table_name_39" WHERE "95,000" = "attendance" AND "dresdner sc" = "runner_up"
0.098633
CREATE TABLE table_51277 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
What is the sum of Crowd when the away team scored 8.12 (60)?
SELECT SUM("Crowd") FROM table_51277 WHERE "Away team score" = '8.12 (60)'
SELECT SUM("Crowd") FROM "table_51277" WHERE "Away team score" = '8.12 (60)'
0.074219
CREATE TABLE table_69562 ("Year" FLOAT, "Team" CLOB, "Chassis" CLOB, "Engine" CLOB, "Points" FLOAT)
Which Team has a Year of 1978?
SELECT "Team" FROM table_69562 WHERE "Year" = '1978'
SELECT "Team" FROM "table_69562" WHERE "Year" = '1978'
0.052734
CREATE TABLE table_name_22 (date VARCHAR2, type VARCHAR2, number VARCHAR2)
Which Date has a Type of 4-6-0, and a Number larger than 11?
SELECT date FROM table_name_22 WHERE type = "4-6-0" AND number > 11
SELECT "date" FROM "table_name_22" WHERE "4-6-0" = "type" AND "number" > 11
0.073242
CREATE TABLE table_21653 ("Game" FLOAT, "Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Location" CLOB, "Attendance" FLOAT, "Record" CLOB, "Points" FLOAT)
What was the record when the opposing team was the Columbus Blue Jackets at St. Pete Times Forum?
SELECT "Record" FROM table_21653 WHERE "Location" = 'St. Pete Times Forum' AND "Opponent" = 'Columbus Blue Jackets'
SELECT "Record" FROM "table_21653" WHERE "Location" = 'St. Pete Times Forum' AND "Opponent" = 'Columbus Blue Jackets'
0.114258
CREATE TABLE department (Department_ID NUMBER, Name CLOB, Creation CLOB, Ranking NUMBER, Budget_in_Billions FLOAT, Num_Employees FLOAT) CREATE TABLE head (head_ID NUMBER, name CLOB, born_state CLOB, age FLOAT) CREATE TABLE management (department_ID NUMBER, head_ID NUMBER, temporary_acting CLOB)
Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes' Visualize by bar chart, list from high to low by the Y.
SELECT Name, AVG(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY AVG(Num_Employees) DESC
SELECT "Name", AVG("Num_Employees") FROM "department" "T1" JOIN "management" "T2" ON "T1"."department_ID" = "T2"."department_ID" AND "T2"."temporary_acting" = 'Yes' GROUP BY "Name" ORDER BY AVG("Num_Employees") DESC
0.209961
CREATE TABLE table_32918 ("Res." CLOB, "Record" CLOB, "Opponent" CLOB, "Method" CLOB, "Round" FLOAT, "Time" CLOB, "Location" CLOB)
What was the average round when he had a 3-0 record?
SELECT AVG("Round") FROM table_32918 WHERE "Record" = '3-0'
SELECT AVG("Round") FROM "table_32918" WHERE "Record" = '3-0'
0.05957
CREATE TABLE table_204_618 (id NUMBER, "place" NUMBER, "position" CLOB, "number" NUMBER, "name" CLOB, "nasl" NUMBER, "playoffs" NUMBER, "cfu club championship" NUMBER, "concacaf champions league" NUMBER, "total" NUMBER)
what number of names had 0 at the cfu club championship ?
SELECT COUNT("name") FROM table_204_618 WHERE "cfu club championship" = 0
SELECT COUNT("name") FROM "table_204_618" WHERE "cfu club championship" = 0
0.073242
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 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 days (days_code VARCHAR2, day_name VARCHAR2) 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 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 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 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 class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB) CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB) CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER) CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2) CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2) CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB) CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER) CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER) CREATE TABLE month (month_number NUMBER, month_name CLOB) CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER) CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2) CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER) CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2) CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB) CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
show me the airfare from PITTSBURGH to SAN FRANCISCO
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' 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
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" = 'PITTSBURGH' 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" = 'SAN FRANCISCO' JOIN "fare" ON "fare"."fare_id" = "flight_fare"."fare_id"
0.613281
CREATE TABLE table_name_16 (date VARCHAR2, record VARCHAR2)
What was the date of the game with a record of 17 25?
SELECT date FROM table_name_16 WHERE record = "17–25"
SELECT "date" FROM "table_name_16" WHERE "17–25" = "record"
0.057617
CREATE TABLE table_13403120_1 (writer_s_ VARCHAR2, prodcode VARCHAR2)
who is the writer of the episode with prod.code 30-17
SELECT writer_s_ FROM table_13403120_1 WHERE prodcode = "30-17"
SELECT "writer_s_" FROM "table_13403120_1" WHERE "30-17" = "prodcode"
0.067383
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 instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2) CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2) CREATE TABLE 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 semester (semester_id NUMBER, semester VARCHAR2, year NUMBER) 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 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 jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER) CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER) CREATE TABLE area (course_id NUMBER, area VARCHAR2) CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2) CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER) CREATE TABLE 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 ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
What upper-level courses does Bhargav Bhatt teach ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE instructor.name LIKE '%Bhargav Bhatt%' AND program_course.category LIKE 'ULCS'
SELECT DISTINCT "course"."department", "course"."name", "course"."number" 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" LIKE 'ULCS' JOIN "offering_instructor" ON "course_offering"."offering_id" = "offering_instructor"."offering_id" JOIN "instructor" ON "instructor"."instructor_id" = "offering_instructor"."instructor_id" AND "instructor"."name" LIKE '%Bhargav Bhatt%'
0.511719
CREATE TABLE table_7182 ("Television service" CLOB, "Country" CLOB, "Language" CLOB, "Content" CLOB, "HDTV" CLOB, "Package/Option" CLOB)
What is Content, when Package/Option is sky cinema, and when Language is italian originale?
SELECT "Content" FROM table_7182 WHERE "Package/Option" = 'sky cinema' AND "Language" = 'italian originale'
SELECT "Content" FROM "table_7182" WHERE "Language" = 'italian originale' AND "Package/Option" = 'sky cinema'
0.106445
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)
provide the number of patients whose gender is m and procedure long title is open heart valvuloplasty of mitral valve without replacement?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.long_title = "Open heart valvuloplasty of mitral valve without replacement"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Open heart valvuloplasty of mitral valve without replacement" = "procedures"."long_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "M" = "demographic"."gender"
0.261719
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE 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 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 vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
what are the three most frequently prescribed medications for patients also prescribed with polyethylene glycol 3350 17 gram oral powder packet at the same time, last year?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'polyethylene glycol 3350 17 gram oral powder packet' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE DATETIME(t1.drugstarttime) = DATETIME(t2.drugstarttime) GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 3
WITH "t2" AS (SELECT "patient"."uniquepid", "medication"."drugname", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" WHERE DATETIME("medication"."drugstarttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')), "t3" AS (SELECT "t2"."drugname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" "t2" ON "patient"."uniquepid" = "t2"."uniquepid" AND DATETIME("medication"."drugstarttime") = DATETIME("t2"."drugstarttime") WHERE "medication"."drugname" = 'polyethylene glycol 3350 17 gram oral powder packet' AND DATETIME("medication"."drugstarttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY "t2"."drugname") SELECT "t3"."drugname" FROM "t3" "t3" WHERE "t3"."c1" <= 3
0.901367
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label 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) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE d_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)
what was the last procedure time patient 25951 went through in this year?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25951) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY procedures_icd.charttime DESC LIMIT 1
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 25951 GROUP BY "hadm_id") SELECT "procedures_icd"."charttime" FROM "procedures_icd" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "procedures_icd"."hadm_id" WHERE DATETIME("procedures_icd"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_0"."" IS NULL ORDER BY "procedures_icd"."charttime" DESC FETCH FIRST 1 ROWS ONLY
0.446289
CREATE TABLE Ref_Shipping_Agents (shipping_agent_code VARCHAR2, shipping_agent_name VARCHAR2)
What is the shipping agent code of shipping agent UPS?
SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = "UPS"
SELECT "shipping_agent_code" FROM "Ref_Shipping_Agents" WHERE "UPS" = "shipping_agent_name"
0.088867
CREATE TABLE people (People_ID NUMBER, Sex CLOB, Name CLOB, Date_of_Birth CLOB, Height FLOAT, Weight FLOAT) CREATE TABLE candidate (Candidate_ID NUMBER, People_ID NUMBER, Poll_Source CLOB, Date CLOB, Support_rate FLOAT, Consider_rate FLOAT, Oppose_rate FLOAT, Unsure_rate FLOAT)
Show me the average of weight by sex in a histogram, and show by the Y-axis from low to high.
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight)
SELECT "Sex", AVG("Weight") FROM "people" GROUP BY "Sex" ORDER BY AVG("Weight")
0.077148
CREATE TABLE table_name_21 (tackles VARCHAR2, yards VARCHAR2, fumr VARCHAR2, totaltk VARCHAR2)
what is the total number of tackles when fumr is 0, totaltk is 54 and yards is less than 0?
SELECT COUNT(tackles) FROM table_name_21 WHERE fumr = 0 AND totaltk = 54 AND yards < 0
SELECT COUNT("tackles") FROM "table_name_21" WHERE "fumr" = 0 AND "totaltk" = 54 AND "yards" < 0
0.09375
CREATE TABLE table_25125 ("Series #" FLOAT, "Season #" FLOAT, "Episode title" CLOB, "Written by" CLOB, "Directed by" CLOB, "U.S. viewers ( millions ) " CLOB, "Original air date" CLOB)
How many written by have wendey stanzler as the director?
SELECT COUNT("Written by") FROM table_25125 WHERE "Directed by" = 'Wendey Stanzler'
SELECT COUNT("Written by") FROM "table_25125" WHERE "Directed by" = 'Wendey Stanzler'
0.083008
CREATE TABLE chip_model (model_name CLOB, launch_year NUMBER, ram_mib NUMBER, rom_mib NUMBER, slots CLOB, wifi CLOB, bluetooth CLOB) CREATE TABLE screen_mode (graphics_mode NUMBER, char_cells CLOB, pixels CLOB, hardware_colours NUMBER, used_kb NUMBER, map CLOB, type CLOB) CREATE TABLE phone (company_name CLOB, hardware_model_name CLOB, accreditation_type CLOB, accreditation_level CLOB, date CLOB, chip_model CLOB, screen_mode CLOB)
Find the pixels of the screen modes that are used by both phones with full accreditation types and phones with Provisional accreditation types.
SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.graphics_mode = t2.screen_mode WHERE t2.accreditation_type = 'Provisional' INTERSECT SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.graphics_mode = t2.screen_mode WHERE t2.accreditation_type = 'Full'
SELECT "t1"."pixels" FROM "screen_mode" "t1" JOIN "phone" "t2" ON "t1"."graphics_mode" = "t2"."screen_mode" AND "t2"."accreditation_type" = 'Provisional' INTERSECT SELECT "t1"."pixels" FROM "screen_mode" "t1" JOIN "phone" "t2" ON "t1"."graphics_mode" = "t2"."screen_mode" AND "t2"."accreditation_type" = 'Full'
0.302734
CREATE TABLE table_name_94 (f_laps VARCHAR2, wins VARCHAR2, points VARCHAR2, poles VARCHAR2)
What F/Laps listing has entries of n/a Points, 1 Poles, and 0 Wins?
SELECT f_laps FROM table_name_94 WHERE points = "n/a" AND poles = "1" AND wins = "0"
SELECT "f_laps" FROM "table_name_94" WHERE "0" = "wins" AND "1" = "poles" AND "n/a" = "points"
0.091797
CREATE TABLE table_name_92 (date VARCHAR2, opposing_team VARCHAR2)
What day was United States the opposing team?
SELECT date FROM table_name_92 WHERE opposing_team = "united states"
SELECT "date" FROM "table_name_92" WHERE "opposing_team" = "united states"
0.072266
CREATE TABLE table_name_7 (player VARCHAR2, school VARCHAR2)
what player went to ul-monroe
SELECT player FROM table_name_7 WHERE school = "ul-monroe"
SELECT "player" FROM "table_name_7" WHERE "school" = "ul-monroe"
0.0625
CREATE TABLE table_8870 ("Name" CLOB, "Nationality" CLOB, "Position" CLOB, "Crewe Alexandra career" CLOB, "Appearances" FLOAT, "Goals" FLOAT)
What is the position when the Crewe Alexandra career is 1988 1990, with 31 goals?
SELECT "Position" FROM table_8870 WHERE "Crewe Alexandra career" = '1988–1990' AND "Goals" = '31'
SELECT "Position" FROM "table_8870" WHERE "Crewe Alexandra career" = '1988–1990' AND "Goals" = '31'
0.09668
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 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 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) 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 lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
what was the last ct scan - without iv contrast time of patient 013-21980 until 2104?
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-21980')) AND treatment.treatmentname = 'ct scan - without iv contrast' AND STRFTIME('%y', treatment.treatmenttime) <= '2104' ORDER BY treatment.treatmenttime DESC LIMIT 1
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '013-21980' 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 "treatment"."treatmenttime" FROM "treatment" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "treatment"."patientunitstayid" WHERE "treatment"."treatmentname" = 'ct scan - without iv contrast' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y', "treatment"."treatmenttime") <= '2104' ORDER BY "treatment"."treatmenttime" DESC FETCH FIRST 1 ROWS ONLY
0.678711
CREATE TABLE table_14312 ("Year" FLOAT, "Entrant" CLOB, "Chassis" CLOB, "Engine" CLOB, "Points" FLOAT)
What is the latest year with less than 2 points, a Mclaren m28 chassis and an Entrant of l wenbr u team mclaren?
SELECT MAX("Year") FROM table_14312 WHERE "Points" < '2' AND "Chassis" = 'mclaren m28' AND "Entrant" = 'löwenbräu team mclaren'
SELECT MAX("Year") FROM "table_14312" WHERE "Chassis" = 'mclaren m28' AND "Entrant" = 'löwenbräu team mclaren' AND "Points" < '2'
0.125977
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) 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)
Count the number of patients who are single with a lab test name of c4.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "C4"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "C4" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "SINGLE" = "demographic"."marital_status"
0.192383
CREATE TABLE table_1341549_10 (district VARCHAR2, incumbent VARCHAR2)
Name the district of lawrence j. smith
SELECT district FROM table_1341549_10 WHERE incumbent = "Lawrence J. Smith"
SELECT "district" FROM "table_1341549_10" WHERE "Lawrence J. Smith" = "incumbent"
0.079102
CREATE TABLE table_7446 ("Position" FLOAT, "Team" CLOB, "Points" FLOAT, "Played" FLOAT, "Drawn" FLOAT, "Lost" FLOAT, "Against" FLOAT, "Difference" CLOB)
Which Position has a Difference of 5, and a Drawn smaller than 3?
SELECT MIN("Position") FROM table_7446 WHERE "Difference" = '5' AND "Drawn" < '3'
SELECT MIN("Position") FROM "table_7446" WHERE "Difference" = '5' AND "Drawn" < '3'
0.081055
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER) CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2) CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2) CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2) CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB) CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2) 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 compartment_class (compartment VARCHAR2, class_type 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 time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER) CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB) CREATE TABLE state (state_code CLOB, state_name CLOB, country_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 food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2) CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB) CREATE TABLE code_description (code VARCHAR2, description CLOB) CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB) CREATE TABLE month (month_number NUMBER, month_name 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 equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2) CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER) CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB) CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER) CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
show me the flights from DENVER to SAN FRANCISCO
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' 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" = 'DENVER' 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" = 'SAN FRANCISCO'
0.487305
CREATE TABLE table_6817 ("Sport" CLOB, "Record" CLOB, "Nation \\u2013 athlete ( s ) " CLOB, "Date" CLOB, "Time ( seconds ) " FLOAT)
What sport was played on November 14, 2009?
SELECT "Sport" FROM table_6817 WHERE "Date" = 'november 14, 2009'
SELECT "Sport" FROM "table_6817" WHERE "Date" = 'november 14, 2009'
0.06543
CREATE TABLE table_26200 ("Pick #" FLOAT, "CFL Team" CLOB, "Player" CLOB, "Position" CLOB, "School" CLOB)
How many different players got drafted for the Ottawa Renegades?
SELECT COUNT("Player") FROM table_26200 WHERE "CFL Team" = 'Ottawa Renegades'
SELECT COUNT("Player") FROM "table_26200" WHERE "CFL Team" = 'Ottawa Renegades'
0.077148
CREATE TABLE PersonFriend (name VARCHAR2, friend VARCHAR2, year NUMBER) CREATE TABLE Person (name VARCHAR2, age NUMBER, city CLOB, gender CLOB, job CLOB)
Draw a bar chart for what is average age of male for different job title?, and show Y in desc order.
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY AVG(age) DESC
SELECT "job", AVG("age") FROM "Person" WHERE "gender" = 'male' GROUP BY "job" ORDER BY AVG("age") DESC
0.099609
CREATE TABLE table_2001348_1 (revising_convention_s_ VARCHAR2, field VARCHAR2)
What was the revising convention of the field 'trimmers and stokers'?
SELECT revising_convention_s_ FROM table_2001348_1 WHERE field = "trimmers and stokers"
SELECT "revising_convention_s_" FROM "table_2001348_1" WHERE "field" = "trimmers and stokers"
0.09082
CREATE TABLE table_name_4 (away_team VARCHAR2, score VARCHAR2, attendance VARCHAR2)
What is the Away team at the game with a Score of 1 0 and Attendance of 1,791?
SELECT away_team FROM table_name_4 WHERE score = "1 – 0" AND attendance = "1,791"
SELECT "away_team" FROM "table_name_4" WHERE "1 – 0" = "score" AND "1,791" = "attendance"
0.086914
CREATE TABLE table_train_143 ("id" NUMBER, "gender" CLOB, "systolic_blood_pressure_sbp" NUMBER, "agitation" BOOLEAN, "npi" NUMBER, "aggression_domain" BOOLEAN, "delusions_hallucinations" BOOLEAN, "pulse_rate" NUMBER, "fridericia_corrected_qt_interval_qtcf" NUMBER, "diastolic_blood_pressure_dbp" NUMBER, "liver_disease" BOOLEAN, "hallucinations" BOOLEAN, "kidney_disease" BOOLEAN, "delusions" BOOLEAN, "respiratory_rate" NUMBER, "psychosis_subscale" BOOLEAN, "NOUSE" FLOAT)
have an npi score of >= 4 on either individual item ( delusions or hallucinations ) or >= 6 on the psychosis subscale ( combined delusions and hallucinations ) , or an npi score of >= 4 on agitation / aggression domain
SELECT * FROM table_train_143 WHERE (npi >= 4 AND (delusions = 1 OR hallucinations = 1)) OR (npi >= 6 AND psychosis_subscale = 1 AND delusions_hallucinations = 1) OR (npi >= 4 AND agitation = 1 OR aggression_domain = 1)
SELECT * FROM "table_train_143" WHERE "aggression_domain" = 1 OR ("agitation" = 1 AND "npi" >= 4) OR ("delusions_hallucinations" = 1 AND "npi" >= 6 AND "psychosis_subscale" = 1) OR (("delusions" = 1 OR "hallucinations" = 1) AND "npi" >= 4)
0.233398
CREATE TABLE writes (paperid NUMBER, authorid NUMBER) CREATE TABLE cite (citingpaperid NUMBER, citedpaperid NUMBER) CREATE TABLE keyphrase (keyphraseid NUMBER, keyphrasename VARCHAR2) CREATE TABLE field (fieldid NUMBER) CREATE TABLE venue (venueid NUMBER, venuename VARCHAR2) CREATE TABLE paperfield (fieldid NUMBER, paperid NUMBER) CREATE TABLE dataset (datasetid NUMBER, datasetname VARCHAR2) CREATE TABLE paperdataset (paperid NUMBER, datasetid NUMBER) CREATE TABLE paperkeyphrase (paperid NUMBER, keyphraseid NUMBER) CREATE TABLE journal (journalid NUMBER, journalname VARCHAR2) CREATE TABLE paper (paperid NUMBER, title VARCHAR2, venueid NUMBER, year NUMBER, numciting NUMBER, numcitedby NUMBER, journalid NUMBER) CREATE TABLE author (authorid NUMBER, authorname VARCHAR2)
What is the name of Ranjit Jhala 's Liquid Haskell paper ?
SELECT DISTINCT paper.title FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname LIKE 'Ranjit Jhala' AND keyphrase.keyphrasename = 'Liquid Haskell' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid AND writes.paperid = paper.paperid
SELECT DISTINCT "paper"."title" FROM "author" JOIN "keyphrase" ON "keyphrase"."keyphrasename" = 'Liquid Haskell' JOIN "paperkeyphrase" ON "keyphrase"."keyphraseid" = "paperkeyphrase"."keyphraseid" JOIN "writes" ON "author"."authorid" = "writes"."authorid" AND "paperkeyphrase"."paperid" = "writes"."paperid" JOIN "paper" ON "paper"."paperid" = "writes"."paperid" WHERE "author"."authorname" LIKE 'Ranjit Jhala'
0.400391
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 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 medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
when was patient 028-66126 for the last time leaving the hospital in 2104?
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '028-66126' AND STRFTIME('%y', patient.hospitaldischargetime) = '2104' ORDER BY patient.hospitaldischargetime DESC LIMIT 1
SELECT "patient"."hospitaldischargetime" FROM "patient" WHERE "patient"."uniquepid" = '028-66126' AND STRFTIME('%y', "patient"."hospitaldischargetime") = '2104' ORDER BY "patient"."hospitaldischargetime" DESC FETCH FIRST 1 ROWS ONLY
0.226563
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) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
what number of patients diagnosed with left femur fracture had procedure under procedure icd9 code 8848?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "LEFT FEMUR FRACTURE" AND procedures.icd9_code = "8848"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "8848" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "LEFT FEMUR FRACTURE" = "demographic"."diagnosis"
0.226563
CREATE TABLE table_name_93 (year VARCHAR2, league VARCHAR2, league_position VARCHAR2)
What year did the malaysia premier league get a position of 8/12?
SELECT year FROM table_name_93 WHERE league = "malaysia premier league" AND league_position = "8/12"
SELECT "year" FROM "table_name_93" WHERE "8/12" = "league_position" AND "league" = "malaysia premier league"
0.105469
CREATE TABLE table_name_83 (envelopment VARCHAR2, family VARCHAR2)
What is the envelopment for the rhabdoviridae family?
SELECT envelopment FROM table_name_83 WHERE family = "rhabdoviridae"
SELECT "envelopment" FROM "table_name_83" WHERE "family" = "rhabdoviridae"
0.072266
CREATE TABLE table_name_43 (ihsaa_class___football___soccer VARCHAR2, location VARCHAR2)
what is teh ihsaa class/football/soccer when the location is alexandria?
SELECT ihsaa_class___football___soccer FROM table_name_43 WHERE location = "alexandria"
SELECT "ihsaa_class___football___soccer" FROM "table_name_43" WHERE "alexandria" = "location"
0.09082
CREATE TABLE table_23403578_3 (no_in_series NUMBER, written_by VARCHAR2, no_in_season VARCHAR2)
What's the series number of the episode with a season number 5, written by Bernie Ancheta?
SELECT MIN(no_in_series) FROM table_23403578_3 WHERE written_by = "Bernie Ancheta" AND no_in_season = 5
SELECT MIN("no_in_series") FROM "table_23403578_3" WHERE "Bernie Ancheta" = "written_by" AND "no_in_season" = 5
0.108398
CREATE TABLE table_298550_1 (country_with_flag VARCHAR2, population__1_july_2005_est_ VARCHAR2)
What is every country with a flag with population of 11346670?
SELECT country_with_flag FROM table_298550_1 WHERE population__1_july_2005_est_ = 11346670
SELECT "country_with_flag" FROM "table_298550_1" WHERE "population__1_july_2005_est_" = 11346670
0.09375
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime 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 d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE 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 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 cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
get me the top four most frequently prescribed drugs for patients 60 or above during this year?
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 4
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."age" >= 60 GROUP BY "hadm_id"), "t1" AS (SELECT "prescriptions"."drug", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "prescriptions" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_0"."" IS NULL GROUP BY "prescriptions"."drug") SELECT "t1"."drug" FROM "t1" "t1" WHERE "t1"."c1" <= 4
0.509766
CREATE TABLE table_2259502_2 (opponents VARCHAR2, championship VARCHAR2)
Who were the opponents in the Tokyo championships?
SELECT opponents FROM table_2259502_2 WHERE championship = "Tokyo"
SELECT "opponents" FROM "table_2259502_2" WHERE "Tokyo" = "championship"
0.070313
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 ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) 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 PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) 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 ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostTags (PostId NUMBER, TagId 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 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 VoteTypes (Id NUMBER, Name 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 ReviewTaskResultTypes (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 PostTypes (Id NUMBER, Name CLOB) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
SELECT DisplayName, Reputation, Id FROM Users WHERE UPPER(Location) LIKE '%ISRAEL%' ORDER B.
SELECT DisplayName, Reputation, Id AS "user_link" FROM Users WHERE UPPER(Location) LIKE '%ISRAEL%' ORDER BY 2 DESC
SELECT "DisplayName", "Reputation", "Id" AS "user_link" FROM "Users" WHERE UPPER("Location") LIKE '%ISRAEL%' ORDER BY 2 DESC
0.121094
CREATE TABLE table_6413 ("Date" CLOB, "Visitor" CLOB, "Score" CLOB, "Home" CLOB, "Record" CLOB, "Attendance" FLOAT)
What is the score on october 7?
SELECT "Score" FROM table_6413 WHERE "Date" = 'october 7'
SELECT "Score" FROM "table_6413" WHERE "Date" = 'october 7'
0.057617
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 diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime 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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title 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 transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title 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 labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE procedures_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)
how many times on 02/10/2105 has patient 56201 produced chest tubes right pleural 1 output.
SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56201)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tubes right pleural 1' AND d_items.linksto = 'outputevents') AND STRFTIME('%y-%m-%d', outputevents.charttime) = '2105-02-10'
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 56201 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" = 'chest tubes right pleural 1' AND "d_items"."linksto" = 'outputevents' GROUP BY "itemid") SELECT COUNT(*) FROM "outputevents" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "outputevents"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "outputevents"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%y-%m-%d', "outputevents"."charttime") = '2105-02-10'
0.732422
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 d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_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 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 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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
when did patient 52604 first had the urine out foley output since 05/05/2101?
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52604)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine out foley' AND d_items.linksto = 'outputevents') AND STRFTIME('%y-%m-%d', outputevents.charttime) >= '2101-05-05' ORDER BY outputevents.charttime LIMIT 1
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 52604 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" = 'urine out foley' AND "d_items"."linksto" = 'outputevents' GROUP BY "itemid") SELECT "outputevents"."charttime" FROM "outputevents" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "outputevents"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "outputevents"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%y-%m-%d', "outputevents"."charttime") >= '2101-05-05' ORDER BY "outputevents"."charttime" FETCH FIRST 1 ROWS ONLY
0.797852
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE 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 cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
what time has patient 10211 first had an intake on the first intensive care unit visit?
SELECT inputevents_cv.charttime 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 = 10211) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) ORDER BY inputevents_cv.charttime LIMIT 1
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 10211 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 AND NOT "icustays"."outtime" IS NULL GROUP BY "icustay_id" ORDER BY "icustays"."intime" FETCH FIRST 1 ROWS ONLY) SELECT "inputevents_cv"."charttime" FROM "inputevents_cv" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "inputevents_cv"."icustay_id" WHERE NOT "_u_1"."" IS NULL ORDER BY "inputevents_cv"."charttime" FETCH FIRST 1 ROWS ONLY
0.585938
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 cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
was the fluticasone-salmeterol 250-50 mcg/dose in aepb prescribed to patient 035-2205 on their current hospital encounter?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2205' AND patient.hospitaldischargetime IS NULL)) AND medication.drugname = 'fluticasone-salmeterol 250-50 mcg/dose in aepb'
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."hospitaldischargetime" IS NULL AND "patient"."uniquepid" = '035-2205' 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(*) > 0 FROM "medication" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "medication"."patientunitstayid" WHERE "medication"."drugname" = 'fluticasone-salmeterol 250-50 mcg/dose in aepb' AND NOT "_u_1"."" IS NULL
0.601563
CREATE TABLE table_name_18 (muzzle_device VARCHAR2, barrel_twist VARCHAR2)
Name the muzzel device with barrel twist of 1:10
SELECT muzzle_device FROM table_name_18 WHERE barrel_twist = "1:10"
SELECT "muzzle_device" FROM "table_name_18" WHERE "1:10" = "barrel_twist"
0.071289
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 PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment 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 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 TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME) CREATE TABLE PostTypes (Id NUMBER, Name CLOB) CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
Hidden gems: Lowest viewed questions with score 5 or higher.
SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Score, ViewCount, Score * 1000 / ViewCount AS "Score per Thousand Views" FROM Posts WHERE Score >= 5 AND PostTypeId = 1 ORDER BY ViewCount LIMIT 1000
SELECT "Posts"."Id" AS "post_link", "Posts"."OwnerUserId" AS "user_link", "Score", "ViewCount", "Score" * 1000 / NULLIF("ViewCount", 0) AS "Score per Thousand Views" FROM "Posts" WHERE "PostTypeId" = 1 AND "Score" >= 5 ORDER BY "ViewCount" FETCH FIRST 1000 ROWS ONLY
0.259766
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 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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
count the number of patients whose ethnicity is hispanic or latino and diagnoses short title is crbl art ocl nos w infrc?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND diagnoses.short_title = "Crbl art ocl NOS w infrc"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Crbl art ocl NOS w infrc" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "HISPANIC OR LATINO" = "demographic"."ethnicity"
0.244141
CREATE TABLE table_name_70 (lost VARCHAR2, points VARCHAR2)
What is the number of lost with 2 points?
SELECT COUNT(lost) FROM table_name_70 WHERE points = 2
SELECT COUNT("lost") FROM "table_name_70" WHERE "points" = 2
0.058594
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 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 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 diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
what was patient 021-113379's first prescribed time for chlorhexidine (periogard) 0.12 % oral rinse 15 ml?
SELECT 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 = '021-113379')) AND medication.drugname = 'chlorhexidine (periogard) 0.12 % oral rinse 15 ml' ORDER BY medication.drugstarttime LIMIT 1
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '021-113379' 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 "medication"."drugstarttime" FROM "medication" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "medication"."patientunitstayid" WHERE "medication"."drugname" = 'chlorhexidine (periogard) 0.12 % oral rinse 15 ml' AND NOT "_u_1"."" IS NULL ORDER BY "medication"."drugstarttime" FETCH FIRST 1 ROWS ONLY
0.637695
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2) CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2) CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER) CREATE TABLE 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 employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER) CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
For all employees who have the letters D or S in their first name, give me the comparison about the sum of salary over the hire_date bin hire_date by weekday, sort total number of salary in descending order.
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(SALARY) DESC
SELECT "HIRE_DATE", SUM("SALARY") FROM "employees" WHERE "FIRST_NAME" LIKE '%D%' OR "FIRST_NAME" LIKE '%S%' ORDER BY SUM("SALARY") DESC
0.131836
CREATE TABLE table_train_186 ("id" NUMBER, "language" CLOB, "diabetic" CLOB, "regular_alcohol_intake" NUMBER, "allergy_to_drug" BOOLEAN, "alcohol_abuse" BOOLEAN, "age" FLOAT, "NOUSE" FLOAT)
age 16 _ 29
SELECT * FROM table_train_186 WHERE age >= 16 AND age <= 29
SELECT * FROM "table_train_186" WHERE "age" <= 29 AND "age" >= 16
0.063477
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE 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)
count the number of patients who are aged below 36 years with the lab test category hematology.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "36" AND lab."CATEGORY" = "Hematology"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Hematology" = "lab"."CATEGORY" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "36" > "demographic"."age"
0.188477
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2) CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2) CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER) CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER) CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2) CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2) CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2) CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2) CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2) CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2) CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2) CREATE TABLE area (course_id NUMBER, area VARCHAR2) CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER) CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER) CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER) CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_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)
I need an Film and Cinema Studies class that gives 11 credits , which ones do ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Film and Cinema Studies%' OR name LIKE '%Film and Cinema Studies%') AND credits = 11
SELECT DISTINCT "department", "name", "number" FROM "course" WHERE "credits" = 11 AND ("description" LIKE '%Film and Cinema Studies%' OR "name" LIKE '%Film and Cinema Studies%')
0.172852
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 PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other) CREATE TABLE FlagTypes (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 PostTypes (Id NUMBER, Name CLOB) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB) CREATE TABLE ReviewTaskTypes (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 PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description 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 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)
StackOverflow - Syria Top Users.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%vietnam%' OR UPPER(Location) LIKE '%vn%' ORDER BY Reputation DESC
SELECT ROW_NUMBER() OVER (ORDER BY "Reputation" DESC) AS "#", "Id" AS "user_link", "Reputation" FROM "Users" WHERE LOWER("Location") LIKE '%vietnam%' OR UPPER("Location") LIKE '%vn%' ORDER BY "Reputation" DESC
0.204102
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)
thank you for that information now i would like information on a flight on 4 16 from ATLANTA to PHILADELPHIA early in the morning
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 800) AND date_day.day_number = 16 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "date_day" ON "date_day"."day_number" = 16 AND "date_day"."month_number" = 4 AND "date_day"."year" = 1991 JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'ATLANTA' JOIN "days" ON "date_day"."day_name" = "days"."day_name" JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "days"."days_code" = "flight"."flight_days" AND "flight"."departure_time" <= 800 AND "flight"."departure_time" >= 0 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" = 'PHILADELPHIA'
0.768555
CREATE TABLE Course_Authors_and_Tutors (author_id NUMBER, author_tutor_ATB VARCHAR2, login_name VARCHAR2, password VARCHAR2, personal_name VARCHAR2, middle_name VARCHAR2, family_name VARCHAR2, gender_mf VARCHAR2, address_line_1 VARCHAR2) CREATE TABLE Subjects (subject_id NUMBER, subject_name VARCHAR2) CREATE TABLE Student_Tests_Taken (registration_id NUMBER, date_test_taken DATETIME, test_result VARCHAR2) CREATE TABLE Student_Course_Enrolment (registration_id NUMBER, student_id NUMBER, course_id NUMBER, date_of_enrolment DATETIME, date_of_completion DATETIME) CREATE TABLE Students (student_id NUMBER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR2, password VARCHAR2, personal_name VARCHAR2, middle_name VARCHAR2, family_name VARCHAR2) CREATE TABLE Courses (course_id NUMBER, author_id NUMBER, subject_id NUMBER, course_name VARCHAR2, course_description VARCHAR2)
How many enrolment students in each day? Return a bar chart binning date of enrolment by weekday, and list y axis from low to high order.
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment)
SELECT "date_of_enrolment", COUNT("date_of_enrolment") FROM "Student_Course_Enrolment" ORDER BY COUNT("date_of_enrolment")
0.119141
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE 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)
what is admission location and discharge location of subject name gonzalo wasson?
SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.name = "Gonzalo Wasson"
SELECT "demographic"."admission_location", "demographic"."discharge_location" FROM "demographic" WHERE "Gonzalo Wasson" = "demographic"."name"
0.138672
CREATE TABLE review (a_id NUMBER, u_id NUMBER, i_id NUMBER, rating NUMBER, rank NUMBER) CREATE TABLE item (i_id NUMBER, title CLOB) CREATE TABLE trust (source_u_id NUMBER, target_u_id NUMBER, trust NUMBER) CREATE TABLE useracct (u_id NUMBER, name CLOB)
List the titles of all items in alphabetic order .
SELECT title FROM item ORDER BY title
SELECT "title" FROM "item" ORDER BY "title"
0.041992
CREATE TABLE table_34230 ("Player" CLOB, "Rec." FLOAT, "Yards" FLOAT, "Avg." FLOAT, "Long" FLOAT)
How many yards did Davin Meggett have with more than 9 Rec.?
SELECT SUM("Yards") FROM table_34230 WHERE "Player" = 'davin meggett' AND "Rec." > '9'
SELECT SUM("Yards") FROM "table_34230" WHERE "Player" = 'davin meggett' AND "Rec." > '9'
0.085938
CREATE TABLE table_name_11 (date VARCHAR2, week VARCHAR2, opponent VARCHAR2)
What is the date for the game with an opponent of the Houston Oilers from before week 3?
SELECT date FROM table_name_11 WHERE week < 3 AND opponent = "houston oilers"
SELECT "date" FROM "table_name_11" WHERE "houston oilers" = "opponent" AND "week" < 3
0.083008
CREATE TABLE table_71500 ("Date" CLOB, "Visitor" CLOB, "Score" CLOB, "Home" CLOB, "Record" CLOB, "Attendance" FLOAT)
What was the average attendance when Chicago Bears were the home team?
SELECT AVG("Attendance") FROM table_71500 WHERE "Home" = 'chicago bears'
SELECT AVG("Attendance") FROM "table_71500" WHERE "Home" = 'chicago bears'
0.072266
CREATE TABLE table_name_82 (try_bonus VARCHAR2, tries_against VARCHAR2)
With 37 tries against, what is the try bonus?
SELECT try_bonus FROM table_name_82 WHERE tries_against = "37"
SELECT "try_bonus" FROM "table_name_82" WHERE "37" = "tries_against"
0.066406
CREATE TABLE gas_station (Station_ID NUMBER, Open_Year NUMBER, Location CLOB, Manager_Name CLOB, Vice_Manager_Name CLOB, Representative_Name CLOB) CREATE TABLE station_company (Station_ID NUMBER, Company_ID NUMBER, Rank_of_the_Year NUMBER) CREATE TABLE company (Company_ID NUMBER, Rank NUMBER, Company CLOB, Headquarters CLOB, Main_Industry CLOB, Sales_billion FLOAT, Profits_billion FLOAT, Assets_billion FLOAT, Market_Value FLOAT)
Show the number of companies without a gas station in each main industry with a bar chart, sort in desc by the X-axis.
SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE NOT Company_ID IN (SELECT Company_ID FROM station_company) GROUP BY Main_Industry ORDER BY Main_Industry DESC
SELECT "Main_Industry", COUNT("Main_Industry") FROM "company" WHERE NOT "Company_ID" IN (SELECT "Company_ID" FROM "station_company") GROUP BY "Main_Industry" ORDER BY "Main_Industry" DESC
0.182617
CREATE TABLE On_Call (Nurse NUMBER, BlockFloor NUMBER, BlockCode NUMBER, OnCallStart DATETIME, OnCallEnd DATETIME) CREATE TABLE Trained_In (Physician NUMBER, Treatment NUMBER, CertificationDate DATETIME, CertificationExpires DATETIME) CREATE TABLE Procedures (Code NUMBER, Name VARCHAR2, Cost FLOAT) CREATE TABLE Appointment (AppointmentID NUMBER, Patient NUMBER, PrepNurse NUMBER, Physician NUMBER, Start DATETIME, End DATETIME, ExaminationRoom CLOB) CREATE TABLE Prescribes (Physician NUMBER, Patient NUMBER, Medication NUMBER, Date DATETIME, Appointment NUMBER, Dose VARCHAR2) CREATE TABLE Affiliated_With (Physician NUMBER, Department NUMBER, PrimaryAffiliation BOOLEAN) CREATE TABLE Department (DepartmentID NUMBER, Name VARCHAR2, Head NUMBER) 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 Stay (StayID NUMBER, Patient NUMBER, Room NUMBER, StayStart DATETIME, StayEnd DATETIME) CREATE TABLE Physician (EmployeeID NUMBER, Name VARCHAR2, Position VARCHAR2, SSN NUMBER) CREATE TABLE Undergoes (Patient NUMBER, Procedures NUMBER, Stay NUMBER, DateUndergoes DATETIME, Physician NUMBER, AssistingNurse NUMBER) CREATE TABLE Medication (Code NUMBER, Name VARCHAR2, Brand VARCHAR2, Description VARCHAR2) CREATE TABLE Nurse (EmployeeID NUMBER, Name VARCHAR2, Position VARCHAR2, Registered BOOLEAN, SSN NUMBER) CREATE TABLE Block (BlockFloor NUMBER, BlockCode NUMBER)
Which physicians are trained in procedures that are more expensive than 5000, and count them by a bar chart, and list Name from high to low order please.
SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name ORDER BY T1.Name DESC
SELECT "T1"."Name", COUNT("T1"."Name") FROM "Physician" "T1" JOIN "Trained_In" "T2" ON "T1"."EmployeeID" = "T2"."Physician" JOIN "Procedures" "T3" ON "T2"."Treatment" = "T3"."Code" AND "T3"."Cost" > 5000 GROUP BY "T1"."Name" ORDER BY "T1"."Name" DESC
0.244141
CREATE TABLE Church (Open_Date NUMBER)
How many churches opened before 1850 are there?
SELECT COUNT(*) FROM Church WHERE Open_Date < 1850
SELECT COUNT(*) FROM "Church" WHERE "Open_Date" < 1850
0.052734
CREATE TABLE table_79992 ("Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Loss" CLOB, "Attendance" FLOAT, "Record" CLOB)
What was the attendance when the record was 77-54?
SELECT MIN("Attendance") FROM table_79992 WHERE "Record" = '77-54'
SELECT MIN("Attendance") FROM "table_79992" WHERE "Record" = '77-54'
0.066406
CREATE TABLE table_name_92 (total_wins NUMBER, number_of_clubs VARCHAR2, season VARCHAR2, runners_up VARCHAR2)
What is the lowest total number of wins in a season before 1989 with tianjin as the runners-up and more than 8 clubs?
SELECT MIN(total_wins) FROM table_name_92 WHERE season < 1989 AND runners_up = "tianjin" AND number_of_clubs > 8
SELECT MIN("total_wins") FROM "table_name_92" WHERE "number_of_clubs" > 8 AND "runners_up" = "tianjin" AND "season" < 1989
0.119141
CREATE TABLE appellations (No NUMBER, Appelation CLOB, County CLOB, State CLOB, Area CLOB, isAVA CLOB) CREATE TABLE wine (No NUMBER, Grape CLOB, Winery CLOB, Appelation CLOB, State CLOB, Name CLOB, Year NUMBER, Price NUMBER, Score NUMBER, Cases NUMBER, Drink CLOB) CREATE TABLE grapes (ID NUMBER, Grape CLOB, Color CLOB)
What are the countries for applications with at most 3 wines? Return the result in a bar chart, and could you display County in ascending order?
SELECT County, COUNT(County) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation GROUP BY County ORDER BY County
SELECT "County", COUNT("County") FROM "appellations" "T1" JOIN "wine" "T2" ON "T1"."Appelation" = "T2"."Appelation" GROUP BY "County" ORDER BY "County"
0.147461
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) 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)
give me the number of patients whose item id is 50953?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50953"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "50953" = "lab"."itemid" AND "demographic"."hadm_id" = "lab"."hadm_id"
0.149414
CREATE TABLE table_16639 ("Rd." FLOAT, "Grand Prix" CLOB, "Pole Position" CLOB, "Fastest Lap" CLOB, "Winning Driver" CLOB, "Constructor" CLOB, "Report" CLOB)
What number is the Canadian Grand Prix on the list?
SELECT "Rd." FROM table_16639 WHERE "Grand Prix" = 'Canadian Grand Prix'
SELECT "Rd." FROM "table_16639" WHERE "Grand Prix" = 'Canadian Grand Prix'
0.072266
CREATE TABLE table_204_859 (id NUMBER, "year" NUMBER, "seniors ( trood award & rodda medal ) " CLOB, "reserves ( rex hartley medal ) " CLOB, "under 18's ( bruce wilkinson medal ) " CLOB, "under 16's ( shaw/carter medal ) " CLOB)
how many different people were reserves before tom hart ?
SELECT COUNT(DISTINCT "reserves (rex hartley medal)") FROM table_204_859 WHERE "year" < (SELECT "year" FROM table_204_859 WHERE "reserves (rex hartley medal)" = 'tom hart')
SELECT COUNT(DISTINCT "reserves (rex hartley medal)") FROM "table_204_859" WHERE "year" < (SELECT "year" FROM "table_204_859" WHERE "reserves (rex hartley medal)" = 'tom hart')
0.171875
CREATE TABLE basketball_match (Team_ID NUMBER, School_ID NUMBER, Team_Name CLOB, ACC_Regular_Season CLOB, ACC_Percent CLOB, ACC_Home CLOB, ACC_Road CLOB, All_Games CLOB, All_Games_Percent NUMBER, All_Home CLOB, All_Road CLOB, All_Neutral CLOB) CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB)
Visualize a bar chart about the distribution of Team_Name and All_Games_Percent , order by the x axis from high to low.
SELECT Team_Name, All_Games_Percent FROM basketball_match ORDER BY Team_Name DESC
SELECT "Team_Name", "All_Games_Percent" FROM "basketball_match" ORDER BY "Team_Name" DESC
0.086914
CREATE TABLE table_29086 ("Round #" CLOB, "Home Team" CLOB, "Win/Loss" CLOB, "Score" CLOB, "Opposition" CLOB, "Location" CLOB)
What was the score in round 7?
SELECT "Score" FROM table_29086 WHERE "Round #" = 'Round 7'
SELECT "Score" FROM "table_29086" WHERE "Round #" = 'Round 7'
0.05957
CREATE TABLE table_name_43 (joined NUMBER, division VARCHAR2, location VARCHAR2)
What was the most recent year that a team located in Highland Township and a member of the West Division joined the Kensington Lakes Activities Association?
SELECT MAX(joined) FROM table_name_43 WHERE division = "west" AND location = "highland township"
SELECT MAX("joined") FROM "table_name_43" WHERE "division" = "west" AND "highland township" = "location"
0.101563
CREATE TABLE table_59140 ("Statistic" CLOB, "Name" CLOB, "Total" CLOB, "School" CLOB, "Opponent" CLOB, "Stage" CLOB)
When the opposing team was CSB UPHDS what was the total?
SELECT "Total" FROM table_59140 WHERE "Opponent" = 'csb uphds'
SELECT "Total" FROM "table_59140" WHERE "Opponent" = 'csb uphds'
0.0625
CREATE TABLE table_train_130 ("id" NUMBER, "gender" CLOB, "systolic_blood_pressure_sbp" NUMBER, "right_bundle_branch_block" BOOLEAN, "space_occupying_cerebral_lesion" BOOLEAN, "huntington_disease" BOOLEAN, "psychiatric_disease" BOOLEAN, "mental_illness" BOOLEAN, "treatment_regimen" BOOLEAN, "psychotic_disorder" BOOLEAN, "diastolic_blood_pressure_dbp" NUMBER, "bipolar_disorder" BOOLEAN, "serum_creatinine" FLOAT, "seizure_disorder" BOOLEAN, "vascular_dementia" BOOLEAN, "parkinson_disease" BOOLEAN, "normal_pressure_hydrocephalus" BOOLEAN, "significant_neurological_disease" BOOLEAN, "ad" BOOLEAN, "ninds_airen_criteria" BOOLEAN, "hypertension" BOOLEAN, "bilirubin" FLOAT, "major_depression" BOOLEAN, "NOUSE" FLOAT)
blood pressure greater than 160 / 100 mmhg. subjects with elevated bp will be allowed at the discretion of the principal investigator. individuals with hypertension must have been stabilized to the current treatment regimen for at least 6 weeks prior to screening and not need adjustments to their treatment regimen during the entire study period.
SELECT * FROM table_train_130 WHERE systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 100 OR hypertension = 1 OR treatment_regimen = 1
SELECT * FROM "table_train_130" WHERE "diastolic_blood_pressure_dbp" > 100 OR "hypertension" = 1 OR "systolic_blood_pressure_sbp" > 160 OR "treatment_regimen" = 1
0.158203
CREATE TABLE table_60993 ("Season" CLOB, "LKF Cup" CLOB, "Regional Competitions" CLOB, "Europe" CLOB, "Head Coach" CLOB)
WHAT IS THE LKF CUP WITH euroleague group stage AND bbl elite division finalist?
SELECT "LKF Cup" FROM table_60993 WHERE "Europe" = 'euroleague group stage' AND "Regional Competitions" = 'bbl elite division finalist'
SELECT "LKF Cup" FROM "table_60993" WHERE "Europe" = 'euroleague group stage' AND "Regional Competitions" = 'bbl elite division finalist'
0.133789
CREATE TABLE table_73586 ("Tournament" CLOB, "Games played" FLOAT, "Points per game" CLOB, "Rebounds per game" CLOB, "Assists per game" CLOB)
How many assists per game in the tournament 2010 fiba world championship?
SELECT "Assists per game" FROM table_73586 WHERE "Tournament" = '2010 FIBA World Championship'
SELECT "Assists per game" FROM "table_73586" WHERE "Tournament" = '2010 FIBA World Championship'
0.09375
CREATE TABLE basketball_match (Team_ID NUMBER, School_ID NUMBER, Team_Name CLOB, ACC_Regular_Season CLOB, ACC_Percent CLOB, ACC_Home CLOB, ACC_Road CLOB, All_Games CLOB, All_Games_Percent NUMBER, All_Home CLOB, All_Road CLOB, All_Neutral CLOB) CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB)
A bar chart shows the distribution of ACC_Road and Team_ID , and group by attribute ACC_Home, and list x axis from high to low order.
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC
SELECT "ACC_Road", "Team_ID" FROM "basketball_match" GROUP BY "ACC_Home", "ACC_Road" ORDER BY "ACC_Road" DESC
0.106445
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
give me the number of black/cape verdean patients who have procedure icd9 code 3806.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.icd9_code = "3806"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "3806" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "BLACK/CAPE VERDEAN" = "demographic"."ethnicity"
0.225586
CREATE TABLE table_47356 ("Date" CLOB, "Time" CLOB, "Opponent" CLOB, "Location" CLOB, "Score" CLOB)
Who was the opposing team in the game(s) that started at 7:30pm?
SELECT "Opponent" FROM table_47356 WHERE "Time" = '7:30pm'
SELECT "Opponent" FROM "table_47356" WHERE "Time" = '7:30pm'
0.058594
CREATE TABLE table_35175 ("Name" CLOB, "Team" CLOB, "Qual 1" CLOB, "Qual 2" CLOB, "Best" CLOB)
What did Alex Tagliani get for Qual 1?
SELECT "Qual 1" FROM table_35175 WHERE "Name" = 'alex tagliani'
SELECT "Qual 1" FROM "table_35175" WHERE "Name" = 'alex tagliani'
0.063477
CREATE TABLE table_train_120 ("id" NUMBER, "residual_neurologic_impairment" BOOLEAN, "mini_mental_state_examination_mmse" NUMBER, "systolic_blood_pressure_sbp" NUMBER, "memory_impairments" BOOLEAN, "progressive_neurologic_disease" BOOLEAN, "epilepsy" BOOLEAN, "head_injury" BOOLEAN, "stroke" BOOLEAN, "multiple_sclerosis" BOOLEAN, "dementia" BOOLEAN, "diastolic_blood_pressure_dbp" NUMBER, "heart_rate" NUMBER, "intracranial_brain_lesions" BOOLEAN, "neurological_disease" BOOLEAN, "ad" BOOLEAN, "neurosurgery" BOOLEAN, "hypertension" BOOLEAN, "clinical_dementia_rating_cdr" FLOAT, "NOUSE" FLOAT)
heart rates < 35 or > 125 beats per minute ( bpm ) at screening
SELECT * FROM table_train_120 WHERE heart_rate < 35 OR heart_rate > 125
SELECT * FROM "table_train_120" WHERE "heart_rate" < 35 OR "heart_rate" > 125
0.075195
CREATE TABLE table_56475 ("Navy" CLOB, "Name" CLOB, "Pennant" CLOB, "Commissioned" FLOAT, "Home port" CLOB)
What is the navy for middleton with a home port of portsmouth after 1983?
SELECT "Navy" FROM table_56475 WHERE "Home port" = 'portsmouth' AND "Commissioned" > '1983' AND "Name" = 'middleton'
SELECT "Navy" FROM "table_56475" WHERE "Commissioned" > '1983' AND "Home port" = 'portsmouth' AND "Name" = 'middleton'
0.115234
CREATE TABLE table_29224 ("Pick #" FLOAT, "CFL Team" CLOB, "Player" CLOB, "Position" CLOB, "College" CLOB)
What player drafted was an OG?
SELECT "Player" FROM table_29224 WHERE "Position" = 'OG'
SELECT "Player" FROM "table_29224" WHERE "Position" = 'OG'
0.056641
CREATE TABLE table_name_64 (website VARCHAR2, frequency VARCHAR2, city_of_license VARCHAR2, webcast VARCHAR2)
Which website includes a webcast of listen live, a frequency under 1050, and is licensed in the city of Monterrey?
SELECT website FROM table_name_64 WHERE city_of_license = "monterrey" AND webcast = "listen live" AND frequency < 1050
SELECT "website" FROM "table_name_64" WHERE "city_of_license" = "monterrey" AND "frequency" < 1050 AND "listen live" = "webcast"
0.125
CREATE TABLE table_45080 ("Pick #" FLOAT, "Brand ( to ) " CLOB, "Employee ( Real name ) " CLOB, "Role" CLOB, "Brand ( from ) " CLOB)
what is the employee (real name) when the pick # is higher than 10 and the brand (to) is raw?
SELECT "Employee (Real name)" FROM table_45080 WHERE "Pick #" > '10' AND "Brand (to)" = 'raw'
SELECT "Employee (Real name)" FROM "table_45080" WHERE "Brand (to)" = 'raw' AND "Pick #" > '10'
0.092773
CREATE TABLE addresses (address_id NUMBER, line_1_number_building CLOB, city CLOB, zip_postcode CLOB, state_province_county CLOB, country CLOB) CREATE TABLE vehicles (vehicle_id NUMBER, vehicle_details CLOB) CREATE TABLE lessons (lesson_id NUMBER, customer_id NUMBER, lesson_status_code CLOB, staff_id NUMBER, vehicle_id NUMBER, lesson_date TIME, lesson_time CLOB, price NUMBER) CREATE TABLE customers (customer_id NUMBER, customer_address_id NUMBER, customer_status_code CLOB, date_became_customer TIME, date_of_birth TIME, first_name CLOB, last_name CLOB, amount_outstanding NUMBER, email_address CLOB, phone_number CLOB, cell_mobile_phone_number CLOB) CREATE TABLE staff (staff_id NUMBER, staff_address_id NUMBER, nickname CLOB, first_name CLOB, middle_name CLOB, last_name CLOB, date_of_birth TIME, date_joined_staff TIME, date_left_staff TIME) CREATE TABLE customer_payments (customer_id NUMBER, datetime_payment TIME, payment_method_code CLOB, amount_payment NUMBER)
List the first name and last name of customers have the amount of outstanding between 1000 and 3000.
SELECT first_name, last_name FROM customers WHERE amount_outstanding BETWEEN 1000 AND 3000
SELECT "first_name", "last_name" FROM "customers" WHERE "amount_outstanding" <= 3000 AND "amount_outstanding" >= 1000
0.114258
CREATE TABLE table_204_255 (id NUMBER, "constituency number" NUMBER, "name" CLOB, "reserved for ( sc/st/none ) " CLOB, "district" CLOB, "number of electorates ( 2009 ) " NUMBER)
besides tikamgarth , what is the other district ?
SELECT "district" FROM table_204_255 WHERE "district" <> 'tikamgarh' AND agg = 0
SELECT "district" FROM "table_204_255" WHERE "agg" = 0 AND "district" <> 'tikamgarh'
0.082031
CREATE TABLE table_16952 ("Date" CLOB, "Tournament" CLOB, "Location" CLOB, "Purse ( $ ) " FLOAT, "Winner" CLOB, "Score" CLOB, "1st Prize ( $ ) " FLOAT)
Where was the GTE Suncoast Classic tournament held?
SELECT "Location" FROM table_16952 WHERE "Tournament" = 'GTE Suncoast Classic'
SELECT "Location" FROM "table_16952" WHERE "Tournament" = 'GTE Suncoast Classic'
0.078125
CREATE TABLE table_1805191_10 (incumbent VARCHAR2, party VARCHAR2, district VARCHAR2)
Who is the incumbent democratic party in district florida 11?
SELECT incumbent FROM table_1805191_10 WHERE party = "Democratic" AND district = "Florida 11"
SELECT "incumbent" FROM "table_1805191_10" WHERE "Democratic" = "party" AND "Florida 11" = "district"
0.098633