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 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 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)
| give me the number of patients whose admission location is phys referral/normal deli and primary disease is posterior communicating aneurysm/sda? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "PHYS REFERRAL/NORMAL DELI" = "demographic"."admission_location" AND "POSTERIOR COMMUNICATING ANEURYSM/SDA" = "demographic"."diagnosis" | 0.205078 |
CREATE TABLE table_18424435_5 (us_air_date VARCHAR2, canadian_viewers__million_ VARCHAR2)
| Which air dates have 1.229 canadian viewers (millions)? | SELECT us_air_date FROM table_18424435_5 WHERE canadian_viewers__million_ = "1.229" | SELECT "us_air_date" FROM "table_18424435_5" WHERE "1.229" = "canadian_viewers__million_" | 0.086914 |
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
| what is the number of patients whose primary disease is hyperglycemia;hyponatremia and days of hospital stay is greater than 15? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" AND demographic.days_stay > "15" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "15" < "demographic"."days_stay" AND "HYPERGLYCEMIA;HYPONATREMIA" = "demographic"."diagnosis" | 0.164063 |
CREATE TABLE table_23481 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
| state the number of location attendance where record is 15 10 (5 7) | SELECT COUNT("Location Attendance") FROM table_23481 WHERE "Record" = '15–10 (5–7)' | SELECT COUNT("Location Attendance") FROM "table_23481" WHERE "Record" = '15–10 (5–7)' | 0.083008 |
CREATE TABLE table_name_95 (Box VARCHAR2, home_team VARCHAR2)
| What was the box score for the game that had the Townsville Crocodiles as home team? | SELECT Box AS score FROM table_name_95 WHERE home_team = "townsville crocodiles" | SELECT "Box" AS "score" FROM "table_name_95" WHERE "home_team" = "townsville crocodiles" | 0.085938 |
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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
| had patient 030-52395 had had any suprapubic catheter procedure until 3 years ago? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52395')) AND treatment.treatmentname = 'suprapubic catheter' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 year') | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '030-52395' 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 "treatment" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "treatment"."patientunitstayid" WHERE "treatment"."treatmentname" = 'suprapubic catheter' AND DATETIME("treatment"."treatmenttime") <= DATETIME(CURRENT_TIME(), '-3 year') AND NOT "_u_1"."" IS NULL | 0.612305 |
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 countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE 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 job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
| For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the last_name by a bar chart, I want to display in descending by the X please. | SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC | SELECT "LAST_NAME", "SALARY" FROM "employees" WHERE NOT "DEPARTMENT_ID" IN (SELECT "DEPARTMENT_ID" FROM "departments" WHERE "MANAGER_ID" <= 200 AND "MANAGER_ID" >= 100) ORDER BY "LAST_NAME" DESC | 0.189453 |
CREATE TABLE table_15268 ("Date" CLOB, "Visitor" CLOB, "Score" CLOB, "Home" CLOB, "Decision" CLOB, "Attendance" FLOAT, "Record" CLOB)
| When is a Decision of osgood, and a Score of 6 7? | SELECT "Date" FROM table_15268 WHERE "Decision" = 'osgood' AND "Score" = '6 – 7' | SELECT "Date" FROM "table_15268" WHERE "Decision" = 'osgood' AND "Score" = '6 – 7' | 0.080078 |
CREATE TABLE table_name_14 (venue VARCHAR2, away_team VARCHAR2)
| What venue had collingwood as the away team? | SELECT venue FROM table_name_14 WHERE away_team = "collingwood" | SELECT "venue" FROM "table_name_14" WHERE "away_team" = "collingwood" | 0.067383 |
CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB)
CREATE TABLE basketball_match (Team_ID NUMBER, School_ID NUMBER, Team_Name CLOB, ACC_Regular_Season CLOB, ACC_Percent CLOB, ACC_Home CLOB, ACC_Road CLOB, All_Games CLOB, All_Games_Percent NUMBER, All_Home CLOB, All_Road CLOB, All_Neutral CLOB)
| Show team_id from each team name, and display y axis in desc order. | SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_ID DESC | SELECT "Team_Name", "Team_ID" FROM "basketball_match" ORDER BY "Team_ID" DESC | 0.075195 |
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE 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 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 cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
| in this year, how many patients were diagnosed with chest pain - r/o myocardial ischemia within 2 months after they were diagnosed with shock, etiology unclear? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chest pain - r/o myocardial ischemia' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'shock, etiology unclear' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t2 WHERE t1.diagnosistime < t2.diagnosistime AND DATETIME(t2.diagnosistime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month') | SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "diagnosis" "diagnosis_2" ON "diagnosis"."diagnosistime" < "diagnosis_2"."diagnosistime" AND "diagnosis_2"."diagnosisname" = 'shock, etiology unclear' AND DATETIME("diagnosis"."diagnosistime") <= DATETIME("diagnosis_2"."diagnosistime") AND DATETIME("diagnosis"."diagnosistime", '+2 month') >= DATETIME("diagnosis_2"."diagnosistime") AND DATETIME("diagnosis_2"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') JOIN "patient" "patient_2" ON "diagnosis_2"."patientunitstayid" = "patient_2"."patientunitstayid" WHERE "diagnosis"."diagnosisname" = 'chest pain - r/o myocardial ischemia' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | 0.863281 |
CREATE TABLE stadium (ID NUMBER, name CLOB, Capacity NUMBER, City CLOB, Country CLOB, Opening_year NUMBER)
CREATE TABLE record (ID NUMBER, Result CLOB, Swimmer_ID NUMBER, Event_ID NUMBER)
CREATE TABLE event (ID NUMBER, Name CLOB, Stadium_ID NUMBER, Year CLOB)
CREATE TABLE swimmer (ID NUMBER, name CLOB, Nationality CLOB, meter_100 FLOAT, meter_200 CLOB, meter_300 CLOB, meter_400 CLOB, meter_500 CLOB, meter_600 CLOB, meter_700 CLOB, Time CLOB)
| Bar chart x axis meter 600 y axis id, and sort Y from low to high order please. | SELECT meter_600, ID FROM swimmer ORDER BY ID | SELECT "meter_600", "ID" FROM "swimmer" ORDER BY "ID" | 0.051758 |
CREATE TABLE table_2015453_1 (date VARCHAR2, attendance VARCHAR2)
| What date was the attendance 22000? | SELECT date FROM table_2015453_1 WHERE attendance = 22000 | SELECT "date" FROM "table_2015453_1" WHERE "attendance" = 22000 | 0.061523 |
CREATE TABLE table_name_83 (college VARCHAR2, school VARCHAR2)
| What college did the player with a school of crete-monee high school go to? | SELECT college FROM table_name_83 WHERE school = "crete-monee high school" | SELECT "college" FROM "table_name_83" WHERE "crete-monee high school" = "school" | 0.078125 |
CREATE TABLE table_1341690_18 (incumbent VARCHAR2, result VARCHAR2)
| How many incumbents resulted in a lost renomination republican gain? | SELECT COUNT(incumbent) FROM table_1341690_18 WHERE result = "Lost renomination Republican gain" | SELECT COUNT("incumbent") FROM "table_1341690_18" WHERE "Lost renomination Republican gain" = "result" | 0.099609 |
CREATE TABLE table_68158 ("Year" FLOAT, "Competition" CLOB, "Venue" CLOB, "Position" CLOB, "Event" CLOB)
| What's the average Year for the Position of 7th (sf)? | SELECT AVG("Year") FROM table_68158 WHERE "Position" = '7th (sf)' | SELECT AVG("Year") FROM "table_68158" WHERE "Position" = '7th (sf)' | 0.06543 |
CREATE TABLE company (Company_ID FLOAT, Name CLOB, Headquarters CLOB, Industry CLOB, Sales_in_Billion FLOAT, Profits_in_Billion FLOAT, Assets_in_Billion FLOAT, Market_Value_in_Billion FLOAT)
CREATE TABLE employment (Company_ID NUMBER, People_ID NUMBER, Year_working NUMBER)
CREATE TABLE people (People_ID NUMBER, Age NUMBER, Name CLOB, Nationality CLOB, Graduation_College CLOB)
| Show the different headquarters and number of companies at each headquarter with a bar chart, sort X-axis in desc order. | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters DESC | SELECT "Headquarters", COUNT(*) FROM "company" GROUP BY "Headquarters" ORDER BY "Headquarters" DESC | 0.09668 |
CREATE TABLE round (round_id NUMBER, member_id NUMBER, decoration_theme CLOB, rank_in_round NUMBER)
CREATE TABLE member (member_id NUMBER, name CLOB, country CLOB, college_id NUMBER)
CREATE TABLE college (college_id NUMBER, name CLOB, leader_name CLOB, college_location CLOB)
| Show the names of members and names of colleges they go to. | SELECT T2.name, T1.name FROM college AS T1 JOIN member AS T2 ON T1.college_id = T2.college_id | SELECT "T2"."name", "T1"."name" FROM "college" "T1" JOIN "member" "T2" ON "T1"."college_id" = "T2"."college_id" | 0.108398 |
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 lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
| count the number of patients whose marital status is divorced and diagnoses icd9 code is 5845? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.icd9_code = "5845" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "5845" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "DIVORCED" = "demographic"."marital_status" | 0.217773 |
CREATE TABLE table_8498 ("Club" CLOB, "Played" CLOB, "Drawn" CLOB, "Lost" CLOB, "Points for" CLOB, "Points against" CLOB, "Points difference" CLOB, "Points" CLOB)
| What is the number of matches played for the team with 0 draws and 33 points? | SELECT "Played" FROM table_8498 WHERE "Drawn" = '0' AND "Points" = '33' | SELECT "Played" FROM "table_8498" WHERE "Drawn" = '0' AND "Points" = '33' | 0.071289 |
CREATE TABLE table_35562 ("Game" FLOAT, "Date" FLOAT, "Opponent" CLOB, "Score" CLOB, "Location/attendance" CLOB, "Record" CLOB)
| What is the average date of the game with the Detroit Red Wings as the opponent? | SELECT AVG("Date") FROM table_35562 WHERE "Opponent" = 'detroit red wings' | SELECT AVG("Date") FROM "table_35562" WHERE "Opponent" = 'detroit red wings' | 0.074219 |
CREATE TABLE table_name_79 (goals_for NUMBER, played NUMBER)
| How many goals when more than 10 games played? | SELECT AVG(goals_for) FROM table_name_79 WHERE played > 10 | SELECT AVG("goals_for") FROM "table_name_79" WHERE "played" > 10 | 0.0625 |
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
| count the number of married patients who have acute myocardial infarction of inferolateral wall, initial episode of care diagnoses. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "AMI inferolateral, init" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "AMI inferolateral, init" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "MARRIED" = "demographic"."marital_status" | 0.237305 |
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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
| give me the number of patients whose discharge location is home health care and procedure icd9 code is 5771? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.icd9_code = "5771" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "5771" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "HOME HEALTH CARE" = "demographic"."discharge_location" | 0.232422 |
CREATE TABLE table_14824 ("Outcome" CLOB, "Date" CLOB, "Tournament" CLOB, "Surface" CLOB, "Opponent" CLOB, "Score" CLOB)
| What is the Tournament, when the Opponent is Patricia Mayr-Achleitner? | SELECT "Tournament" FROM table_14824 WHERE "Opponent" = 'patricia mayr-achleitner' | SELECT "Tournament" FROM "table_14824" WHERE "Opponent" = 'patricia mayr-achleitner' | 0.082031 |
CREATE TABLE wrestler (Wrestler_ID NUMBER, Name CLOB, Reign CLOB, Days_held CLOB, Location CLOB, Event CLOB)
CREATE TABLE Elimination (Elimination_ID CLOB, Wrestler_ID CLOB, Team CLOB, Eliminated_By CLOB, Elimination_Move CLOB, Time CLOB)
| Show different teams in eliminations and the number of eliminations from each team by a pie chart. | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team | SELECT "Team", COUNT(*) FROM "Elimination" GROUP BY "Team" | 0.056641 |
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| what is admission location of subject id 12220? | SELECT demographic.admission_location FROM demographic WHERE demographic.subject_id = "12220" | SELECT "demographic"."admission_location" FROM "demographic" WHERE "12220" = "demographic"."subject_id" | 0.100586 |
CREATE TABLE airports (name VARCHAR2, country VARCHAR2)
| Find the name of the airports located in Cuba or Argentina. | SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina' | SELECT "name" FROM "airports" WHERE "country" = 'Argentina' OR "country" = 'Cuba' | 0.079102 |
CREATE TABLE table_203_756 (id NUMBER, "year" NUMBER, "title" CLOB, "role" CLOB, "network" CLOB, "notes" CLOB)
| role played at least twice | SELECT "role" FROM table_203_756 GROUP BY "role" HAVING COUNT(*) >= 2 | SELECT "role" FROM "table_203_756" GROUP BY "role" HAVING COUNT(*) >= 2 | 0.069336 |
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)
| find the number of office admitted patients who have lab test item id 50818. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND lab.itemid = "50818" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "50818" = "lab"."itemid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "CLINIC REFERRAL/PREMATURE" = "demographic"."admission_location" | 0.21875 |
CREATE TABLE table_19191 ("Year" FLOAT, "League" CLOB, "Reg. Season" CLOB, "Playoffs" CLOB, "US Open Cup" CLOB, "Avg. Attendance" FLOAT)
| What was the regular season standings for the year when the playoffs reached the conference semifinals and the team did not qualify for the US Open Cup? | SELECT "Reg. Season" FROM table_19191 WHERE "Playoffs" = 'Conference Semifinals' AND "US Open Cup" = 'Did not qualify' | SELECT "Reg. Season" FROM "table_19191" WHERE "Playoffs" = 'Conference Semifinals' AND "US Open Cup" = 'Did not qualify' | 0.117188 |
CREATE TABLE table_22640 ("HR no." CLOB, "HR name" CLOB, "CR no." FLOAT, "LMS no." FLOAT, "Built" CLOB, "Works" CLOB, "Withdrawn" CLOB)
| What is the lowest cr number? | SELECT MIN("CR no.") FROM table_22640 | SELECT MIN("CR no.") FROM "table_22640" | 0.038086 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
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)
| provide the number of emergency room admitted patients who had diagnoses icd9 code 78039. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.icd9_code = "78039" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "78039" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "EMERGENCY ROOM ADMIT" = "demographic"."admission_location" | 0.234375 |
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE 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 d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
| what was the first value of the anion gap lab test of patient 30525 during the last hospital visit. | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30525 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap') ORDER BY labevents.charttime LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 30525 AND NOT "admissions"."dischtime" IS NULL GROUP BY "hadm_id" ORDER BY "admissions"."admittime" DESC FETCH FIRST 1 ROWS ONLY), "_u_1" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'anion gap' GROUP BY "itemid") SELECT "labevents"."valuenum" 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 NOT "_u_0"."" IS NULL AND NOT "_u_1"."" IS NULL ORDER BY "labevents"."charttime" FETCH FIRST 1 ROWS ONLY | 0.610352 |
CREATE TABLE table_25548630_1 (poles NUMBER)
| What are the most poles listed? | SELECT MAX(poles) FROM table_25548630_1 | SELECT MAX("poles") FROM "table_25548630_1" | 0.041992 |
CREATE TABLE table_21566 ("1391 Carelia" CLOB, "1398 Donnera" CLOB, "1405 Sibelius" CLOB, "1406 Komppa" CLOB, "1407 Lindel\\u00f6f" CLOB)
| what is the 1406 komppa of asteroid which 1391 carelia is 1460 haltia | SELECT "1406 Komppa" FROM table_21566 WHERE "1391 Carelia" = '1460 Haltia' | SELECT "1406 Komppa" FROM "table_21566" WHERE "1391 Carelia" = '1460 Haltia' | 0.074219 |
CREATE TABLE table_name_4 (class VARCHAR2, position VARCHAR2)
| What is the class for the position of lg? | SELECT class FROM table_name_4 WHERE position = "lg" | SELECT "class" FROM "table_name_4" WHERE "lg" = "position" | 0.056641 |
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE 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 regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
| For all employees who have the letters D or S in their first name, give me the comparison about the sum of salary over the hire_date bin hire_date by weekday. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | SELECT "HIRE_DATE", SUM("SALARY") FROM "employees" WHERE "FIRST_NAME" LIKE '%D%' OR "FIRST_NAME" LIKE '%S%' | 0.104492 |
CREATE TABLE table_41498 ("Tournament" CLOB, "2004" CLOB, "2005" CLOB, "2006" CLOB, "2007" CLOB, "2008" CLOB, "2009" CLOB, "2010" CLOB, "2011" CLOB)
| What 2006 has 1r as the 2007? | SELECT "2006" FROM table_41498 WHERE "2007" = '1r' | SELECT "2006" FROM "table_41498" WHERE "2007" = '1r' | 0.050781 |
CREATE TABLE table_203_355 (id NUMBER, "year" NUMBER, "total" NUMBER, "romanians" CLOB, "hungarians" CLOB, "roma" CLOB)
| what percent of the population were romanians according to the last year on this chart ? | SELECT "romanians" FROM table_203_355 ORDER BY "year" DESC LIMIT 1 | SELECT "romanians" FROM "table_203_355" ORDER BY "year" DESC FETCH FIRST 1 ROWS ONLY | 0.082031 |
CREATE TABLE table_6394 ("Round" FLOAT, "Pick" FLOAT, "Player" CLOB, "Position" CLOB, "School" CLOB)
| What is the lowest pick from the Furman School that is a round smaller than 8? | SELECT MIN("Pick") FROM table_6394 WHERE "School" = 'furman' AND "Round" < '8' | SELECT MIN("Pick") FROM "table_6394" WHERE "Round" < '8' AND "School" = 'furman' | 0.078125 |
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE 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 PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
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 Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name 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 CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
| Up vs Down votes by day of week of Accepted Answer. | SELECT TIME_TO_STR(p.CreationDate, 'WEEKDA%Y') AS Day, COUNT(*) AS Amount, SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes, SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS DownVotes, (CAST(SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS FLOAT) / CAST(SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS FLOAT)) AS UpVoteDownVoteRatio FROM Votes AS v JOIN Posts AS p ON v.PostId = p.AcceptedAnswerId WHERE PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL AND VoteTypeId IN (2, 3) GROUP BY TIME_TO_STR(p.CreationDate, 'WEEKDA%Y'), TIME_TO_STR(p.CreationDate, 'WEEKDA%Y') ORDER BY TIME_TO_STR(p.CreationDate, 'WEEKDA%Y') | SELECT TO_CHAR("p"."CreationDate", 'WEEKDAYYYY') AS "Day", COUNT(*) AS "Amount", SUM(CASE WHEN "VoteTypeId" = 2 THEN 1 ELSE 0 END) AS "UpVotes", SUM(CASE WHEN "VoteTypeId" = 3 THEN 1 ELSE 0 END) AS "DownVotes", CAST(SUM(CASE WHEN "VoteTypeId" = 2 THEN 1 ELSE 0 END) AS FLOAT) / NULLIF(CAST(SUM(CASE WHEN "VoteTypeId" = 3 THEN 1 ELSE 0 END) AS FLOAT), 0) AS "UpVoteDownVoteRatio" FROM "Votes" "v" JOIN "Posts" "p" ON "p"."AcceptedAnswerId" = "v"."PostId" AND NOT "p"."AcceptedAnswerId" IS NULL WHERE "PostTypeId" = 1 AND "VoteTypeId" IN (2, 3) GROUP BY TO_CHAR("p"."CreationDate", 'WEEKDAYYYY'), TO_CHAR("p"."CreationDate", 'WEEKDAYYYY') ORDER BY TO_CHAR("p"."CreationDate", 'WEEKDAYYYY') | 0.670898 |
CREATE TABLE table_42193 ("Name" CLOB, "Start of Reign" FLOAT, "End of Reign" CLOB, "Birth Name" CLOB, "Title" CLOB)
| What is the date of birth of the person who started their reign in 1986? | SELECT "Birth Name" FROM table_42193 WHERE "Start of Reign" = '1986' | SELECT "Birth Name" FROM "table_42193" WHERE "Start of Reign" = '1986' | 0.068359 |
CREATE TABLE table_name_91 (opponent VARCHAR2, week VARCHAR2, date VARCHAR2)
| What team was the opponent in a week earlier than 17 on June 17, 2006? | SELECT opponent FROM table_name_91 WHERE week < 17 AND date = "june 17, 2006" | SELECT "opponent" FROM "table_name_91" WHERE "date" = "june 17, 2006" AND "week" < 17 | 0.083008 |
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| what is the number of patients below 85 year of age with drug code msco15? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "85" AND prescriptions.formulary_drug_cd = "MSCO15" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "MSCO15" = "prescriptions"."formulary_drug_cd" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "85" > "demographic"."age" | 0.222656 |
CREATE TABLE table_name_98 (outcome VARCHAR2, opponent_in_the_final VARCHAR2)
| What is Outcome, when Opponent in The Final is 'Bill Scanlon'? | SELECT outcome FROM table_name_98 WHERE opponent_in_the_final = "bill scanlon" | SELECT "outcome" FROM "table_name_98" WHERE "bill scanlon" = "opponent_in_the_final" | 0.082031 |
CREATE TABLE table_73089 ("World Rank" FLOAT, "Company" CLOB, "Industry" CLOB, "Revenue ( billion $ ) " CLOB, "Profits ( billion $ ) " CLOB, "Assets ( billion $ ) " CLOB, "Market Value ( billion $ ) " CLOB)
| Name the industry for revenue being 2.1 | SELECT "Industry" FROM table_73089 WHERE "Revenue (billion $)" = '2.1' | SELECT "Industry" FROM "table_73089" WHERE "Revenue (billion $)" = '2.1' | 0.070313 |
CREATE TABLE table_22689 ("Rank" FLOAT, "Peak" CLOB, "Country" CLOB, "Island" CLOB, "Elevation ( m ) " FLOAT, "Prominence ( m ) " FLOAT, "Col ( m ) " FLOAT)
| What is the col (m) of the Barurumea Ridge peak? | SELECT MAX("Col (m)") FROM table_22689 WHERE "Peak" = 'Barurumea Ridge' | SELECT MAX("Col (m)") FROM "table_22689" WHERE "Peak" = 'Barurumea Ridge' | 0.071289 |
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_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 d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE 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 diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
| find out the number of patients admitted to the hospital in 2103. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE STRFTIME('%y', admissions.admittime) = '2103' | SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "admissions" WHERE STRFTIME('%y', "admissions"."admittime") = '2103' | 0.119141 |
CREATE TABLE table_name_90 (date VARCHAR2, venue VARCHAR2)
| On what Date was the Venue Los Angeles? | SELECT date FROM table_name_90 WHERE venue = "los angeles" | SELECT "date" FROM "table_name_90" WHERE "los angeles" = "venue" | 0.0625 |
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 lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| what is drug type and drug route of drug code onda4i? | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ONDA4I" | SELECT "prescriptions"."drug_type", "prescriptions"."route" FROM "prescriptions" WHERE "ONDA4I" = "prescriptions"."formulary_drug_cd" | 0.129883 |
CREATE TABLE table_name_21 (class VARCHAR2, identifier VARCHAR2)
| What Class has the Identifier of CBFX-FM-6? | SELECT class FROM table_name_21 WHERE identifier = "cbfx-fm-6" | SELECT "class" FROM "table_name_21" WHERE "cbfx-fm-6" = "identifier" | 0.066406 |
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
| what flights from ST. PAUL to KANSAS CITY on friday with DINNER served | 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, food_service WHERE ((date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND food_service.meal_code = flight.meal_code AND food_service.meal_description = 'DINNER') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'KANSAS CITY' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ST. PAUL' 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" = 25 AND "date_day"."month_number" = 6 AND "date_day"."year" = 1991 JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'ST. PAUL' 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 "food_service" ON "flight"."meal_code" = "food_service"."meal_code" AND "food_service"."meal_description" = 'DINNER' JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'KANSAS CITY' | 0.817383 |
CREATE TABLE table_34298 ("Grand Cru" CLOB, "Region" CLOB, "Village" CLOB, "Wine style" CLOB, "Vineyard surface ( 2010 ) " CLOB)
| What is the Vineyeard surface (2010) with a Village of Gevrey-Chambertin, and Grand Cru of Latrici res-Chambertin? | SELECT "Vineyard surface (2010)" FROM table_34298 WHERE "Village" = 'gevrey-chambertin' AND "Grand Cru" = 'latricières-chambertin' | SELECT "Vineyard surface (2010)" FROM "table_34298" WHERE "Grand Cru" = 'latricières-chambertin' AND "Village" = 'gevrey-chambertin' | 0.128906 |
CREATE TABLE table_60877 ("English Name" CLOB, "Simplified" CLOB, "Traditional" CLOB, "Pinyin" CLOB, "Area" CLOB, "Population" CLOB, "Density" CLOB)
| What is the population when the area is 4,575? | SELECT "Population" FROM table_60877 WHERE "Area" = '4,575' | SELECT "Population" FROM "table_60877" WHERE "Area" = '4,575' | 0.05957 |
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
| What is the size of 542 ? | SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 542 | SELECT DISTINCT "num_enrolled" FROM "course" WHERE "department" = 'EECS' AND "number" = 542 | 0.088867 |
CREATE TABLE resultsdata15 (sample_pk NUMBER, commod CLOB, commtype CLOB, lab CLOB, pestcode CLOB, testclass CLOB, concen NUMBER, lod NUMBER, conunit CLOB, confmethod CLOB, confmethod2 CLOB, annotate CLOB, quantitate CLOB, mean CLOB, extract CLOB, determin CLOB)
CREATE TABLE sampledata15 (sample_pk NUMBER, state CLOB, year CLOB, month CLOB, day CLOB, site CLOB, commod CLOB, source_id CLOB, variety CLOB, origin CLOB, country CLOB, disttype CLOB, commtype CLOB, claim CLOB, quantity NUMBER, growst CLOB, packst CLOB, distst CLOB)
| how was a specific sample tested? | SELECT sample_pk, testclass FROM resultsdata15 | SELECT "sample_pk", "testclass" FROM "resultsdata15" | 0.050781 |
CREATE TABLE Teachers (teacher_id NUMBER, address_id NUMBER, first_name VARCHAR2, middle_name VARCHAR2, last_name VARCHAR2, gender VARCHAR2, cell_mobile_number VARCHAR2, email_address VARCHAR2, other_details VARCHAR2)
CREATE TABLE Student_Addresses (student_id NUMBER, address_id NUMBER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental NUMBER, other_details VARCHAR2)
CREATE TABLE Behavior_Incident (incident_id NUMBER, incident_type_code VARCHAR2, student_id NUMBER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR2, recommendations VARCHAR2, other_details VARCHAR2)
CREATE TABLE Students_in_Detention (student_id NUMBER, detention_id NUMBER, incident_id NUMBER)
CREATE TABLE Ref_Incident_Type (incident_type_code VARCHAR2, incident_type_description VARCHAR2)
CREATE TABLE Detention (detention_id NUMBER, detention_type_code VARCHAR2, teacher_id NUMBER, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_summary VARCHAR2, other_details VARCHAR2)
CREATE TABLE Addresses (address_id NUMBER, line_1 VARCHAR2, line_2 VARCHAR2, line_3 VARCHAR2, city VARCHAR2, zip_postcode VARCHAR2, state_province_county VARCHAR2, country VARCHAR2, other_address_details VARCHAR2)
CREATE TABLE Students (student_id NUMBER, address_id NUMBER, first_name VARCHAR2, middle_name VARCHAR2, last_name VARCHAR2, cell_mobile_number VARCHAR2, email_address VARCHAR2, date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARCHAR2)
CREATE TABLE Ref_Detention_Type (detention_type_code VARCHAR2, detention_type_description VARCHAR2)
CREATE TABLE Ref_Address_Types (address_type_code VARCHAR2, address_type_description VARCHAR2)
CREATE TABLE Assessment_Notes (notes_id NUMBER, student_id NUMBER, teacher_id NUMBER, date_of_notes DATETIME, text_of_notes VARCHAR2, other_details VARCHAR2)
| Visualize a bar chart about the distribution of date_address_to and the average of monthly_rental bin date_address_to by weekday. | SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC | SELECT "date_address_to", AVG("monthly_rental") FROM "Student_Addresses" ORDER BY "monthly_rental" DESC | 0.100586 |
CREATE TABLE table_name_62 (parishes NUMBER, pastoral_region VARCHAR2, cemeteries VARCHAR2)
| How many Parishes in Merrimack which has 4 Cemeteries? | SELECT MIN(parishes) FROM table_name_62 WHERE pastoral_region = "merrimack" AND cemeteries < 4 | SELECT MIN("parishes") FROM "table_name_62" WHERE "cemeteries" < 4 AND "merrimack" = "pastoral_region" | 0.099609 |
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE 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 medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
| what are the five most frequently prescribed drugs within 2 months to the acute respiratory failure male patients aged 30s after they have been diagnosed with acute respiratory failure since 2 years ago? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.gender = 'male' AND patient.age BETWEEN 30 AND 39 AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-2 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.drugstarttime AND DATETIME(t2.drugstarttime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month') GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 5 | WITH "t2" AS (SELECT "patient"."uniquepid", "medication"."drugname", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" AND "patient"."age" <= 39 AND "patient"."age" >= 30 AND "patient"."gender" = 'male' WHERE DATETIME("medication"."drugstarttime") >= DATETIME(CURRENT_TIME(), '-2 year')), "t3" AS (SELECT "t2"."drugname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" "t2" ON "diagnosis"."diagnosistime" < "t2"."drugstarttime" AND "patient"."uniquepid" = "t2"."uniquepid" AND DATETIME("diagnosis"."diagnosistime") <= DATETIME("t2"."drugstarttime") AND DATETIME("diagnosis"."diagnosistime", '+2 month') >= DATETIME("t2"."drugstarttime") WHERE "diagnosis"."diagnosisname" = 'acute respiratory failure' AND DATETIME("diagnosis"."diagnosistime") >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY "t2"."drugname") SELECT "t3"."drugname" FROM "t3" "t3" WHERE "t3"."c1" <= 5 | 1.03418 |
CREATE TABLE table_name_47 (pick NUMBER, round VARCHAR2, overall VARCHAR2)
| How many picks had a round smaller than 6 and an overall bigger than 153? | SELECT SUM(pick) FROM table_name_47 WHERE round < 6 AND overall > 153 | SELECT SUM("pick") FROM "table_name_47" WHERE "overall" > 153 AND "round" < 6 | 0.075195 |
CREATE TABLE table_13304 ("Period" CLOB, "Internet Explorer" CLOB, "Firefox" CLOB, "Safari" CLOB, "Opera" CLOB, "Netscape" CLOB, "Other Mozilla" CLOB)
| What percentage of users were using Firefox during the period in which *0.77% were using Netscape? | SELECT "Firefox" FROM table_13304 WHERE "Netscape" = '*0.77%' | SELECT "Firefox" FROM "table_13304" WHERE "Netscape" = '*0.77%' | 0.061523 |
CREATE TABLE table_40319 ("Party" CLOB, "1985" FLOAT, "1987" FLOAT, "1990" FLOAT, "1995" FLOAT, "1999" FLOAT, "2003" FLOAT, "2007" FLOAT, "2011" FLOAT)
| What is the highest 2003 value with a 1990 greater than 74, a 125 value in 1985, and a 1995 value greater than 130? | SELECT MAX("2003") FROM table_40319 WHERE "1990" > '74' AND "1985" = '125' AND "1995" > '130' | SELECT MAX("2003") FROM "table_40319" WHERE "1985" = '125' AND "1990" > '74' AND "1995" > '130' | 0.092773 |
CREATE TABLE table_32025 ("Res." CLOB, "Record" CLOB, "Opponent" CLOB, "Method" CLOB, "Event" CLOB, "Round" FLOAT, "Time" CLOB, "Location" CLOB)
| When there was a draw, what was the time? | SELECT "Time" FROM table_32025 WHERE "Res." = 'draw' | SELECT "Time" FROM "table_32025" WHERE "Res." = 'draw' | 0.052734 |
CREATE TABLE table_train_12 ("id" NUMBER, "sequential_organ_failure_assessment_sofa" NUMBER, "active_infection" BOOLEAN, "taking_pioglitazone" BOOLEAN, "taking_rosiglitazone" BOOLEAN, "body_weight" FLOAT, "diabetic" CLOB, "organ_failure" BOOLEAN, "age" FLOAT, "NOUSE" FLOAT)
| sepsis patients must have suspected or confirmed infection and organ dysfunction as defined by a sofa >= 2 above baseline ( if no baseline data available, sofa assumed to be 0 ) | SELECT * FROM table_train_12 WHERE active_infection = 1 AND (organ_failure = 1 OR sequential_organ_failure_assessment_sofa >= 2) | SELECT * FROM "table_train_12" WHERE "active_infection" = 1 AND ("organ_failure" = 1 OR "sequential_organ_failure_assessment_sofa" >= 2) | 0.132813 |
CREATE TABLE table_10183 ("Year" FLOAT, "Title" CLOB, "Genre" CLOB, "Role" CLOB, "Director" CLOB)
| Who directed the eula goodnight movie after 1949? | SELECT "Director" FROM table_10183 WHERE "Year" > '1949' AND "Role" = 'eula goodnight' | SELECT "Director" FROM "table_10183" WHERE "Role" = 'eula goodnight' AND "Year" > '1949' | 0.085938 |
CREATE TABLE table_204_492 (id NUMBER, "year" NUMBER, "competition" CLOB, "venue" CLOB, "position" CLOB, "notes" CLOB)
| how many venues are there ? | SELECT COUNT("competition") FROM table_204_492 | SELECT COUNT("competition") FROM "table_204_492" | 0.046875 |
CREATE TABLE table_37592 ("Region" CLOB, "Date" FLOAT, "Label" CLOB, "Format" CLOB, "Catalog" CLOB)
| What format was used for Mobil 1? | SELECT "Format" FROM table_37592 WHERE "Catalog" = 'mobil 1' | SELECT "Format" FROM "table_37592" WHERE "Catalog" = 'mobil 1' | 0.060547 |
CREATE TABLE table_name_90 (location VARCHAR2, result VARCHAR2, winner VARCHAR2, year VARCHAR2)
| What is the Location, when the Winner is the Baltimore Colts, when the Year is before 1972, and when the Result is 14-6? | SELECT location FROM table_name_90 WHERE winner = "baltimore colts" AND year < 1972 AND result = "14-6" | SELECT "location" FROM "table_name_90" WHERE "14-6" = "result" AND "baltimore colts" = "winner" AND "year" < 1972 | 0.110352 |
CREATE TABLE table_211714_2 (rank VARCHAR2, season VARCHAR2)
| Name the number of rank for season 6 | SELECT COUNT(rank) FROM table_211714_2 WHERE season = 6 | SELECT COUNT("rank") FROM "table_211714_2" WHERE "season" = 6 | 0.05957 |
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 locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
| 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, for salary, hire_date, visualize the trend, rank in asc by the X please. | SELECT HIRE_DATE, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE | SELECT "HIRE_DATE", "SALARY" FROM "employees" WHERE ("COMMISSION_PCT" <> "null" OR "DEPARTMENT_ID" <> 40) AND ("DEPARTMENT_ID" <> 40 OR "SALARY" <= 12000) AND ("DEPARTMENT_ID" <> 40 OR "SALARY" >= 8000) ORDER BY "HIRE_DATE" | 0.217773 |
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE 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 transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
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 labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
| what was the number of drugs patient 30509 was prescribed until 1 year ago? | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30509) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-1 year') | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 30509 GROUP BY "hadm_id") SELECT COUNT(*) FROM "prescriptions" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE DATETIME("prescriptions"."startdate") <= DATETIME(CURRENT_TIME(), '-1 year') AND NOT "_u_0"."" IS NULL | 0.326172 |
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
| what was patient 016-27397's intake for the first time on 12/26/this year? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-27397')) AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', intakeoutput.intakeoutputtime) = '12-26' ORDER BY intakeoutput.intakeoutputtime LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '016-27397' 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 "intakeoutput"."celllabel" FROM "intakeoutput" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."cellpath" LIKE '%intake%' AND DATETIME("intakeoutput"."intakeoutputtime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_1"."" IS NULL AND STRFTIME('%m-%d', "intakeoutput"."intakeoutputtime") = '12-26' ORDER BY "intakeoutput"."intakeoutputtime" FETCH FIRST 1 ROWS ONLY | 0.791016 |
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE 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 d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE 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 diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
| what were the four most frequently prescribed drugs at the same time, since 4 years ago, among the patients who were prescribed with heparin flush port (10units/ml)? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'heparin flush port (10units/ml)' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 4 | WITH "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."drug", "prescriptions"."startdate" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" WHERE DATETIME("prescriptions"."startdate") >= DATETIME(CURRENT_TIME(), '-4 year')), "t3" AS (SELECT "t2"."drug", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" JOIN "t2" "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND DATETIME("prescriptions"."startdate") = DATETIME("t2"."startdate") WHERE "prescriptions"."drug" = 'heparin flush port (10units/ml)' AND DATETIME("prescriptions"."startdate") >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY "t2"."drug") SELECT "t3"."drug" FROM "t3" "t3" WHERE "t3"."c1" <= 4 | 0.789063 |
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount 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 VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE PostTypes (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 PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId 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 SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE 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 ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
| Top N .net tagged question answerers in Turkey. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation, u.Location, u.LastAccessDate, COUNT(*) AS DotNetAnswers FROM Users AS u, Posts AS p, Posts AS pp WHERE u.Id IN (SELECT Id FROM Users WHERE LOWER(Location) LIKE ('%turkey%') OR LOWER(Location) LIKE ('%istanbul%') OR LOWER(Location) LIKE ('%ankara%') OR LOWER(Location) LIKE ('%izmir%')) AND p.OwnerUserId = u.Id AND pp.Id = p.ParentId AND pp.Tags LIKE ('%.net%') GROUP BY u.Id, u.Reputation, u.Location, u.LastAccessDate LIMIT 100 | SELECT ROW_NUMBER() OVER (ORDER BY "Reputation" DESC) AS "#", "u"."Id" AS "user_link", "u"."Reputation", "u"."Location", "u"."LastAccessDate", COUNT(*) AS "DotNetAnswers" FROM "Users" "u" JOIN "Posts" "p" ON "p"."OwnerUserId" = "u"."Id" JOIN "Posts" "pp" ON "p"."ParentId" = "pp"."Id" AND "pp"."Tags" LIKE '%.net%' WHERE "u"."Id" IN (SELECT "Id" FROM "Users" WHERE LOWER("Location") LIKE '%ankara%' OR LOWER("Location") LIKE '%istanbul%' OR LOWER("Location") LIKE '%izmir%' OR LOWER("Location") LIKE '%turkey%') GROUP BY "u"."Id", "u"."Reputation", "u"."Location", "u"."LastAccessDate" FETCH FIRST 100 ROWS ONLY | 0.59668 |
CREATE TABLE table_204_471 (id NUMBER, "year" NUMBER, "title" CLOB, "peak chart positions\ ger" NUMBER, "label" CLOB, "artist" CLOB)
| how many compilation albums were released after 2000 ? | SELECT COUNT("title") FROM table_204_471 WHERE "year" > 2000 | SELECT COUNT("title") FROM "table_204_471" WHERE "year" > 2000 | 0.060547 |
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE 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 vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
| list the four most frequent drugs that were prescribed to patients within the same month after having been prescribed with rocuronium bromide until 2104? | 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 = 'rocuronium bromide' AND STRFTIME('%y', medication.drugstarttime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', medication.drugstarttime) <= '2104') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.drugstarttime < t2.drugstarttime AND DATETIME(t1.drugstarttime, 'start of month') = DATETIME(t2.drugstarttime, 'start of month') GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 4 | WITH "t2" AS (SELECT "patient"."uniquepid", "medication"."drugname", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" WHERE STRFTIME('%y', "medication"."drugstarttime") <= '2104'), "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 "medication"."drugstarttime" < "t2"."drugstarttime" AND "patient"."uniquepid" = "t2"."uniquepid" AND DATETIME("medication"."drugstarttime", 'start of month') = DATETIME("t2"."drugstarttime", 'start of month') WHERE "medication"."drugname" = 'rocuronium bromide' AND STRFTIME('%y', "medication"."drugstarttime") <= '2104' GROUP BY "t2"."drugname") SELECT "t3"."drugname" FROM "t3" "t3" WHERE "t3"."c1" <= 4 | 0.849609 |
CREATE TABLE table_11545282_5 (school_club_team VARCHAR2, years_for_jazz VARCHAR2)
| How many schools are listed for the player who played the years for Jazz in 2010-11? | SELECT COUNT(school_club_team) FROM table_11545282_5 WHERE years_for_jazz = "2010-11" | SELECT COUNT("school_club_team") FROM "table_11545282_5" WHERE "2010-11" = "years_for_jazz" | 0.088867 |
CREATE TABLE table_name_41 (club_province VARCHAR2, player VARCHAR2)
| Which Club/province has a Player of david penalva? | SELECT club_province FROM table_name_41 WHERE player = "david penalva" | SELECT "club_province" FROM "table_name_41" WHERE "david penalva" = "player" | 0.074219 |
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
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 ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
| IndexOutOfBoundException in title of Java question. | SELECT Id AS "post_link", Score, ViewCount, CreationDate, ClosedDate FROM Posts WHERE Tags LIKE '%java%' AND Title LIKE '%IndexOutOfBound%' AND YEAR(CreationDate) = 2020 ORDER BY Score DESC | SELECT "Id" AS "post_link", "Score", "ViewCount", "CreationDate", "ClosedDate" FROM "Posts" WHERE "Tags" LIKE '%java%' AND "Title" LIKE '%IndexOutOfBound%' AND YEAR("CreationDate") = 2020 ORDER BY "Score" DESC | 0.204102 |
CREATE TABLE appellations (No NUMBER, Appelation CLOB, County CLOB, State CLOB, Area CLOB, isAVA CLOB)
CREATE TABLE wine (No NUMBER, Grape CLOB, Winery CLOB, Appelation CLOB, State CLOB, Name CLOB, Year NUMBER, Price NUMBER, Score NUMBER, Cases NUMBER, Drink CLOB)
CREATE TABLE grapes (ID NUMBER, Grape CLOB, Color CLOB)
| Show mean max(price) from each year | SELECT Year, AVG(MAX(Price)) FROM wine | SELECT "Year", AVG(MAX("Price")) FROM "wine" | 0.042969 |
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE 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 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)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
| when did patient 47460 receive a inject into thorax cavit procedure for the first time on their last hospital visit? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'inject into thorax cavit') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 47460 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY procedures_icd.charttime LIMIT 1 | WITH "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 47460 AND NOT "admissions"."dischtime" IS NULL GROUP BY "hadm_id" ORDER BY "admissions"."admittime" DESC FETCH FIRST 1 ROWS ONLY) SELECT "procedures_icd"."charttime" FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'inject into thorax cavit' LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "procedures_icd"."hadm_id" WHERE NOT "_u_1"."" IS NULL ORDER BY "procedures_icd"."charttime" FETCH FIRST 1 ROWS ONLY | 0.582031 |
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
| had patient 031-22988 been at an er until 2 years ago? | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '031-22988' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-2 year') | SELECT COUNT(*) > 0 FROM "patient" WHERE "patient"."hospitaladmitsource" = 'emergency department' AND "patient"."uniquepid" = '031-22988' AND DATETIME("patient"."unitadmittime") <= DATETIME(CURRENT_TIME(), '-2 year') | 0.210938 |
CREATE TABLE mountain (Mountain_ID NUMBER, Name CLOB, Height FLOAT, Prominence FLOAT, Range CLOB, Country CLOB)
CREATE TABLE climber (Climber_ID NUMBER, Name CLOB, Country CLOB, Time CLOB, Points FLOAT, Mountain_ID NUMBER)
| Give me a histogram for how many climbers are from each country?, and show by the y axis from low to high. | SELECT Country, COUNT(*) FROM climber GROUP BY Country ORDER BY COUNT(*) | SELECT "Country", COUNT(*) FROM "climber" GROUP BY "Country" ORDER BY COUNT(*) | 0.076172 |
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note 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 flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE 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 flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2)
| get first flight from OAKLAND to SALT LAKE CITY on thursday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((((flight.departure_time > flight.arrival_time) AND date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) OR (date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND NOT (flight.departure_time > flight.arrival_time))) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT LAKE CITY' 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) AND flight.arrival_time = (SELECT MIN(FLIGHTalias1.arrival_time) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, date_day AS DATE_DAYalias1, days AS DAYSalias1, flight AS FLIGHTalias1 WHERE ((((FLIGHTalias1.departure_time > FLIGHTalias1.arrival_time) AND DATE_DAYalias1.day_number = 24 AND DATE_DAYalias1.month_number = 5 AND DATE_DAYalias1.year = 1991 AND DAYSalias1.day_name = DATE_DAYalias1.day_name AND FLIGHTalias1.flight_days = DAYSalias1.days_code) OR (DATE_DAYalias1.day_number = 24 AND DATE_DAYalias1.month_number = 5 AND DATE_DAYalias1.year = 1991 AND DAYSalias1.day_name = DATE_DAYalias1.day_name AND FLIGHTalias1.flight_days = DAYSalias1.days_code AND NOT (FLIGHTalias1.departure_time > FLIGHTalias1.arrival_time))) AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'SALT LAKE CITY' AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'OAKLAND' AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code) | WITH "_u_0" AS (SELECT MIN("FLIGHTalias1"."arrival_time") FROM "airport_service" "AIRPORT_SERVICEalias2" CROSS JOIN "days" "DAYSalias1" JOIN "city" "CITYalias2" ON "AIRPORT_SERVICEalias2"."city_code" = "CITYalias2"."city_code" AND "CITYalias2"."city_name" = 'OAKLAND' JOIN "flight" "FLIGHTalias1" ON "AIRPORT_SERVICEalias2"."airport_code" = "FLIGHTalias1"."from_airport" JOIN "airport_service" "AIRPORT_SERVICEalias3" ON "AIRPORT_SERVICEalias3"."airport_code" = "FLIGHTalias1"."to_airport" JOIN "date_day" "DATE_DAYalias1" ON ("DATE_DAYalias1"."day_name" = "DAYSalias1"."day_name" AND "DATE_DAYalias1"."day_number" = 24 AND "DATE_DAYalias1"."month_number" = 5 AND "DATE_DAYalias1"."year" = 1991 AND "DAYSalias1"."days_code" = "FLIGHTalias1"."flight_days" AND "FLIGHTalias1"."arrival_time" < "FLIGHTalias1"."departure_time") OR ("DATE_DAYalias1"."day_name" = "DAYSalias1"."day_name" AND "DATE_DAYalias1"."day_number" = 24 AND "DATE_DAYalias1"."month_number" = 5 AND "DATE_DAYalias1"."year" = 1991 AND "DAYSalias1"."days_code" = "FLIGHTalias1"."flight_days" AND "FLIGHTalias1"."arrival_time" >= "FLIGHTalias1"."departure_time") JOIN "city" "CITYalias3" ON "AIRPORT_SERVICEalias3"."city_code" = "CITYalias3"."city_code" AND "CITYalias3"."city_name" = 'SALT LAKE CITY') SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "date_day" ON "date_day"."day_number" = 24 AND "date_day"."month_number" = 5 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" AND ("flight"."arrival_time" < "flight"."departure_time" OR "flight"."arrival_time" >= "flight"."departure_time") JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "_u_0" "_u_0" ON "_u_0"."" = "flight"."arrival_time" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'SALT LAKE CITY' | 2.104492 |
CREATE TABLE table_204_796 (id NUMBER, "network name" CLOB, "flagship" CLOB, "programming type" CLOB, "owner" CLOB, "affiliates" NUMBER)
| which is the only station with 8 affiliates ? | SELECT "network name" FROM table_204_796 WHERE "affiliates" = 8 | SELECT "network name" FROM "table_204_796" WHERE "affiliates" = 8 | 0.063477 |
CREATE TABLE table_17282875_2 (team__number2 VARCHAR2, team__number1 VARCHAR2)
| Who played against team 1 Vit ria? | SELECT team__number2 FROM table_17282875_2 WHERE team__number1 = "Vitória" | SELECT "team__number2" FROM "table_17282875_2" WHERE "Vitória" = "team__number1" | 0.078125 |
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE 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 offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year 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_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE 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 instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE 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)
| Was an exam set for 280 by Prof. Umulisa Saidi last time she taught it ? | SELECT DISTINCT course_offering.has_final_exam FROM course_offering INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offering.semester = (SELECT MAX(SEMESTERalias0.semester_id) FROM semester AS SEMESTERalias0 INNER JOIN course_offering AS COURSE_OFFERINGalias1 ON SEMESTERalias0.semester_id = COURSE_OFFERINGalias1.semester INNER JOIN course AS COURSEalias1 ON COURSEalias1.course_id = COURSE_OFFERINGalias1.course_id INNER JOIN offering_instructor AS OFFERING_INSTRUCTORalias1 ON OFFERING_INSTRUCTORalias1.offering_id = COURSE_OFFERINGalias1.offering_id INNER JOIN instructor AS INSTRUCTORalias1 ON OFFERING_INSTRUCTORalias1.instructor_id = INSTRUCTORalias1.instructor_id WHERE COURSEalias1.department = 'EECS' AND COURSEalias1.number = 280 AND INSTRUCTORalias1.name LIKE '%Umulisa Saidi%' AND SEMESTERalias0.year < 2016) AND course.department = 'EECS' AND course.number = 280 AND instructor.name LIKE '%Umulisa Saidi%' | WITH "_u_0" AS (SELECT MAX("SEMESTERalias0"."semester_id") FROM "semester" "SEMESTERalias0" JOIN "course_offering" "COURSE_OFFERINGalias1" ON "COURSE_OFFERINGalias1"."semester" = "SEMESTERalias0"."semester_id" JOIN "course" "COURSEalias1" ON "COURSE_OFFERINGalias1"."course_id" = "COURSEalias1"."course_id" AND "COURSEalias1"."department" = 'EECS' AND "COURSEalias1"."number" = 280 JOIN "offering_instructor" "OFFERING_INSTRUCTORalias1" ON "COURSE_OFFERINGalias1"."offering_id" = "OFFERING_INSTRUCTORalias1"."offering_id" JOIN "instructor" "INSTRUCTORalias1" ON "INSTRUCTORalias1"."instructor_id" = "OFFERING_INSTRUCTORalias1"."instructor_id" AND "INSTRUCTORalias1"."name" LIKE '%Umulisa Saidi%' WHERE "SEMESTERalias0"."year" < 2016) SELECT DISTINCT "course_offering"."has_final_exam" FROM "course_offering" JOIN "_u_0" "_u_0" ON "_u_0"."" = "course_offering"."semester" JOIN "course" ON "course"."course_id" = "course_offering"."course_id" AND "course"."department" = 'EECS' AND "course"."number" = 280 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 '%Umulisa Saidi%' | 1.210938 |
CREATE TABLE table_48254 ("Country" CLOB, "Preliminary" FLOAT, "Interview" FLOAT, "Swimsuit" FLOAT, "Evening Gown" FLOAT, "Average" FLOAT)
| What is the swimsuit number when the preliminary is 8.721, and the average is more than 8.781? | SELECT COUNT("Swimsuit") FROM table_48254 WHERE "Preliminary" = '8.721' AND "Average" > '8.781' | SELECT COUNT("Swimsuit") FROM "table_48254" WHERE "Average" > '8.781' AND "Preliminary" = '8.721' | 0.094727 |
CREATE TABLE table_65128 ("Heat" FLOAT, "Lane" FLOAT, "Name" CLOB, "Nationality" CLOB, "Time" CLOB)
| What was Christian Kubusch's lane when the heat was more than 2 and time was DNS? | SELECT SUM("Lane") FROM table_65128 WHERE "Time" = 'dns' AND "Name" = 'christian kubusch' AND "Heat" > '2' | SELECT SUM("Lane") FROM "table_65128" WHERE "Heat" > '2' AND "Name" = 'christian kubusch' AND "Time" = 'dns' | 0.105469 |
CREATE TABLE table_67052 ("Quarter" CLOB, "Score" CLOB, "Club" CLOB, "Opponent" CLOB, "Year" CLOB, "Round" CLOB, "Venue" CLOB)
| Which opponent has a Round of 12? | SELECT "Opponent" FROM table_67052 WHERE "Round" = '12' | SELECT "Opponent" FROM "table_67052" WHERE "Round" = '12' | 0.055664 |
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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE 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 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)
| indicate the monthly average amount of volume (ml) insulin patient 021-172222 has received since 86 months ago. | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-172222')) AND intakeoutput.celllabel = 'volume (ml) insulin' AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-86 month') GROUP BY STRFTIME('%y-%m', intakeoutput.intakeoutputtime) | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '021-172222' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT AVG("intakeoutput"."cellvaluenumeric") FROM "intakeoutput" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = 'volume (ml) insulin' AND "intakeoutput"."cellpath" LIKE '%intake%' AND DATETIME("intakeoutput"."intakeoutputtime") >= DATETIME(CURRENT_TIME(), '-86 month') AND NOT "_u_1"."" IS NULL GROUP BY STRFTIME('%y-%m', "intakeoutput"."intakeoutputtime") | 0.756836 |
CREATE TABLE team_half (year NUMBER, league_id CLOB, team_id CLOB, half NUMBER, div_id CLOB, div_win CLOB, rank NUMBER, g NUMBER, w NUMBER, l NUMBER)
CREATE TABLE home_game (year NUMBER, league_id CLOB, team_id CLOB, park_id CLOB, span_first CLOB, span_last CLOB, games NUMBER, openings NUMBER, attendance NUMBER)
CREATE TABLE pitching_postseason (player_id CLOB, year NUMBER, round CLOB, team_id CLOB, league_id CLOB, w NUMBER, l NUMBER, g NUMBER, gs NUMBER, cg NUMBER, sho NUMBER, sv NUMBER, ipouts NUMBER, h NUMBER, er NUMBER, hr NUMBER, bb NUMBER, so NUMBER, baopp CLOB, era NUMBER, ibb NUMBER, wp NUMBER, hbp NUMBER, bk NUMBER, bfp NUMBER, gf NUMBER, r NUMBER, sh NUMBER, sf NUMBER, g_idp NUMBER)
CREATE TABLE fielding_outfield (player_id CLOB, year NUMBER, stint NUMBER, glf NUMBER, gcf NUMBER, grf NUMBER)
CREATE TABLE team (year NUMBER, league_id CLOB, team_id CLOB, franchise_id CLOB, div_id CLOB, rank NUMBER, g NUMBER, ghome NUMBER, w NUMBER, l NUMBER, div_win CLOB, wc_win CLOB, lg_win CLOB, ws_win CLOB, r NUMBER, ab NUMBER, h NUMBER, double NUMBER, triple NUMBER, hr NUMBER, bb NUMBER, so NUMBER, sb NUMBER, cs NUMBER, hbp NUMBER, sf NUMBER, ra NUMBER, er NUMBER, era NUMBER, cg NUMBER, sho NUMBER, sv NUMBER, ipouts NUMBER, ha NUMBER, hra NUMBER, bba NUMBER, soa NUMBER, e NUMBER, dp NUMBER, fp NUMBER, name CLOB, park CLOB, attendance NUMBER, bpf NUMBER, ppf NUMBER, team_id_br CLOB, team_id_lahman45 CLOB, team_id_retro CLOB)
CREATE TABLE player (player_id CLOB, birth_year NUMBER, birth_month NUMBER, birth_day NUMBER, birth_country CLOB, birth_state CLOB, birth_city CLOB, death_year NUMBER, death_month NUMBER, death_day NUMBER, death_country CLOB, death_state CLOB, death_city CLOB, name_first CLOB, name_last CLOB, name_given CLOB, weight NUMBER, height NUMBER, bats CLOB, throws CLOB, debut CLOB, final_game CLOB, retro_id CLOB, bbref_id CLOB)
CREATE TABLE fielding (player_id CLOB, year NUMBER, stint NUMBER, team_id CLOB, league_id CLOB, pos CLOB, g NUMBER, gs NUMBER, inn_outs NUMBER, po NUMBER, a NUMBER, e NUMBER, dp NUMBER, pb NUMBER, wp NUMBER, sb NUMBER, cs NUMBER, zr NUMBER)
CREATE TABLE player_college (player_id CLOB, college_id CLOB, year NUMBER)
CREATE TABLE postseason (year NUMBER, round CLOB, team_id_winner CLOB, league_id_winner CLOB, team_id_loser CLOB, league_id_loser CLOB, wins NUMBER, losses NUMBER, ties NUMBER)
CREATE TABLE all_star (player_id CLOB, year NUMBER, game_num NUMBER, game_id CLOB, team_id CLOB, league_id CLOB, gp NUMBER, starting_pos NUMBER)
CREATE TABLE manager_award_vote (award_id CLOB, year NUMBER, league_id CLOB, player_id CLOB, points_won NUMBER, points_max NUMBER, votes_first NUMBER)
CREATE TABLE player_award (player_id CLOB, award_id CLOB, year NUMBER, league_id CLOB, tie CLOB, notes CLOB)
CREATE TABLE batting (player_id CLOB, year NUMBER, stint NUMBER, team_id CLOB, league_id CLOB, g NUMBER, ab NUMBER, r NUMBER, h NUMBER, double NUMBER, triple NUMBER, hr NUMBER, rbi NUMBER, sb NUMBER, cs NUMBER, bb NUMBER, so NUMBER, ibb NUMBER, hbp NUMBER, sh NUMBER, sf NUMBER, g_idp NUMBER)
CREATE TABLE manager_half (player_id CLOB, year NUMBER, team_id CLOB, league_id CLOB, inseason NUMBER, half NUMBER, g NUMBER, w NUMBER, l NUMBER, rank NUMBER)
CREATE TABLE manager_award (player_id CLOB, award_id CLOB, year NUMBER, league_id CLOB, tie CLOB, notes NUMBER)
CREATE TABLE college (college_id CLOB, name_full CLOB, city CLOB, state CLOB, country CLOB)
CREATE TABLE hall_of_fame (player_id CLOB, yearid NUMBER, votedby CLOB, ballots NUMBER, needed NUMBER, votes NUMBER, inducted CLOB, category CLOB, needed_note CLOB)
CREATE TABLE salary (year NUMBER, team_id CLOB, league_id CLOB, player_id CLOB, salary NUMBER)
CREATE TABLE fielding_postseason (player_id CLOB, year NUMBER, team_id CLOB, league_id CLOB, round CLOB, pos CLOB, g NUMBER, gs NUMBER, inn_outs NUMBER, po NUMBER, a NUMBER, e NUMBER, dp NUMBER, tp NUMBER, pb NUMBER, sb NUMBER, cs NUMBER)
CREATE TABLE appearances (year NUMBER, team_id CLOB, league_id CLOB, player_id CLOB, g_all NUMBER, gs NUMBER, g_batting NUMBER, g_defense NUMBER, g_p NUMBER, g_c NUMBER, g_1b NUMBER, g_2b NUMBER, g_3b NUMBER, g_ss NUMBER, g_lf NUMBER, g_cf NUMBER, g_rf NUMBER, g_of NUMBER, g_dh NUMBER, g_ph NUMBER, g_pr NUMBER)
CREATE TABLE pitching (player_id CLOB, year NUMBER, stint NUMBER, team_id CLOB, league_id CLOB, w NUMBER, l NUMBER, g NUMBER, gs NUMBER, cg NUMBER, sho NUMBER, sv NUMBER, ipouts NUMBER, h NUMBER, er NUMBER, hr NUMBER, bb NUMBER, so NUMBER, baopp NUMBER, era NUMBER, ibb NUMBER, wp NUMBER, hbp NUMBER, bk NUMBER, bfp NUMBER, gf NUMBER, r NUMBER, sh NUMBER, sf NUMBER, g_idp NUMBER)
CREATE TABLE player_award_vote (award_id CLOB, year NUMBER, league_id CLOB, player_id CLOB, points_won NUMBER, points_max NUMBER, votes_first NUMBER)
CREATE TABLE team_franchise (franchise_id CLOB, franchise_name CLOB, active CLOB, na_assoc CLOB)
CREATE TABLE manager (player_id CLOB, year NUMBER, team_id CLOB, league_id CLOB, inseason NUMBER, g NUMBER, w NUMBER, l NUMBER, rank NUMBER, plyr_mgr CLOB)
CREATE TABLE park (park_id CLOB, park_name CLOB, park_alias CLOB, city CLOB, state CLOB, country CLOB)
CREATE TABLE batting_postseason (year NUMBER, round CLOB, player_id CLOB, team_id CLOB, league_id CLOB, g NUMBER, ab NUMBER, r NUMBER, h NUMBER, double NUMBER, triple NUMBER, hr NUMBER, rbi NUMBER, sb NUMBER, cs NUMBER, bb NUMBER, so NUMBER, ibb NUMBER, hbp NUMBER, sh NUMBER, sf NUMBER, g_idp NUMBER)
| Reutrn a bar chart to bin the year into day of the week interval, and return the total number of times the team Boston Red Stockings won in the postseasons, I want to show from high to low by the y axis. | SELECT year, SUM(COUNT(*)) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY SUM(COUNT(*)) DESC | SELECT "year", SUM(COUNT(*)) FROM "postseason" "T1" JOIN "team" "T2" ON "T1"."team_id_winner" = "T2"."team_id_br" AND "T2"."name" = 'Boston Red Stockings' ORDER BY SUM(COUNT(*)) DESC | 0.177734 |
CREATE TABLE table_name_7 (award VARCHAR2, film VARCHAR2)
| What award did the film Ozone win? | SELECT award FROM table_name_7 WHERE film = "ozone" | SELECT "award" FROM "table_name_7" WHERE "film" = "ozone" | 0.055664 |
CREATE TABLE table_204_872 (id NUMBER, "name" CLOB, "completed" CLOB, "architect" CLOB, "location" CLOB, "year of listing & ref ( s ) " NUMBER)
| what is the difference , in years , between the completion dates of 53 king street and castlefield congregational chapel ? | SELECT ABS((SELECT "completed" FROM table_204_872 WHERE "name" = '53 king street') - (SELECT "completed" FROM table_204_872 WHERE "name" = 'castlefield congregational chapel')) | SELECT ABS((SELECT "completed" FROM "table_204_872" WHERE "name" = '53 king street') - (SELECT "completed" FROM "table_204_872" WHERE "name" = 'castlefield congregational chapel')) | 0.175781 |
CREATE TABLE table_74372 ("Rank" FLOAT, "Rider" CLOB, "Mon 30 May" CLOB, "Tues 31 May" CLOB, "Wed 1 June" CLOB, "Thurs 2 June" CLOB, "Fri 3 June" CLOB)
| What is the Fri 3 June time for the rider with a Weds 1 June time of 18' 22.66 123.182mph? | SELECT "Fri 3 June" FROM table_74372 WHERE "Wed 1 June" = '18'' 22.66 123.182mph' | SELECT "Fri 3 June" FROM "table_74372" WHERE "Wed 1 June" = '18'' 22.66 123.182mph' | 0.081055 |
CREATE TABLE invoices (invoice_id NUMBER, order_id NUMBER, payment_method_code CLOB, product_id NUMBER, order_quantity CLOB, other_item_details CLOB, order_item_id NUMBER)
CREATE TABLE order_items (order_item_id NUMBER, order_id NUMBER, product_id NUMBER, order_quantity CLOB, other_item_details CLOB)
CREATE TABLE stores (store_id CLOB, address_id NUMBER, marketing_region_code CLOB, store_name CLOB, store_phone CLOB, store_email_address CLOB, other_details CLOB)
CREATE TABLE addresses (address_id CLOB, line_1 CLOB, line_2 CLOB, city_town CLOB, state_county CLOB, other_details CLOB)
CREATE TABLE performers (performer_id NUMBER, address_id NUMBER, customer_name CLOB, customer_phone CLOB, customer_email_address CLOB, other_details CLOB)
CREATE TABLE services (service_id NUMBER, service_type_code CLOB, workshop_group_id NUMBER, product_description CLOB, product_name CLOB, product_price NUMBER, other_product_service_details CLOB)
CREATE TABLE products (product_id CLOB, product_name CLOB, product_price NUMBER, product_description CLOB, other_product_service_details CLOB)
CREATE TABLE ref_payment_methods (payment_method_code CLOB, payment_method_description CLOB)
CREATE TABLE bookings_services (order_id NUMBER, product_id NUMBER)
CREATE TABLE invoice_items (invoice_item_id NUMBER, invoice_id NUMBER, order_id NUMBER, order_item_id NUMBER, product_id NUMBER, order_quantity NUMBER, other_item_details CLOB)
CREATE TABLE performers_in_bookings (order_id NUMBER, performer_id NUMBER)
CREATE TABLE customers (customer_id CLOB, address_id NUMBER, customer_name CLOB, customer_phone CLOB, customer_email_address CLOB, other_details CLOB)
CREATE TABLE drama_workshop_groups (workshop_group_id NUMBER, address_id NUMBER, currency_code CLOB, marketing_region_code CLOB, store_name CLOB, store_phone CLOB, store_email_address CLOB, other_details CLOB)
CREATE TABLE bookings (booking_id NUMBER, customer_id NUMBER, workshop_group_id CLOB, status_code CLOB, store_id NUMBER, order_date TIME, planned_delivery_date TIME, actual_delivery_date TIME, other_order_details CLOB)
CREATE TABLE clients (client_id NUMBER, address_id NUMBER, customer_email_address CLOB, customer_name CLOB, customer_phone CLOB, other_details CLOB)
CREATE TABLE marketing_regions (marketing_region_code CLOB, marketing_region_name CLOB, marketing_region_descriptrion CLOB, other_details CLOB)
CREATE TABLE ref_service_types (service_type_code CLOB, parent_service_type_code CLOB, service_type_description CLOB)
CREATE TABLE customer_orders (order_id NUMBER, customer_id NUMBER, store_id NUMBER, order_date TIME, planned_delivery_date TIME, actual_delivery_date TIME, other_order_details CLOB)
| For each distinct product name, show its average product price. | SELECT product_name, AVG(product_price) FROM products GROUP BY product_name | SELECT "product_name", AVG("product_price") FROM "products" GROUP BY "product_name" | 0.081055 |
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| provide the number of patients whose year of death is less than or equal to 2155 and drug name is neo*po*vitamin e drops? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2155.0" AND prescriptions.drug = "NEO*PO*Vitamin E Drops" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "NEO*PO*Vitamin E Drops" = "prescriptions"."drug" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "2155.0" >= "demographic"."dod_year" | 0.235352 |
CREATE TABLE table_name_34 (score VARCHAR2, total_points VARCHAR2)
| What was the score where the total points was 50? | SELECT score FROM table_name_34 WHERE total_points = 50 | SELECT "score" FROM "table_name_34" WHERE "total_points" = 50 | 0.05957 |
CREATE TABLE table_54834 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
| How many points did the away team score in the game that the home team scored 14.25 (109)? | SELECT "Away team score" FROM table_54834 WHERE "Home team score" = '14.25 (109)' | SELECT "Away team score" FROM "table_54834" WHERE "Home team score" = '14.25 (109)' | 0.081055 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.