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 Projects (Project_ID NUMBER, Project_Details VARCHAR2)
CREATE TABLE Documents_with_Expenses (Document_ID NUMBER, Budget_Type_Code CHAR, Document_Details VARCHAR2)
CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR, Document_Type_Name VARCHAR2, Document_Type_Description VARCHAR2)
CREATE TABLE Documents (Document_ID NUMBER, Document_Type_Code CHAR, Project_ID NUMBER, Document_Date DATETIME, Document_Name VARCHAR2, Document_Description VARCHAR2, Other_Details VARCHAR2)
CREATE TABLE Accounts (Account_ID NUMBER, Statement_ID NUMBER, Account_Details VARCHAR2)
CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR, Budget_Type_Description VARCHAR2)
CREATE TABLE Statements (Statement_ID NUMBER, Statement_Details VARCHAR2)
| Show me a bar chart for what is the project id and detail for the project with at least two documents?, sort in ascending by the X-axis. | SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID ORDER BY T1.Project_Details | SELECT "T1"."Project_Details", "T1"."Project_ID" FROM "Projects" "T1" JOIN "Documents" "T2" ON "T1"."Project_ID" = "T2"."Project_ID" ORDER BY "T1"."Project_Details" | 0.160156 |
CREATE TABLE table_77910 ("Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Loss" CLOB, "Attendance" FLOAT, "Record" CLOB)
| Name the score when the opponent was the dodgers on april 21 | SELECT "Score" FROM table_77910 WHERE "Opponent" = 'dodgers' AND "Date" = 'april 21' | SELECT "Score" FROM "table_77910" WHERE "Date" = 'april 21' AND "Opponent" = 'dodgers' | 0.083984 |
CREATE TABLE table_23242968_1 (directed_by VARCHAR2, us_viewers__millions_ VARCHAR2)
| Who directed the episode that had 6.76 million U.S. viewers? | SELECT directed_by FROM table_23242968_1 WHERE us_viewers__millions_ = "6.76" | SELECT "directed_by" FROM "table_23242968_1" WHERE "6.76" = "us_viewers__millions_" | 0.081055 |
CREATE TABLE table_21463 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
| Name the high assists for l 93 103 (ot) | SELECT "High assists" FROM table_21463 WHERE "Score" = 'L 93–103 (OT)' | SELECT "High assists" FROM "table_21463" WHERE "Score" = 'L 93–103 (OT)' | 0.070313 |
CREATE TABLE table_203_694 (id NUMBER, "#" NUMBER, "name" CLOB, "took office" CLOB, "left office" CLOB, "party" CLOB)
| which party had the most prime ministers ? | SELECT "party" FROM table_203_694 GROUP BY "party" ORDER BY COUNT("name") DESC LIMIT 1 | SELECT "party" FROM "table_203_694" GROUP BY "party" ORDER BY COUNT("name") DESC FETCH FIRST 1 ROWS ONLY | 0.101563 |
CREATE TABLE table_12144 ("Year" FLOAT, "Title" CLOB, "Format/genre" CLOB, "Role" CLOB, "Staged by" CLOB)
| What is the title of the work where the role was Molly O'Day? | SELECT "Title" FROM table_12144 WHERE "Role" = 'molly o''day' | SELECT "Title" FROM "table_12144" WHERE "Role" = 'molly o''day' | 0.061523 |
CREATE TABLE table_61445 ("Tournament" CLOB, "2008" CLOB, "2009" CLOB, "2010" CLOB, "2011" CLOB, "2012" CLOB)
| What is the 2009 value of the shanghai masters, which was A in 2012 and 1r in 2011? | SELECT "2009" FROM table_61445 WHERE "2012" = 'a' AND "2011" = '1r' AND "Tournament" = 'shanghai masters' | SELECT "2009" FROM "table_61445" WHERE "2011" = '1r' AND "2012" = 'a' AND "Tournament" = 'shanghai masters' | 0.104492 |
CREATE TABLE station (Station_ID NUMBER, Name CLOB, Annual_entry_exit FLOAT, Annual_interchanges FLOAT, Total_Passengers FLOAT, Location CLOB, Main_Services CLOB, Number_of_Platforms NUMBER)
CREATE TABLE train_station (Train_ID NUMBER, Station_ID NUMBER)
CREATE TABLE train (Train_ID NUMBER, Name CLOB, Time CLOB, Service CLOB)
| Give me a bar chart about the number of platforms in different locations, rank from low to high by the bars. | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location | SELECT "Location", SUM("Number_of_Platforms") FROM "station" GROUP BY "Location" ORDER BY "Location" | 0.097656 |
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 diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
| what were the four most frequent prescription drugs for patients who were also prescribed keppra at the same time until 2103? | 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 = 'keppra' AND STRFTIME('%y', medication.drugstarttime) <= '2103') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', medication.drugstarttime) <= '2103') AS t2 ON t1.uniquepid = t2.uniquepid WHERE DATETIME(t1.drugstarttime) = DATETIME(t2.drugstarttime) GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 4 | WITH "t2" AS (SELECT "patient"."uniquepid", "medication"."drugname", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" WHERE STRFTIME('%y', "medication"."drugstarttime") <= '2103'), "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" = 'keppra' AND STRFTIME('%y', "medication"."drugstarttime") <= '2103' GROUP BY "t2"."drugname") SELECT "t3"."drugname" FROM "t3" "t3" WHERE "t3"."c1" <= 4 | 0.748047 |
CREATE TABLE table_name_34 (unfavorable NUMBER, no_opinion VARCHAR2, favorable VARCHAR2, date VARCHAR2)
| What is the most unfavorable that is favorable of 34 during 1953 August and has a no opinion score larger than 24? | SELECT MAX(unfavorable) FROM table_name_34 WHERE favorable = 34 AND date = "1953 august" AND no_opinion > 24 | SELECT MAX("unfavorable") FROM "table_name_34" WHERE "1953 august" = "date" AND "favorable" = 34 AND "no_opinion" > 24 | 0.115234 |
CREATE TABLE table_203_805 (id NUMBER, "year" NUMBER, "player" CLOB, "position" CLOB, "high school" CLOB, "college" CLOB)
| who is next to tony fisher in ascending order ? | SELECT "player" FROM table_203_805 WHERE id = (SELECT id FROM table_203_805 WHERE "player" = 'tony fisher') + 1 | SELECT "player" FROM "table_203_805" WHERE "id" = (SELECT "id" FROM "table_203_805" WHERE "player" = 'tony fisher') + 1 | 0.116211 |
CREATE TABLE table_203_83 (id NUMBER, "ranking" NUMBER, "company" CLOB, "industry" CLOB, "revenue ( usd billions ) " CLOB, "fy" CLOB, "capitalization ( usd billions ) " CLOB, "employees" NUMBER, "listing" CLOB, "headquarters" CLOB, "ceo" CLOB)
| which company is ranked at the top with the largest revenue ? | SELECT "company" FROM table_203_83 ORDER BY "revenue (usd billions)" DESC LIMIT 1 | SELECT "company" FROM "table_203_83" ORDER BY "revenue (usd billions)" DESC FETCH FIRST 1 ROWS ONLY | 0.09668 |
CREATE TABLE table_52746 ("Date" CLOB, "Visiting Team" CLOB, "Final Score" CLOB, "Host Team" CLOB, "Stadium" CLOB)
| What was the final score in the game against the Cincinnati Bengals? | SELECT "Final Score" FROM table_52746 WHERE "Visiting Team" = 'cincinnati bengals' | SELECT "Final Score" FROM "table_52746" WHERE "Visiting Team" = 'cincinnati bengals' | 0.082031 |
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 allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE 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 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
| what was the top four most frequent specimen tests given to patients within the same month after diagnosis of valvular insufficiency - aortic valve? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valvular insufficiency - aortic valve') AS t1 JOIN (SELECT patient.uniquepid, microlab.culturesite, microlab.culturetakentime FROM microlab JOIN patient ON microlab.patientunitstayid = patient.patientunitstayid) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.culturetakentime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.culturetakentime, 'start of month') GROUP BY t2.culturesite) AS t3 WHERE t3.c1 <= 4 | WITH "t2" AS (SELECT "patient"."uniquepid", "microlab"."culturesite", "microlab"."culturetakentime" FROM "microlab" JOIN "patient" ON "microlab"."patientunitstayid" = "patient"."patientunitstayid"), "t3" AS (SELECT "t2"."culturesite", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" "t2" ON "diagnosis"."diagnosistime" < "t2"."culturetakentime" AND "patient"."uniquepid" = "t2"."uniquepid" AND DATETIME("diagnosis"."diagnosistime", 'start of month') = DATETIME("t2"."culturetakentime", 'start of month') WHERE "diagnosis"."diagnosisname" = 'valvular insufficiency - aortic valve' GROUP BY "t2"."culturesite") SELECT "t3"."culturesite" FROM "t3" "t3" WHERE "t3"."c1" <= 4 | 0.763672 |
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
| today the respiration of patient 025-13899 had been normal? | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-13899')) AND vitalperiodic.respiration BETWEEN respiration_lower AND respiration_upper AND NOT vitalperiodic.respiration IS NULL AND DATETIME(vitalperiodic.observationtime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '025-13899' 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 "vitalperiodic" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "vitalperiodic"."patientunitstayid" WHERE "respiration_lower" <= "vitalperiodic"."respiration" AND "respiration_upper" >= "vitalperiodic"."respiration" AND DATETIME("vitalperiodic"."observationtime", 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') AND NOT "_u_1"."" IS NULL AND NOT "vitalperiodic"."respiration" IS NULL | 0.756836 |
CREATE TABLE table_18126 ("District" CLOB, "Incumbent" CLOB, "Party" CLOB, "First elected" CLOB, "Results" CLOB, "Candidates" CLOB)
| What were the results for the district oklahoma 5? | SELECT "Results" FROM table_18126 WHERE "District" = 'Oklahoma 5' | SELECT "Results" FROM "table_18126" WHERE "District" = 'Oklahoma 5' | 0.06543 |
CREATE TABLE table_41734 ("Date" CLOB, "Title" CLOB, "Director" CLOB, "Producer" CLOB, "Production Cost" CLOB, "Singapore Gross" CLOB)
| What is the title of the film when the producer was 2003? | SELECT "Title" FROM table_41734 WHERE "Producer" = '2003' | SELECT "Title" FROM "table_41734" WHERE "Producer" = '2003' | 0.057617 |
CREATE TABLE table_36013 ("Name" CLOB, "Birth date" CLOB, "Age as of 1 February 2014" CLOB, "Country of birth" CLOB, "Place of residence" CLOB)
| Who is 111years, 358days Age as of 1 February 2014? | SELECT "Name" FROM table_36013 WHERE "Age as of 1 February 2014" = '111years, 358days' | SELECT "Name" FROM "table_36013" WHERE "Age as of 1 February 2014" = '111years, 358days' | 0.085938 |
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE 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 microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
| how many patients were in ward 1108 since 5 years ago. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 1108 AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-5 year') | SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "patient" WHERE "patient"."wardid" = 1108 AND DATETIME("patient"."unitadmittime") >= DATETIME(CURRENT_TIME(), '-5 year') | 0.166016 |
CREATE TABLE table_184803_4 (commentator VARCHAR2, spokespersons VARCHAR2)
| who was the commentator when spokesperson was claude darget | SELECT commentator FROM table_184803_4 WHERE spokespersons = "Claude Darget" | SELECT "commentator" FROM "table_184803_4" WHERE "Claude Darget" = "spokespersons" | 0.080078 |
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
| what are the methods of consumption of ascorbic acid 500 mg tab? | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'ascorbic acid 500 mg tab' | SELECT DISTINCT "medication"."routeadmin" FROM "medication" WHERE "medication"."drugname" = 'ascorbic acid 500 mg tab' | 0.115234 |
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 the number of patients whose admission year is less than 2150 and lab test category is chemistry? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2150" AND lab."CATEGORY" = "Chemistry" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Chemistry" = "lab"."CATEGORY" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "2150" > "demographic"."admityear" | 0.195313 |
CREATE TABLE table_204_188 (id NUMBER, "rank" NUMBER, "player" CLOB, "points" NUMBER, "points defending" NUMBER, "points won" NUMBER, "new points" NUMBER, "withdrew due to" CLOB)
| how many players had more than 2000 new points ? | SELECT COUNT("player") FROM table_204_188 WHERE "new points" > 2000 | SELECT COUNT("player") FROM "table_204_188" WHERE "new points" > 2000 | 0.067383 |
CREATE TABLE table_29728787_1 (conductor VARCHAR2, count VARCHAR2)
| When hermann uhde is the count who is the conductor? | SELECT conductor FROM table_29728787_1 WHERE count = "Hermann Uhde" | SELECT "conductor" FROM "table_29728787_1" WHERE "Hermann Uhde" = "count" | 0.071289 |
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_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
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 equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE 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 date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
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 time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
| please list all available flights from OAKLAND california to PHILADELPHIA on wednesday | 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 (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 23 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 flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' 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" = 23 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" = 'OAKLAND' 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" 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.698242 |
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 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)
| what is admission type of subject name edward castillo? | SELECT demographic.admission_type FROM demographic WHERE demographic.name = "Edward Castillo" | SELECT "demographic"."admission_type" FROM "demographic" WHERE "Edward Castillo" = "demographic"."name" | 0.100586 |
CREATE TABLE table_8664 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Record" CLOB, "Game site" CLOB)
| What was the result of the week that was a bye before week 6? | SELECT "Result" FROM table_8664 WHERE "Week" < '6' AND "Game site" = 'bye' | SELECT "Result" FROM "table_8664" WHERE "Game site" = 'bye' AND "Week" < '6' | 0.074219 |
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 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)
| how many of the patients with icd9 code 4254 were dead/expired on discharge? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND diagnoses.icd9_code = "4254" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "4254" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "DEAD/EXPIRED" = "demographic"."discharge_location" | 0.225586 |
CREATE TABLE table_train_181 ("id" NUMBER, "systolic_blood_pressure_sbp" NUMBER, "fasting_plasma_glucose_fpg" FLOAT, "hemoglobin_a1c_hba1c" FLOAT, "hepatitis_c" BOOLEAN, "hepatitis_b" BOOLEAN, "exposure_to_hiv" BOOLEAN, "diastolic_blood_pressure_dbp" NUMBER, "hypertension" BOOLEAN, "NOUSE" FLOAT)
| fpg < 270 mg / dl ( 15 mmol / l ) | SELECT * FROM table_train_181 WHERE fasting_plasma_glucose_fpg < 270 | SELECT * FROM "table_train_181" WHERE "fasting_plasma_glucose_fpg" < 270 | 0.070313 |
CREATE TABLE table_name_83 (total NUMBER, finish VARCHAR2, player VARCHAR2)
| What is the average total of player hale irwin, who had a t52 finish? | SELECT AVG(total) FROM table_name_83 WHERE finish = "t52" AND player = "hale irwin" | SELECT AVG("total") FROM "table_name_83" WHERE "finish" = "t52" AND "hale irwin" = "player" | 0.088867 |
CREATE TABLE school_bus (school_id NUMBER, driver_id NUMBER, years_working NUMBER, if_full_time others)
CREATE TABLE driver (driver_id NUMBER, name CLOB, party CLOB, home_city CLOB, age NUMBER)
CREATE TABLE school (school_id NUMBER, grade CLOB, school CLOB, location CLOB, type CLOB)
| Show all different home cities. | SELECT DISTINCT home_city FROM driver | SELECT DISTINCT "home_city" FROM "driver" | 0.040039 |
CREATE TABLE table_18604 ("District" CLOB, "Incumbent" CLOB, "Party" CLOB, "First elected" FLOAT, "Result" CLOB, "Candidates" CLOB)
| Who are the contenders In the New York 29 polling area race? | SELECT "Candidates" FROM table_18604 WHERE "District" = 'New York 29' | SELECT "Candidates" FROM "table_18604" WHERE "District" = 'New York 29' | 0.069336 |
CREATE TABLE table_name_34 (alpha VARCHAR2, ia64 VARCHAR2)
| Which Alpha contains ia64 with discontinued 3.5-3.8 4.1-4.7? | SELECT alpha FROM table_name_34 WHERE ia64 = "discontinued 3.5-3.8 4.1-4.7" | SELECT "alpha" FROM "table_name_34" WHERE "discontinued 3.5-3.8 4.1-4.7" = "ia64" | 0.079102 |
CREATE TABLE Products (Code NUMBER, Name VARCHAR2, Price NUMBER, Manufacturer NUMBER)
CREATE TABLE Manufacturers (Code NUMBER, Name VARCHAR2, Headquarter VARCHAR2, Founder VARCHAR2, Revenue FLOAT)
| For those records from the products and each product's manufacturer, what is the relationship between price and code , and group by attribute name? | SELECT T1.Price, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name | SELECT "T1"."Price", "T1"."Code" FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "Name" | 0.128906 |
CREATE TABLE table_name_26 (partner VARCHAR2, outcome VARCHAR2, date VARCHAR2)
| Who is the partner with a runner-up outcome on April 6, 1992? | SELECT partner FROM table_name_26 WHERE outcome = "runner-up" AND date = "april 6, 1992" | SELECT "partner" FROM "table_name_26" WHERE "april 6, 1992" = "date" AND "outcome" = "runner-up" | 0.09375 |
CREATE TABLE table_name_10 (country VARCHAR2, year NUMBER)
| What country was the film made in that was made after 2011? | SELECT country FROM table_name_10 WHERE year > 2011 | SELECT "country" FROM "table_name_10" WHERE "year" > 2011 | 0.055664 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| provide the number of patients whose ethnicity is asian and primary disease is ventricular tachycardia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.diagnosis = "VENTRICULAR TACHYCARDIA" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "ASIAN" = "demographic"."ethnicity" AND "VENTRICULAR TACHYCARDIA" = "demographic"."diagnosis" | 0.164063 |
CREATE TABLE table_50098 ("Player" CLOB, "Nationality" CLOB, "Position" CLOB, "Years for Grizzlies" CLOB, "School/Club Team" CLOB)
| What is the nationality of Duke? | SELECT "Nationality" FROM table_50098 WHERE "School/Club Team" = 'duke' | SELECT "Nationality" FROM "table_50098" WHERE "School/Club Team" = 'duke' | 0.071289 |
CREATE TABLE table_name_40 (week NUMBER, date VARCHAR2)
| What is the latest week with the date of november 5, 1995? | SELECT MAX(week) FROM table_name_40 WHERE date = "november 5, 1995" | SELECT MAX("week") FROM "table_name_40" WHERE "date" = "november 5, 1995" | 0.071289 |
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| get the number of patients younger than 30 years who have private health insurance. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.age < "30" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "30" > "demographic"."age" AND "Private" = "demographic"."insurance" | 0.139648 |
CREATE TABLE table_64364 ("Club" CLOB, "Wins" FLOAT, "Losses" FLOAT, "Draws" FLOAT, "Against" FLOAT)
| What's the total wins when the draws are less than 0? | SELECT COUNT("Wins") FROM table_64364 WHERE "Draws" < '0' | SELECT COUNT("Wins") FROM "table_64364" WHERE "Draws" < '0' | 0.057617 |
CREATE TABLE table_1939405_2 (latin_americans_2011 NUMBER, province VARCHAR2)
| How many Latin Americans lived in 2011 in Saskatchewan? | SELECT MIN(latin_americans_2011) FROM table_1939405_2 WHERE province = "Saskatchewan" | SELECT MIN("latin_americans_2011") FROM "table_1939405_2" WHERE "Saskatchewan" = "province" | 0.088867 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
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)
| how many patients are with discharge location short term hospital and with procedure icd9 code 17? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.icd9_code = "17" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "17" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "SHORT TERM HOSPITAL" = "demographic"."discharge_location" | 0.233398 |
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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto 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 microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE 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 patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label 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 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)
| calculate the number of medicines that patient 57050 had been prescribed since 03/2105. | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-03' | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 57050 GROUP BY "hadm_id") SELECT COUNT(*) FROM "prescriptions" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND STRFTIME('%y-%m', "prescriptions"."startdate") >= '2105-03' | 0.30957 |
CREATE TABLE table_18768 ("Saddle cloth" FLOAT, "Horse" CLOB, "Trainer" CLOB, "Jockey" CLOB, "Weight ( kg ) " CLOB, "Barrier" FLOAT, "Placing" CLOB)
| How old is Darryll Holland's horse | SELECT "Barrier" FROM table_18768 WHERE "Jockey" = 'Darryll Holland' | SELECT "Barrier" FROM "table_18768" WHERE "Jockey" = 'Darryll Holland' | 0.068359 |
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId 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 ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE 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 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 PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress 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 Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId 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 PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
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 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 PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
| get reputation of a user. | SELECT Id, Reputation FROM Users WHERE DisplayName = '##Name##' | SELECT "Id", "Reputation" FROM "Users" WHERE "DisplayName" = '##Name##' | 0.069336 |
CREATE TABLE table_name_7 (goals NUMBER, appearances VARCHAR2, rank VARCHAR2, name VARCHAR2)
| What is the total Goals with a Rank smaller than 10, a Name of nicolas anelka, and Appearances larger than 9? | SELECT SUM(goals) FROM table_name_7 WHERE rank < 10 AND name = "nicolas anelka" AND appearances > 9 | SELECT SUM("goals") FROM "table_name_7" WHERE "appearances" > 9 AND "name" = "nicolas anelka" AND "rank" < 10 | 0.106445 |
CREATE TABLE table_name_71 (jersey__number NUMBER, name VARCHAR2, weight__kg_ VARCHAR2)
| What was the average Jersey # of Steve Griffith, when his Weight (kg) was less than 84? | SELECT AVG(jersey__number) FROM table_name_71 WHERE name = "steve griffith" AND weight__kg_ < 84 | SELECT AVG("jersey__number") FROM "table_name_71" WHERE "name" = "steve griffith" AND "weight__kg_" < 84 | 0.101563 |
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
| For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of job_id and the average of salary , and group by attribute job_id in a bar chart, and display in ascending by the X. | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID | SELECT "JOB_ID", AVG("SALARY") FROM "employees" WHERE ("COMMISSION_PCT" <> "null" OR "DEPARTMENT_ID" <> 40) AND ("DEPARTMENT_ID" <> 40 OR "SALARY" <= 12000) AND ("DEPARTMENT_ID" <> 40 OR "SALARY" >= 8000) GROUP BY "JOB_ID" ORDER BY "JOB_ID" | 0.234375 |
CREATE TABLE table_75795 ("Television service" CLOB, "Country" CLOB, "Language" CLOB, "Content" CLOB, "HDTV" CLOB, "Package/Option" CLOB)
| What is Package/Option, when Content is Poker? | SELECT "Package/Option" FROM table_75795 WHERE "Content" = 'poker' | SELECT "Package/Option" FROM "table_75795" WHERE "Content" = 'poker' | 0.066406 |
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE 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 d_icd_procedures (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 diagnoses_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 prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_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 outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE 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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
| when was the last time that patient 1902 has the minimum bicarbonate since 47 months ago? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-47 month') ORDER BY labevents.valuenum, labevents.charttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 1902 GROUP BY "hadm_id"), "_u_1" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'bicarbonate' GROUP BY "itemid") SELECT "labevents"."charttime" FROM "labevents" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "labevents"."hadm_id" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "labevents"."itemid" WHERE DATETIME("labevents"."charttime") >= DATETIME(CURRENT_TIME(), '-47 month') AND NOT "_u_0"."" IS NULL AND NOT "_u_1"."" IS NULL ORDER BY "labevents"."valuenum", "labevents"."charttime" DESC FETCH FIRST 1 ROWS ONLY | 0.616211 |
CREATE TABLE table_29547777_1 (original_performer VARCHAR2, episode VARCHAR2)
| Who is the original performer when the episode is casting? | SELECT original_performer FROM table_29547777_1 WHERE episode = "Casting" | SELECT "original_performer" FROM "table_29547777_1" WHERE "Casting" = "episode" | 0.077148 |
CREATE TABLE table_22871239_9 (high_points VARCHAR2, record VARCHAR2)
| Name the high points for 21-45 record | SELECT COUNT(high_points) FROM table_22871239_9 WHERE record = "21-45" | SELECT COUNT("high_points") FROM "table_22871239_9" WHERE "21-45" = "record" | 0.074219 |
CREATE TABLE table_name_76 (silver NUMBER, nation VARCHAR2)
| What is the most silver won by Norway? | SELECT MAX(silver) FROM table_name_76 WHERE nation = "norway" | SELECT MAX("silver") FROM "table_name_76" WHERE "nation" = "norway" | 0.06543 |
CREATE TABLE table_name_52 (class VARCHAR2, number VARCHAR2, built VARCHAR2)
| Which class had a number under 4 and was built in 1988? | SELECT class FROM table_name_52 WHERE number < 4 AND built = "1988" | SELECT "class" FROM "table_name_52" WHERE "1988" = "built" AND "number" < 4 | 0.073242 |
CREATE TABLE CLASS (CLASS_CODE VARCHAR2, CRS_CODE VARCHAR2, CLASS_SECTION VARCHAR2, CLASS_TIME VARCHAR2, CLASS_ROOM VARCHAR2, PROF_NUM NUMBER)
CREATE TABLE STUDENT (STU_NUM NUMBER, STU_LNAME VARCHAR2, STU_FNAME VARCHAR2, STU_INIT VARCHAR2, STU_DOB DATETIME, STU_HRS NUMBER, STU_CLASS VARCHAR2, STU_GPA FLOAT, STU_TRANSFER NUMBER, DEPT_CODE VARCHAR2, STU_PHONE VARCHAR2, PROF_NUM NUMBER)
CREATE TABLE COURSE (CRS_CODE VARCHAR2, DEPT_CODE VARCHAR2, CRS_DESCRIPTION VARCHAR2, CRS_CREDIT FLOAT)
CREATE TABLE EMPLOYEE (EMP_NUM NUMBER, EMP_LNAME VARCHAR2, EMP_FNAME VARCHAR2, EMP_INITIAL VARCHAR2, EMP_JOBCODE VARCHAR2, EMP_HIREDATE DATETIME, EMP_DOB DATETIME)
CREATE TABLE PROFESSOR (EMP_NUM NUMBER, DEPT_CODE VARCHAR2, PROF_OFFICE VARCHAR2, PROF_EXTENSION VARCHAR2, PROF_HIGH_DEGREE VARCHAR2)
CREATE TABLE ENROLL (CLASS_CODE VARCHAR2, STU_NUM NUMBER, ENROLL_GRADE VARCHAR2)
CREATE TABLE DEPARTMENT (DEPT_CODE VARCHAR2, DEPT_NAME VARCHAR2, SCHOOL_CODE VARCHAR2, EMP_NUM NUMBER, DEPT_ADDRESS VARCHAR2, DEPT_EXTENSION VARCHAR2)
| How many professors in each office? Show me a bar chart, could you display in descending by the bars? | SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM PROFESSOR AS T1 JOIN EMPLOYEE AS T2 ON T1.EMP_NUM = T2.EMP_NUM GROUP BY PROF_OFFICE ORDER BY PROF_OFFICE DESC | SELECT "PROF_OFFICE", COUNT("PROF_OFFICE") FROM "PROFESSOR" "T1" JOIN "EMPLOYEE" "T2" ON "T1"."EMP_NUM" = "T2"."EMP_NUM" GROUP BY "PROF_OFFICE" ORDER BY "PROF_OFFICE" DESC | 0.166992 |
CREATE TABLE table_name_33 (game VARCHAR2, date VARCHAR2)
| What game took place on April 28? | SELECT game FROM table_name_33 WHERE date = "april 28" | SELECT "game" FROM "table_name_33" WHERE "april 28" = "date" | 0.058594 |
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
| For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time, I want to sort by the Y in ascending. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(DEPARTMENT_ID) | SELECT "HIRE_DATE", AVG("DEPARTMENT_ID") FROM "employees" WHERE "FIRST_NAME" LIKE '%D%' OR "FIRST_NAME" LIKE '%S%' ORDER BY AVG("DEPARTMENT_ID") | 0.140625 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE 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)
| how many patients whose admission type is emergency and lab test name is reticulocyte count, manual? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Reticulocyte Count, Manual" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Reticulocyte Count, Manual" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "EMERGENCY" = "demographic"."admission_type" | 0.21875 |
CREATE TABLE table_name_39 (score VARCHAR2, player VARCHAR2)
| What was Larry Nelson's final score? | SELECT score FROM table_name_39 WHERE player = "larry nelson" | SELECT "score" FROM "table_name_39" WHERE "larry nelson" = "player" | 0.06543 |
CREATE TABLE table_59522 ("Place" CLOB, "Player" CLOB, "Country" CLOB, "Score" FLOAT, "To par" CLOB)
| Where is john daly of united states from? | SELECT "Place" FROM table_59522 WHERE "Country" = 'united states' AND "Player" = 'john daly' | SELECT "Place" FROM "table_59522" WHERE "Country" = 'united states' AND "Player" = 'john daly' | 0.091797 |
CREATE TABLE table_2987 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "Production code" FLOAT)
| Name the title for 446913 | SELECT "Title" FROM table_2987 WHERE "Production code" = '446913' | SELECT "Title" FROM "table_2987" WHERE "Production code" = '446913' | 0.06543 |
CREATE TABLE table_33420 ("Lane" FLOAT, "Swimmer" CLOB, "Nationality" CLOB, "100m" FLOAT, "200m" CLOB, "300m" CLOB, "400m" CLOB, "500m" CLOB, "600m" CLOB, "700m" CLOB, "Time" CLOB)
| Which swimmer completed the 700m within 6:57.69? | SELECT "Swimmer" FROM table_33420 WHERE "700m" = '6:57.69' | SELECT "Swimmer" FROM "table_33420" WHERE "700m" = '6:57.69' | 0.058594 |
CREATE TABLE Engineer_Visits (fault_log_entry_id VARCHAR2)
CREATE TABLE Fault_Log (fault_log_entry_id VARCHAR2)
| How many engineer visits are required at most for a single fault log? List the number and the log entry id. | SELECT COUNT(*), T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engineer_Visits AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY COUNT(*) DESC LIMIT 1 | SELECT COUNT(*), "T1"."fault_log_entry_id" FROM "Fault_Log" "T1" JOIN "Engineer_Visits" "T2" ON "T1"."fault_log_entry_id" = "T2"."fault_log_entry_id" GROUP BY "T1"."fault_log_entry_id" ORDER BY COUNT(*) DESC FETCH FIRST 1 ROWS ONLY | 0.225586 |
CREATE TABLE table_name_13 (player VARCHAR2, years_for_grizzlies VARCHAR2)
| Which player played for the Grizzlies from 1997-1998? | SELECT player FROM table_name_13 WHERE years_for_grizzlies = "1997-1998" | SELECT "player" FROM "table_name_13" WHERE "1997-1998" = "years_for_grizzlies" | 0.076172 |
CREATE TABLE table_10375 ("Rank" CLOB, "Name" CLOB, "Height ft / m" CLOB, "Floors" FLOAT, "Year" FLOAT)
| Name the height when the floors are bigger than 30 at the bny mellon center | SELECT "Height ft / m" FROM table_10375 WHERE "Floors" > '30' AND "Name" = 'bny mellon center' | SELECT "Height ft / m" FROM "table_10375" WHERE "Floors" > '30' AND "Name" = 'bny mellon center' | 0.09375 |
CREATE TABLE table_29114 ("Event" CLOB, "Start Date" CLOB, "Finish Date" CLOB, "Start" CLOB, "Finish" CLOB, "Distance" CLOB, "Abu Dhabi" CLOB, "Camper" FLOAT, "Groupama" FLOAT, "Puma" CLOB, "Sanya" CLOB, "Telef\\u00f3nica" FLOAT)
| If puma is 12, what is camper? | SELECT MIN("Camper") FROM table_29114 WHERE "Puma" = '12' | SELECT MIN("Camper") FROM "table_29114" WHERE "Puma" = '12' | 0.057617 |
CREATE TABLE table_name_62 (category VARCHAR2, result VARCHAR2, year VARCHAR2)
| In 2007 what category won? | SELECT category FROM table_name_62 WHERE result = "won" AND year < 2007 | SELECT "category" FROM "table_name_62" WHERE "result" = "won" AND "year" < 2007 | 0.077148 |
CREATE TABLE table_5533 ("Appearances" FLOAT, "Team" CLOB, "Wins" FLOAT, "Losses" FLOAT, "Win %" FLOAT)
| What's the total number of Win % with an Appearances of 4, and Losses that's larger than 3? | SELECT COUNT("Win %") FROM table_5533 WHERE "Appearances" = '4' AND "Losses" > '3' | SELECT COUNT("Win %") FROM "table_5533" WHERE "Appearances" = '4' AND "Losses" > '3' | 0.082031 |
CREATE TABLE table_67641 ("Episode" CLOB, "First aired" CLOB, "Entrepreneur ( s ) " CLOB, "Company or product name" CLOB, "Money requested ( \\u00a3 ) " CLOB, "Investing Dragon ( s ) " CLOB)
| Which Investing Dragon(s) requested 100,000 in money and has autosafe? | SELECT "Investing Dragon(s)" FROM table_67641 WHERE "Money requested (\u00a3)" = '100,000' AND "Company or product name" = 'autosafe' | SELECT "Investing Dragon(s)" FROM "table_67641" WHERE "Company or product name" = 'autosafe' AND "Money requested (\u00a3)" = '100,000' | 0.131836 |
CREATE TABLE constructorResults (constructorResultsId NUMBER, raceId NUMBER, constructorId NUMBER, points FLOAT, status CLOB)
CREATE TABLE seasons (year NUMBER, url CLOB)
CREATE TABLE circuits (circuitId NUMBER, circuitRef CLOB, name CLOB, location CLOB, country CLOB, lat FLOAT, lng FLOAT, alt CLOB, url CLOB)
CREATE TABLE results (resultId NUMBER, raceId NUMBER, driverId NUMBER, constructorId NUMBER, number NUMBER, grid NUMBER, position CLOB, positionText CLOB, positionOrder NUMBER, points FLOAT, laps CLOB, time CLOB, milliseconds CLOB, fastestLap CLOB, rank CLOB, fastestLapTime CLOB, fastestLapSpeed CLOB, statusId NUMBER)
CREATE TABLE lapTimes (raceId NUMBER, driverId NUMBER, lap NUMBER, position NUMBER, time CLOB, milliseconds NUMBER)
CREATE TABLE races (raceId NUMBER, year NUMBER, round NUMBER, circuitId NUMBER, name CLOB, date CLOB, time CLOB, url CLOB)
CREATE TABLE drivers (driverId NUMBER, driverRef CLOB, number CLOB, code CLOB, forename CLOB, surname CLOB, dob CLOB, nationality CLOB, url CLOB)
CREATE TABLE driverStandings (driverStandingsId NUMBER, raceId NUMBER, driverId NUMBER, points FLOAT, position NUMBER, positionText CLOB, wins NUMBER)
CREATE TABLE constructors (constructorId NUMBER, constructorRef CLOB, name CLOB, nationality CLOB, url CLOB)
CREATE TABLE pitStops (raceId NUMBER, driverId NUMBER, stop NUMBER, lap NUMBER, time CLOB, duration CLOB, milliseconds NUMBER)
CREATE TABLE status (statusId NUMBER, status CLOB)
CREATE TABLE qualifying (qualifyId NUMBER, raceId NUMBER, driverId NUMBER, constructorId NUMBER, number NUMBER, position NUMBER, q1 CLOB, q2 CLOB, q3 CLOB)
CREATE TABLE constructorStandings (constructorStandingsId NUMBER, raceId NUMBER, constructorId NUMBER, points FLOAT, position NUMBER, positionText CLOB, wins NUMBER)
| Show the number of races that had any driver whose forename is Lewis in each year with a line chart, show in descending by the X-axis. | SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" GROUP BY year ORDER BY year DESC | SELECT "year", COUNT("year") FROM "results" "T1" JOIN "races" "T2" ON "T1"."raceId" = "T2"."raceId" JOIN "drivers" "T3" ON "Lewis" = "T3"."forename" AND "T1"."driverId" = "T3"."driverId" GROUP BY "year" ORDER BY "year" DESC | 0.217773 |
CREATE TABLE table_39944 ("Rank" FLOAT, "Nation" CLOB, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
| What is the lowest number of bronze medals for Great Britain with more than 2 medals total? | SELECT MIN("Bronze") FROM table_39944 WHERE "Nation" = 'great britain' AND "Total" > '2' | SELECT MIN("Bronze") FROM "table_39944" WHERE "Nation" = 'great britain' AND "Total" > '2' | 0.087891 |
CREATE TABLE table_25081 ("Year" FLOAT, "Network" CLOB, "Race caller" CLOB, "s Host" CLOB, "s Analyst" CLOB, "Reporters" CLOB, "Trophy presentation" CLOB)
| Name the host for john rotz and howard cosell | SELECT "s Host" FROM table_25081 WHERE "s Analyst" = 'John Rotz and Howard Cosell' | SELECT "s Host" FROM "table_25081" WHERE "s Analyst" = 'John Rotz and Howard Cosell' | 0.082031 |
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
| what is the total average cost of a hospital that includes a pt - inr lab test in 2101? | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'pt - inr')) AND STRFTIME('%y', cost.chargetime) = '2101' GROUP BY cost.patienthealthsystemstayid) AS t1 | WITH "_u_0" AS (SELECT "lab"."patientunitstayid" FROM "lab" WHERE "lab"."labname" = 'pt - inr' GROUP BY "patientunitstayid"), "_u_1" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patienthealthsystemstayid"), "t1" AS (SELECT SUM("cost"."cost") AS "c1" FROM "cost" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "cost"."patienthealthsystemstayid" WHERE NOT "_u_1"."" IS NULL AND STRFTIME('%y', "cost"."chargetime") = '2101' GROUP BY "cost"."patienthealthsystemstayid") SELECT AVG("t1"."c1") FROM "t1" "t1" | 0.605469 |
CREATE TABLE table_38027 ("Name" CLOB, "Number" FLOAT, "Team Position" FLOAT, "Height" CLOB, "Year" CLOB)
| What is the height of Josh Tabb? | SELECT "Height" FROM table_38027 WHERE "Name" = 'josh tabb' | SELECT "Height" FROM "table_38027" WHERE "Name" = 'josh tabb' | 0.05957 |
CREATE TABLE table_70573 ("Riding" CLOB, "Candidate's Name" CLOB, "Gender" CLOB, "Residence" CLOB, "Occupation" CLOB, "Votes" FLOAT, "Rank" CLOB)
| What is the Riding, when the Rank is 4th? | SELECT "Riding" FROM table_70573 WHERE "Rank" = '4th' | SELECT "Riding" FROM "table_70573" WHERE "Rank" = '4th' | 0.053711 |
CREATE TABLE STUDENT (STU_NUM NUMBER, STU_LNAME VARCHAR2, STU_FNAME VARCHAR2, STU_INIT VARCHAR2, STU_DOB DATETIME, STU_HRS NUMBER, STU_CLASS VARCHAR2, STU_GPA FLOAT, STU_TRANSFER NUMBER, DEPT_CODE VARCHAR2, STU_PHONE VARCHAR2, PROF_NUM NUMBER)
CREATE TABLE DEPARTMENT (DEPT_CODE VARCHAR2, DEPT_NAME VARCHAR2, SCHOOL_CODE VARCHAR2, EMP_NUM NUMBER, DEPT_ADDRESS VARCHAR2, DEPT_EXTENSION VARCHAR2)
CREATE TABLE CLASS (CLASS_CODE VARCHAR2, CRS_CODE VARCHAR2, CLASS_SECTION VARCHAR2, CLASS_TIME VARCHAR2, CLASS_ROOM VARCHAR2, PROF_NUM NUMBER)
CREATE TABLE PROFESSOR (EMP_NUM NUMBER, DEPT_CODE VARCHAR2, PROF_OFFICE VARCHAR2, PROF_EXTENSION VARCHAR2, PROF_HIGH_DEGREE VARCHAR2)
CREATE TABLE ENROLL (CLASS_CODE VARCHAR2, STU_NUM NUMBER, ENROLL_GRADE VARCHAR2)
CREATE TABLE COURSE (CRS_CODE VARCHAR2, DEPT_CODE VARCHAR2, CRS_DESCRIPTION VARCHAR2, CRS_CREDIT FLOAT)
CREATE TABLE EMPLOYEE (EMP_NUM NUMBER, EMP_LNAME VARCHAR2, EMP_FNAME VARCHAR2, EMP_INITIAL VARCHAR2, EMP_JOBCODE VARCHAR2, EMP_HIREDATE DATETIME, EMP_DOB DATETIME)
| Show the number of courses for each instructor in a bar chart, could you sort total number from low to high order please? | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY EMP_FNAME ORDER BY COUNT(EMP_FNAME) | SELECT "EMP_FNAME", COUNT("EMP_FNAME") FROM "CLASS" "T1" JOIN "EMPLOYEE" "T2" ON "T1"."PROF_NUM" = "T2"."EMP_NUM" JOIN "COURSE" "T3" ON "T1"."CRS_CODE" = "T3"."CRS_CODE" JOIN "PROFESSOR" "T4" ON "T2"."EMP_NUM" = "T4"."EMP_NUM" GROUP BY "EMP_FNAME" ORDER BY COUNT("EMP_FNAME") | 0.268555 |
CREATE TABLE table_44777 ("1950" FLOAT, "General 1950" CLOB, "Senate 1950" CLOB, "House 1950" CLOB, "Governors 1950" CLOB)
| What is the Governors 1950 when the General 1950 is general 1979? | SELECT "Governors 1950" FROM table_44777 WHERE "General 1950" = 'general 1979' | SELECT "Governors 1950" FROM "table_44777" WHERE "General 1950" = 'general 1979' | 0.078125 |
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name 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 PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress 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 PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description 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 ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
| All posts of a user. | SELECT OwnerUserId AS "user_link", u.DisplayName, p.Id AS "post_link", ParentId AS "post_link", Title FROM Posts AS p LEFT OUTER JOIN Users AS u ON u.Id = OwnerUserId WHERE OwnerUserId = 65889 | SELECT "OwnerUserId" AS "user_link", "u"."DisplayName", "p"."Id" AS "post_link", "ParentId" AS "post_link", "Title" FROM "Posts" "p" LEFT JOIN "Users" "u" ON "OwnerUserId" = "u"."Id" WHERE "OwnerUserId" = 65889 | 0.205078 |
CREATE TABLE table_name_14 (label VARCHAR2, country VARCHAR2, catalogue__number VARCHAR2)
| What is the Label of Catalogue # HVNLP26CD from United Kingdom? | SELECT label FROM table_name_14 WHERE country = "united kingdom" AND catalogue__number = "hvnlp26cd" | SELECT "label" FROM "table_name_14" WHERE "catalogue__number" = "hvnlp26cd" AND "country" = "united kingdom" | 0.105469 |
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| provide the number of patients whose year of birth is less than 2047 and lab test fluid is cerebrospinal fluid (csf)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2047" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Cerebrospinal Fluid (CSF)" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "2047" > "demographic"."dob_year" | 0.207031 |
CREATE TABLE Financial_Transactions (transaction_id NUMBER, previous_transaction_id NUMBER, account_id NUMBER, card_id NUMBER, transaction_type VARCHAR2, transaction_date DATETIME, transaction_amount DOUBLE PRECISION, transaction_comment VARCHAR2, other_transaction_details VARCHAR2)
CREATE TABLE Customers (customer_id NUMBER, customer_first_name VARCHAR2, customer_last_name VARCHAR2, customer_address VARCHAR2, customer_phone VARCHAR2, customer_email VARCHAR2, other_customer_details VARCHAR2)
CREATE TABLE Accounts (account_id NUMBER, customer_id NUMBER, account_name VARCHAR2, other_account_details VARCHAR2)
CREATE TABLE Customers_Cards (card_id NUMBER, customer_id NUMBER, card_type_code VARCHAR2, card_number VARCHAR2, date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR2)
| What is the relationship between customer id and card id? Return a scatter chart. | SELECT card_id, customer_id FROM Customers_Cards | SELECT "card_id", "customer_id" FROM "Customers_Cards" | 0.052734 |
CREATE TABLE elimination (elimination_id CLOB, wrestler_id CLOB, team CLOB, eliminated_by CLOB, elimination_move CLOB, time CLOB)
CREATE TABLE wrestler (wrestler_id NUMBER, name CLOB, reign CLOB, days_held CLOB, location CLOB, event CLOB)
| Which reign is the most common among wrestlers? | SELECT reign FROM wrestler GROUP BY reign ORDER BY COUNT(*) DESC LIMIT 1 | SELECT "reign" FROM "wrestler" GROUP BY "reign" ORDER BY COUNT(*) DESC FETCH FIRST 1 ROWS ONLY | 0.091797 |
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| give the number of patients whose procedure long title is closed biopsy of skin and subcutaneous tissue and lab test fluid is cerebrospinal fluid (csf). | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Closed biopsy of skin and subcutaneous tissue" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Cerebrospinal Fluid (CSF)" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" JOIN "procedures" ON "Closed biopsy of skin and subcutaneous tissue" = "procedures"."long_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" | 0.314453 |
CREATE TABLE table_23020 ("Country" CLOB, "Total Drivers" FLOAT, "Champions" FLOAT, "Championships" FLOAT, "Current March 20 , 2010" FLOAT, "First driver ( s ) " CLOB, "Last/Current driver ( s ) March 20 , 2010" CLOB)
| How many championships does Pakistan have? | SELECT COUNT("Championships") FROM table_23020 WHERE "Country" = 'Pakistan' | SELECT COUNT("Championships") FROM "table_23020" WHERE "Country" = 'Pakistan' | 0.075195 |
CREATE TABLE student (stuid NUMBER, lname CLOB, fname CLOB, age NUMBER, sex CLOB, major NUMBER, advisor NUMBER, city_code CLOB)
CREATE TABLE has_allergy (stuid NUMBER, allergy CLOB)
CREATE TABLE allergy_type (allergy CLOB, allergytype CLOB)
| Which students are unaffected by allergies? | SELECT stuid FROM student EXCEPT SELECT stuid FROM has_allergy | SELECT "stuid" FROM "student" EXCEPT SELECT "stuid" FROM "has_allergy" | 0.068359 |
CREATE TABLE table_24326 ("Season" FLOAT, "Episode" FLOAT, "Episode Summary" CLOB, "Premier date" CLOB, "External Link" CLOB, "Coach" CLOB)
| What is the minimum number of seasons? | SELECT MIN("Season") FROM table_24326 | SELECT MIN("Season") FROM "table_24326" | 0.038086 |
CREATE TABLE apartment_buildings (building_id NUMBER, building_short_name CLOB, building_full_name CLOB, building_description CLOB, building_address CLOB, building_manager CLOB, building_phone CLOB)
CREATE TABLE apartment_facilities (apt_id NUMBER, facility_code CLOB)
CREATE TABLE guests (guest_id NUMBER, gender_code CLOB, guest_first_name CLOB, guest_last_name CLOB, date_of_birth TIME)
CREATE TABLE apartments (apt_id NUMBER, building_id NUMBER, apt_type_code CLOB, apt_number CLOB, bathroom_count NUMBER, bedroom_count NUMBER, room_count CLOB)
CREATE TABLE view_unit_status (apt_id NUMBER, apt_booking_id NUMBER, status_date TIME, available_yn others)
CREATE TABLE apartment_bookings (apt_booking_id NUMBER, apt_id NUMBER, guest_id NUMBER, booking_status_code CLOB, booking_start_date TIME, booking_end_date TIME)
| What apartment type codes and apartment numbers do the buildings managed by 'Kyle' have? | SELECT T2.apt_type_code, T2.apt_number FROM apartment_buildings AS T1 JOIN apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle" | SELECT "T2"."apt_type_code", "T2"."apt_number" FROM "apartment_buildings" "T1" JOIN "apartments" "T2" ON "T1"."building_id" = "T2"."building_id" WHERE "Kyle" = "T1"."building_manager" | 0.178711 |
CREATE TABLE table_30677 ("Couple" CLOB, "Style" CLOB, "Music" CLOB, "Trine Dehli Cleve" FLOAT, "Tor Fl\\u00f8ysvik" FLOAT, "Karianne Gulliksen" FLOAT, "Christer Tornell" FLOAT, "Total" FLOAT)
| How many entries arr there for christer tornell for the song ' you light up my life ' whitney houston? | SELECT COUNT("Christer Tornell") FROM table_30677 WHERE "Music" = ' You Light Up My Life "— Whitney Houston' | SELECT COUNT("Christer Tornell") FROM "table_30677" WHERE "Music" = ' You Light Up My Life "— Whitney Houston' | 0.107422 |
CREATE TABLE table_1140083_2 (fastest_lap VARCHAR2, location VARCHAR2)
| The Dijon-prenois had how many fastest laps? | SELECT COUNT(fastest_lap) FROM table_1140083_2 WHERE location = "Dijon-Prenois" | SELECT COUNT("fastest_lap") FROM "table_1140083_2" WHERE "Dijon-Prenois" = "location" | 0.083008 |
CREATE TABLE table_name_11 (athlete VARCHAR2, data VARCHAR2)
| Who has a walking data of 3:10:48+? | SELECT athlete FROM table_name_11 WHERE data = "3:10:48+" | SELECT "athlete" FROM "table_name_11" WHERE "3:10:48+" = "data" | 0.061523 |
CREATE TABLE table_16390 ("Round" FLOAT, "Choice" FLOAT, "Player name" CLOB, "Position" CLOB, "Height" CLOB, "Weight" FLOAT, "College" CLOB)
| Which player went to college in Oklahoma? | SELECT "Player name" FROM table_16390 WHERE "College" = 'Oklahoma' | SELECT "Player name" FROM "table_16390" WHERE "College" = 'Oklahoma' | 0.066406 |
CREATE TABLE table_159 ("Player" CLOB, "W-L ( Total ) " CLOB, "W-L ( Singles ) " CLOB, "W-L ( Doubles ) " CLOB, "Ties" FLOAT, "Debut" FLOAT, "Years Played" FLOAT)
| What is the highest number of ties? | SELECT MAX("Ties") FROM table_159 | SELECT MAX("Ties") FROM "table_159" | 0.03418 |
CREATE TABLE table_70593 ("Year" FLOAT, "Entrant" CLOB, "Chassis" CLOB, "Engine" CLOB, "Points" FLOAT)
| Which entrant scored less than 8 points and used a Maserati chassis? | SELECT "Entrant" FROM table_70593 WHERE "Points" < '8' AND "Chassis" = 'maserati' | SELECT "Entrant" FROM "table_70593" WHERE "Chassis" = 'maserati' AND "Points" < '8' | 0.081055 |
CREATE TABLE table_5756 ("County" CLOB, "Per capita income" CLOB, "Median household income" CLOB, "Median family income" CLOB, "Population" FLOAT, "Number of households" FLOAT)
| How many people have a Median household income of $37,759? | SELECT SUM("Population") FROM table_5756 WHERE "Median household income" = '$37,759' | SELECT SUM("Population") FROM "table_5756" WHERE "Median household income" = '$37,759' | 0.083984 |
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE 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 requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req 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 ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
| For the upper-level courses is the instuctor ever Bradley Hinesman ? | 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 '%Bradley Hinesman%' 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 '%Bradley Hinesman%' | 0.514648 |
CREATE TABLE table_name_26 (fate VARCHAR2, ship VARCHAR2)
| What is the fate for the Bremen ship? | SELECT fate FROM table_name_26 WHERE ship = "bremen" | SELECT "fate" FROM "table_name_26" WHERE "bremen" = "ship" | 0.056641 |
CREATE TABLE table_67215 ("Year" FLOAT, "Award" CLOB, "Category" CLOB, "Title" CLOB, "Result" CLOB)
| What is recorded as the lowest Year that has the Title of Cold Feet? | SELECT MIN("Year") FROM table_67215 WHERE "Title" = 'cold feet' | SELECT MIN("Year") FROM "table_67215" WHERE "Title" = 'cold feet' | 0.063477 |
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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE 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 patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
| what's the top three most common output events until 1 year ago? | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 3 | WITH "t1" AS (SELECT "intakeoutput"."celllabel", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "intakeoutput" WHERE "intakeoutput"."cellpath" LIKE '%output%' AND DATETIME("intakeoutput"."intakeoutputtime") <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY "intakeoutput"."celllabel") SELECT "t1"."celllabel" FROM "t1" "t1" WHERE "t1"."c1" <= 3 | 0.342773 |
CREATE TABLE entrepreneur (Investor VARCHAR2)
| What is the investor that has invested in the most number of entrepreneurs? | SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1 | SELECT "Investor" FROM "entrepreneur" GROUP BY "Investor" ORDER BY COUNT(*) DESC FETCH FIRST 1 ROWS ONLY | 0.101563 |