schema
stringlengths 28
5.65k
| question
stringlengths 0
990
| rejected
stringlengths 2
4.44k
| chosen
stringlengths 4
9.17k
| weight
float64 0
8.95
|
---|---|---|---|---|
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
| have sodium chloride 0.9% 250 ml lvp, atropine 0.1 mg/ml inj syringe, or 1000 ml flex cont : sodium chloride 0.9 % iv soln been ordered the previous year for patient 012-42521? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-42521')) AND medication.drugname IN ('sodium chloride 0.9% 250 ml lvp', 'atropine 0.1 mg/ml inj syringe', '1000 ml flex cont : sodium chloride 0.9 % iv soln') AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '012-42521' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "medication" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "medication"."patientunitstayid" WHERE "medication"."drugname" IN ('sodium chloride 0.9% 250 ml lvp', 'atropine 0.1 mg/ml inj syringe', '1000 ml flex cont : sodium chloride 0.9 % iv soln') AND DATETIME("medication"."drugstarttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_1"."" IS NULL | 0.749023 |
CREATE TABLE classroom (building VARCHAR, room_number VARCHAR, capacity DECIMAL)
CREATE TABLE time_slot (time_slot_id VARCHAR, day VARCHAR, start_hr DECIMAL, start_min DECIMAL, end_hr DECIMAL, end_min DECIMAL)
CREATE TABLE takes (ID VARCHAR, course_id VARCHAR, sec_id VARCHAR, semester VARCHAR, year DECIMAL, grade VARCHAR)
CREATE TABLE instructor (ID VARCHAR, name VARCHAR, dept_name VARCHAR, salary DECIMAL)
CREATE TABLE advisor (s_ID VARCHAR, i_ID VARCHAR)
CREATE TABLE teaches (ID VARCHAR, course_id VARCHAR, sec_id VARCHAR, semester VARCHAR, year DECIMAL)
CREATE TABLE student (ID VARCHAR, name VARCHAR, dept_name VARCHAR, tot_cred DECIMAL)
CREATE TABLE department (dept_name VARCHAR, building VARCHAR, budget DECIMAL)
CREATE TABLE course (course_id VARCHAR, title VARCHAR, dept_name VARCHAR, credits DECIMAL)
CREATE TABLE prereq (course_id VARCHAR, prereq_id VARCHAR)
CREATE TABLE section (course_id VARCHAR, sec_id VARCHAR, semester VARCHAR, year DECIMAL, building VARCHAR, room_number VARCHAR, time_slot_id VARCHAR)
| How many total credits are offered by each department. Show bar chart. | SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name | SELECT "dept_name", SUM("credits") FROM "course" GROUP BY "dept_name" | 0.067383 |
CREATE TABLE table_19398910_4 (event VARCHAR, bout_2 VARCHAR)
| wich were the events when bout 2 was zhang ( chn ) l 0-5? | SELECT event FROM table_19398910_4 WHERE bout_2 = "Zhang ( CHN ) L 0-5" | SELECT "event" FROM "table_19398910_4" WHERE "Zhang ( CHN ) L 0-5" = "bout_2" | 0.075195 |
CREATE TABLE table_name_41 (score VARCHAR, opponent_in_the_final VARCHAR)
| What is the score of the tournament with olivier dela tre as the opponent in the final? | SELECT score FROM table_name_41 WHERE opponent_in_the_final = "olivier delaître" | SELECT "score" FROM "table_name_41" WHERE "olivier delaître" = "opponent_in_the_final" | 0.083984 |
CREATE TABLE table_name_19 (Id VARCHAR)
| Name the 2004 which has a 2003 of 36,026? | SELECT 2004 FROM table_name_19 WHERE 2003 = "36,026" | SELECT 2004 FROM "table_name_19" WHERE "36,026" = 2003 | 0.052734 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
| what is the number of patients whose admission type is elective and year of birth is less than 2052? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "2052" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2052" > "demographic"."dob_year" AND "ELECTIVE" = "demographic"."admission_type" | 0.152344 |
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
| what specimen test was given to patient 97330 for the last time since 09/2103? | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97330) AND STRFTIME('%y-%m', microbiologyevents.charttime) >= '2103-09' ORDER BY microbiologyevents.charttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 97330 GROUP BY "hadm_id") SELECT "microbiologyevents"."spec_type_desc" FROM "microbiologyevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "microbiologyevents"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND STRFTIME('%y-%m', "microbiologyevents"."charttime") >= '2103-09' ORDER BY "microbiologyevents"."charttime" DESC NULLS LAST LIMIT 1 | 0.419922 |
CREATE TABLE table_204_932 (id DECIMAL, "#" DECIMAL, "title" TEXT, "time" TEXT, "lead vocals" TEXT, "notes" TEXT)
| what is the track before melodies from heaven ? | SELECT "title" FROM table_204_932 WHERE "#" = (SELECT "#" FROM table_204_932 WHERE "title" = 'melodies from heaven') - 1 | SELECT "title" FROM "table_204_932" WHERE "#" = (SELECT "#" FROM "table_204_932" WHERE "title" = 'melodies from heaven') - 1 | 0.121094 |
CREATE TABLE table_203_809 (id DECIMAL, "date" TEXT, "time" TEXT, "opponent#" TEXT, "rank#" TEXT, "site" TEXT, "tv" TEXT, "result" TEXT, "attendance" DECIMAL)
| what was the date of the game that had the least number of people in attendance ? | SELECT "date" FROM table_203_809 ORDER BY "attendance" LIMIT 1 | SELECT "date" FROM "table_203_809" ORDER BY "attendance" NULLS FIRST LIMIT 1 | 0.074219 |
CREATE TABLE table_19560 ("School Year" TEXT, "Class A" TEXT, "Class AA" TEXT, "Class AAA" TEXT, "Class AAAA" TEXT, "Class AAAAA" TEXT)
| Which is the class AA when graford was the class A | SELECT "Class AA" FROM table_19560 WHERE "Class A" = 'Graford' | SELECT "Class AA" FROM "table_19560" WHERE "Class A" = 'Graford' | 0.0625 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| Calculate the minimum age of divorced patients who have st-segment elevation myocardial infarction/cardiac catheterization as their primary disease. | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" | SELECT MIN("demographic"."age") FROM "demographic" WHERE "DIVORCED" = "demographic"."marital_status" AND "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" = "demographic"."diagnosis" | 0.185547 |
CREATE TABLE table_206419_3 (s_b_share INT, percent_of_votes VARCHAR)
| What is the s B share for the shareholder that has 2.55 percent of votes? | SELECT MAX(s_b_share) FROM table_206419_3 WHERE percent_of_votes = "2.55" | SELECT MAX("s_b_share") FROM "table_206419_3" WHERE "2.55" = "percent_of_votes" | 0.077148 |
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
| has patient 006-76924 been prescribed with insulin (regular) 100 units in 1, levofloxacin 750 mg po tabs or magnesium sulfate 1 g in d5w 100ml **locked dose on the current hospital visit? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-76924' AND patient.hospitaldischargetime IS NULL)) AND medication.drugname IN ('insulin (regular) 100 units in 1', 'levofloxacin 750 mg po tabs', 'magnesium sulfate 1 g in d5w 100ml **locked dose') | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."hospitaldischargetime" IS NULL AND "patient"."uniquepid" = '006-76924' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "medication" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "medication"."patientunitstayid" WHERE "medication"."drugname" IN ('insulin (regular) 100 units in 1', 'levofloxacin 750 mg po tabs', 'magnesium sulfate 1 g in d5w 100ml **locked dose') AND NOT "_u_1"."" IS NULL | 0.678711 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| name the type of admission and location of discharge for the patient with patient id 17772. | SELECT demographic.admission_type, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "17772" | SELECT "demographic"."admission_type", "demographic"."discharge_location" FROM "demographic" WHERE "17772" = "demographic"."subject_id" | 0.131836 |
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
| give me the number of patients whose age is less than 48 and diagnoses icd9 code is 56210? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "48" AND diagnoses.icd9_code = "56210" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "56210" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "48" > "demographic"."age" | 0.202148 |
CREATE TABLE table_66495 ("Position" TEXT, "Country" TEXT, "Floor" FLOAT, "Pommel Horse" FLOAT, "Rings" FLOAT, "Vault" FLOAT, "Parallel Bars" FLOAT, "Horizontal Bar" FLOAT, "Team Total" FLOAT)
| Count the Pommel Horse that has Rings smaller than 59.85 and a Team Total larger than 361.2? | SELECT SUM("Pommel Horse") FROM table_66495 WHERE "Rings" < '59.85' AND "Team Total" > '361.2' | SELECT SUM("Pommel Horse") FROM "table_66495" WHERE "Rings" < '59.85' AND "Team Total" > '361.2' | 0.09375 |
CREATE TABLE table_46205 ("Player" TEXT, "Country" TEXT, "Year ( s ) won" TEXT, "Total" FLOAT, "To par" FLOAT)
| What is the sum of To Par, when Year(s) Won is '1978 , 1985'? | SELECT SUM("To par") FROM table_46205 WHERE "Year(s) won" = '1978 , 1985' | SELECT SUM("To par") FROM "table_46205" WHERE "Year(s) won" = '1978 , 1985' | 0.073242 |
CREATE TABLE table_name_12 (score VARCHAR, date VARCHAR)
| The game played on 6 December 1986 had what score? | SELECT score FROM table_name_12 WHERE date = "6 december 1986" | SELECT "score" FROM "table_name_12" WHERE "6 december 1986" = "date" | 0.066406 |
CREATE TABLE table_69517 ("Club" TEXT, "Played" TEXT, "Drawn" TEXT, "Lost" TEXT, "Points for" TEXT, "Points against" TEXT, "Tries for" TEXT, "Tries against" TEXT, "Try bonus" TEXT, "Losing bonus" TEXT, "Points" TEXT)
| What try bonus drew 0 and scored 427 points for? | SELECT "Try bonus" FROM table_69517 WHERE "Drawn" = '0' AND "Points for" = '427' | SELECT "Try bonus" FROM "table_69517" WHERE "Drawn" = '0' AND "Points for" = '427' | 0.080078 |
CREATE TABLE basketball_match (Team_ID INT, School_ID INT, Team_Name TEXT, ACC_Regular_Season TEXT, ACC_Percent TEXT, ACC_Home TEXT, ACC_Road TEXT, All_Games TEXT, All_Games_Percent INT, All_Home TEXT, All_Road TEXT, All_Neutral TEXT)
CREATE TABLE university (School_ID INT, School TEXT, Location TEXT, Founded FLOAT, Affiliation TEXT, Enrollment FLOAT, Nickname TEXT, Primary_conference TEXT)
| Give me the comparison about All_Games_Percent over the All_Neutral by a bar chart. | SELECT All_Neutral, All_Games_Percent FROM basketball_match | SELECT "All_Neutral", "All_Games_Percent" FROM "basketball_match" | 0.063477 |
CREATE TABLE table_713 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" FLOAT, "Result" TEXT, "Candidates" TEXT)
| What is the result for barney frank? | SELECT "Result" FROM table_713 WHERE "Incumbent" = 'Barney Frank' | SELECT "Result" FROM "table_713" WHERE "Incumbent" = 'Barney Frank' | 0.06543 |
CREATE TABLE table_18392 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" FLOAT, "Result" TEXT, "Candidates" TEXT)
| Who were the candidates in the election that featured incumbent don edwards? | SELECT "Candidates" FROM table_18392 WHERE "Incumbent" = 'Don Edwards' | SELECT "Candidates" FROM "table_18392" WHERE "Incumbent" = 'Don Edwards' | 0.070313 |
CREATE TABLE course_authors_and_tutors (author_id DECIMAL, author_tutor_atb TEXT, login_name TEXT, password TEXT, personal_name TEXT, middle_name TEXT, family_name TEXT, gender_mf TEXT, address_line_1 TEXT)
CREATE TABLE students (student_id DECIMAL, date_of_registration TIME, date_of_latest_logon TIME, login_name TEXT, password TEXT, personal_name TEXT, middle_name TEXT, family_name TEXT)
CREATE TABLE courses (course_id DECIMAL, author_id DECIMAL, subject_id DECIMAL, course_name TEXT, course_description TEXT)
CREATE TABLE subjects (subject_id DECIMAL, subject_name TEXT)
CREATE TABLE student_tests_taken (registration_id DECIMAL, date_test_taken TIME, test_result TEXT)
CREATE TABLE student_course_enrolment (registration_id DECIMAL, student_id DECIMAL, course_id DECIMAL, date_of_enrolment TIME, date_of_completion TIME)
| Count the number of tests with 'Fail' result. | SELECT COUNT(*) FROM student_tests_taken WHERE test_result = "Fail" | SELECT COUNT(*) FROM "student_tests_taken" WHERE "Fail" = "test_result" | 0.069336 |
CREATE TABLE table_30439 ("Institution" TEXT, "Location" TEXT, "Founded" FLOAT, "Affiliation" TEXT, "Enrollment" FLOAT, "Team Nickname" TEXT, "Primary conference" TEXT)
| How many students are enrolled in the team nicknamed Comets? | SELECT "Enrollment" FROM table_30439 WHERE "Team Nickname" = 'Comets' | SELECT "Enrollment" FROM "table_30439" WHERE "Team Nickname" = 'Comets' | 0.069336 |
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
| Bin the hire date into the day of week interval, and then calculate the total salary of employees in each day for a bar chart, note that just select those employees without the letter M in their first name. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' | SELECT "HIRE_DATE", SUM("SALARY") FROM "employees" WHERE NOT "FIRST_NAME" LIKE '%M%' | 0.082031 |
CREATE TABLE table_65079 ("Actor" TEXT, "Character" TEXT, "Soap Opera" TEXT, "Years" TEXT, "Duration" TEXT)
| who is the actor for shortland street for the years 1993 1999, 2001 2003, 2007, 2009 ? | SELECT "Actor" FROM table_65079 WHERE "Soap Opera" = 'shortland street' AND "Years" = '1993–1999, 2001–2003, 2007, 2009—' | SELECT "Actor" FROM "table_65079" WHERE "Soap Opera" = 'shortland street' AND "Years" = '1993–1999, 2001–2003, 2007, 2009—' | 0.120117 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| calculate the number of patients to whom neo*iv*clindamycin was administered | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "NEO*IV*Clindamycin" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "NEO*IV*Clindamycin" = "prescriptions"."drug" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" | 0.189453 |
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
| SPANISH prerequisites required by CS majors include what courses ? | SELECT DISTINCT course.department, course.name, course.number FROM program_course INNER JOIN course ON program_course.course_id = course.course_id WHERE course.department = 'SPANISH' | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "program_course" JOIN "course" ON "course"."course_id" = "program_course"."course_id" AND "course"."department" = 'SPANISH' | 0.197266 |
CREATE TABLE table_name_27 (playing_for VARCHAR, _number_100 VARCHAR, score VARCHAR)
| Which Playing For has a # 100 larger than 36, and a Score of 122? | SELECT playing_for FROM table_name_27 WHERE _number_100 > 36 AND score = "122" | SELECT "playing_for" FROM "table_name_27" WHERE "122" = "score" AND "_number_100" > 36 | 0.083984 |
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
| what is the number of patients whose gender is m and lab test name is nonsquamous epithelial cell? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "NonSquamous Epithelial Cell" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "NonSquamous Epithelial Cell" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "M" = "demographic"."gender" | 0.204102 |
CREATE TABLE table_test_26 ("id" INT, "bleeding" INT, "left_ventricular_ejection_fraction_lvef" INT, "left_main_coronary_artery_disease" BOOLEAN, "uncontrolled_diabetes" BOOLEAN, "hiv_infection" BOOLEAN, "hemoglobin_a1c_hba1c" FLOAT, "hepatitis_b_infection" BOOLEAN, "renal_disease" BOOLEAN, "unprotected_left_main_disease" BOOLEAN, "creatinine_clearance_cl" FLOAT, "stenosis" INT, "hepatitis_c_infection" BOOLEAN, "alcohol_abuse" BOOLEAN, "body_mass_index_bmi" FLOAT, "NOUSE" FLOAT)
| significant unprotected left main disease ( stenosis of 50 % or greater on diagnostic angiography ) | SELECT * FROM table_test_26 WHERE unprotected_left_main_disease = 1 OR stenosis >= 50 | SELECT * FROM "table_test_26" WHERE "stenosis" >= 50 OR "unprotected_left_main_disease" = 1 | 0.088867 |
CREATE TABLE table_name_17 (constructor VARCHAR, circuit VARCHAR, date VARCHAR)
| What company constrcuted the vehicle with a circuit of oulton park on 15 april? | SELECT constructor FROM table_name_17 WHERE circuit = "oulton park" AND date = "15 april" | SELECT "constructor" FROM "table_name_17" WHERE "15 april" = "date" AND "circuit" = "oulton park" | 0.094727 |
CREATE TABLE table_name_29 (title VARCHAR, box_office VARCHAR)
| What movie earned $1,659,542 at the box office? | SELECT title FROM table_name_29 WHERE box_office = "$1,659,542" | SELECT "title" FROM "table_name_29" WHERE "$1,659,542" = "box_office" | 0.067383 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
| what is death status and diagnoses short title of subject name travis hofman? | SELECT demographic.expire_flag, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Travis Hofman" | SELECT "demographic"."expire_flag", "diagnoses"."short_title" FROM "demographic" JOIN "diagnoses" ON "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "Travis Hofman" = "demographic"."name" | 0.188477 |
CREATE TABLE table_27734577_2 (score VARCHAR, high_points VARCHAR)
| what was the final score of the game where josh powell (13) scored the most points? | SELECT score FROM table_27734577_2 WHERE high_points = "Josh Powell (13)" | SELECT "score" FROM "table_27734577_2" WHERE "Josh Powell (13)" = "high_points" | 0.077148 |
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
| how many hours has it been since the last time patient 94229 was diagnosed in the current hospital visit with empyema w/o fistula? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'empyema w/o fistula') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94229 AND admissions.dischtime IS NULL) ORDER BY diagnoses_icd.charttime DESC LIMIT 1 | WITH "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."dischtime" IS NULL AND "admissions"."subject_id" = 94229 GROUP BY "hadm_id") SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "diagnoses_icd"."charttime")) FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'empyema w/o fistula' LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "diagnoses_icd"."hadm_id" WHERE NOT "_u_1"."" IS NULL ORDER BY "diagnoses_icd"."charttime" DESC NULLS LAST LIMIT 1 | 0.561523 |
CREATE TABLE table_27833469_1 (series__number VARCHAR, season__number VARCHAR)
| What is the series number for the episode number 10 of the season? | SELECT series__number FROM table_27833469_1 WHERE season__number = "10" | SELECT "series__number" FROM "table_27833469_1" WHERE "10" = "season__number" | 0.075195 |
CREATE TABLE table_77615 ("Call sign" TEXT, "Frequency MHz" TEXT, "City of license" TEXT, "ERP W" FLOAT, "Class" TEXT, "FCC info" TEXT)
| Name the frequence MHz for ERP W of 55 | SELECT "Frequency MHz" FROM table_77615 WHERE "ERP W" = '55' | SELECT "Frequency MHz" FROM "table_77615" WHERE "ERP W" = '55' | 0.060547 |
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
| when was the first time patient 30296 has been diagnosed with liver transplant status since 2105? | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'liver transplant status') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30296) AND STRFTIME('%y', diagnoses_icd.charttime) >= '2105' ORDER BY diagnoses_icd.charttime LIMIT 1 | WITH "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 30296 GROUP BY "hadm_id") SELECT "diagnoses_icd"."charttime" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'liver transplant status' LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "diagnoses_icd"."hadm_id" WHERE NOT "_u_1"."" IS NULL AND STRFTIME('%y', "diagnoses_icd"."charttime") >= '2105' ORDER BY "diagnoses_icd"."charttime" NULLS FIRST LIMIT 1 | 0.527344 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| how many patients whose diagnoses short title is bmi less than 19,adult and drug type is additive? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "BMI less than 19,adult" AND prescriptions.drug_type = "ADDITIVE" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "BMI less than 19,adult" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "prescriptions" ON "ADDITIVE" = "prescriptions"."drug_type" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" | 0.306641 |
CREATE TABLE table_name_50 (power VARCHAR, frequency VARCHAR)
| what is the Power with 88.5 fm Frequency | SELECT power FROM table_name_50 WHERE frequency = "88.5 fm" | SELECT "power" FROM "table_name_50" WHERE "88.5 fm" = "frequency" | 0.063477 |
CREATE TABLE table_name_43 (game INT, record VARCHAR, points VARCHAR)
| Which Game has a Record of 8 2 0, and Points larger than 16? | SELECT SUM(game) FROM table_name_43 WHERE record = "8–2–0" AND points > 16 | SELECT SUM("game") FROM "table_name_43" WHERE "8–2–0" = "record" AND "points" > 16 | 0.080078 |
CREATE TABLE table_71457 ("Entrant" TEXT, "Constructor" TEXT, "Chassis" TEXT, "Engine \\u2020" TEXT, "Tyre" TEXT, "Driver" TEXT, "Rounds" TEXT)
| Which tyre is on the car driven by Pedro de la Rosa? | SELECT "Tyre" FROM table_71457 WHERE "Driver" = 'pedro de la rosa' | SELECT "Tyre" FROM "table_71457" WHERE "Driver" = 'pedro de la rosa' | 0.066406 |
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
| how many hours have it been since patient 006-202970 was admitted in the icu? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-202970' AND patient.unitdischargetime IS NULL | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "patient"."unitadmittime")) FROM "patient" WHERE "patient"."uniquepid" = '006-202970' AND "patient"."unitdischargetime" IS NULL | 0.183594 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| give me the number of patients whose admission type is elective and procedure icd9 code is 3613? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "3613" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "3613" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "ELECTIVE" = "demographic"."admission_type" | 0.220703 |
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
| For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday by a bar chart. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | SELECT "HIRE_DATE", SUM("EMPLOYEE_ID") FROM "employees" WHERE NOT "DEPARTMENT_ID" IN (SELECT "DEPARTMENT_ID" FROM "departments" WHERE "MANAGER_ID" <= 200 AND "MANAGER_ID" >= 100) | 0.173828 |
CREATE TABLE table_79499 ("Title" TEXT, "Series" TEXT, "Director" TEXT, "Release date" TEXT, "reissue?" TEXT)
| What's the title for the release date of 1953-01-31 in the MM series, no reissue, and a director of I. Freleng? | SELECT "Title" FROM table_79499 WHERE "Series" = 'mm' AND "Director" = 'i. freleng' AND "reissue?" = 'no' AND "Release date" = '1953-01-31' | SELECT "Title" FROM "table_79499" WHERE "Director" = 'i. freleng' AND "Release date" = '1953-01-31' AND "Series" = 'mm' AND "reissue?" = 'no' | 0.137695 |
CREATE TABLE grapes (ID INT, Grape TEXT, Color TEXT)
CREATE TABLE wine (No INT, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INT, Price INT, Score INT, Cases INT, Drink TEXT)
CREATE TABLE appellations (No INT, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT)
| What are the wines that have prices lower than 50 and have appelations in Monterey county, and count them by a bar chart | SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name | SELECT "Name", COUNT("Name") FROM "appellations" AS "T1" JOIN "wine" AS "T2" ON "T1"."Appelation" = "T2"."Appelation" AND "T2"."Price" < 50 WHERE "Monterey" = "T1"."County" GROUP BY "Name" | 0.183594 |
CREATE TABLE table_61394 ("Name" TEXT, "Season" TEXT, "Games" TEXT, "Goals" TEXT, "Assists" TEXT, "Points" TEXT)
| What are the points in the season with 47 games and 28 goals? | SELECT "Points" FROM table_61394 WHERE "Goals" = '28' AND "Games" = '47' | SELECT "Points" FROM "table_61394" WHERE "Games" = '47' AND "Goals" = '28' | 0.072266 |
CREATE TABLE table_11408 ("Date" TEXT, "Opponent" TEXT, "Score" TEXT, "Loss" TEXT, "Attendance" FLOAT, "Record" TEXT)
| On what date was the record 21-25? | SELECT "Date" FROM table_11408 WHERE "Record" = '21-25' | SELECT "Date" FROM "table_11408" WHERE "Record" = '21-25' | 0.055664 |
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
| during this month patient 021-80293 had any allergy? | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-80293')) AND DATETIME(allergy.allergytime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '021-80293' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "allergy" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "allergy"."patientunitstayid" WHERE DATETIME("allergy"."allergytime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND NOT "_u_1"."" IS NULL | 0.59082 |
CREATE TABLE table_72392 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" FLOAT, "Result" TEXT, "Candidates" TEXT)
| Name the district for tim lee hall | SELECT "District" FROM table_72392 WHERE "Incumbent" = 'Tim Lee Hall' | SELECT "District" FROM "table_72392" WHERE "Incumbent" = 'Tim Lee Hall' | 0.069336 |
CREATE TABLE table_19072602_1 (score VARCHAR, team_europe VARCHAR)
| What was the score when Tore Torgersen played for Team Europe? | SELECT score FROM table_19072602_1 WHERE team_europe = "Tore Torgersen" | SELECT "score" FROM "table_19072602_1" WHERE "Tore Torgersen" = "team_europe" | 0.075195 |
CREATE TABLE table_16432543_3 (enrollment INT)
| What is the smallest number of enrolled students? | SELECT MIN(enrollment) FROM table_16432543_3 | SELECT MIN("enrollment") FROM "table_16432543_3" | 0.046875 |
CREATE TABLE table_5788 ("Date" TEXT, "Tournament" TEXT, "Surface" TEXT, "Partnering" TEXT, "Opponents in the final" TEXT, "Score" TEXT)
| When has a Score of 6 3, 6 4? | SELECT "Date" FROM table_5788 WHERE "Score" = '6–3, 6–4' | SELECT "Date" FROM "table_5788" WHERE "Score" = '6–3, 6–4' | 0.056641 |
CREATE TABLE table_train_4 ("id" INT, "pregnancy_or_lactation" BOOLEAN, "severe_sepsis" BOOLEAN, "acute_venous_thromboembolism_vte" BOOLEAN, "allergy_to_carbapenem" BOOLEAN, "septic_shock" BOOLEAN, "age" FLOAT, "NOUSE" FLOAT)
| icu patients with severe sepsis and septic shock | SELECT * FROM table_train_4 WHERE severe_sepsis = 1 OR septic_shock = 1 | SELECT * FROM "table_train_4" WHERE "septic_shock" = 1 OR "severe_sepsis" = 1 | 0.075195 |
CREATE TABLE table_28666 ("District" FLOAT, "Incumbent" TEXT, "Party" TEXT, "Elected" TEXT, "Status" TEXT, "2010 Candidates" TEXT)
| What is the elected year when the 2010 candidates were jesse stone (r) 93.51 diane evans (i) 6.49%? | SELECT "Elected" FROM table_28666 WHERE "2010 Candidates" = 'Jesse Stone (R) 93.51 Diane Evans (I) 6.49%' | SELECT "Elected" FROM "table_28666" WHERE "2010 Candidates" = 'Jesse Stone (R) 93.51 Diane Evans (I) 6.49%' | 0.104492 |
CREATE TABLE table_45814 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT)
| What player has 71-72-66=209 as the score? | SELECT "Player" FROM table_45814 WHERE "Score" = '71-72-66=209' | SELECT "Player" FROM "table_45814" WHERE "Score" = '71-72-66=209' | 0.063477 |
CREATE TABLE table_name_2 (football VARCHAR, soccer VARCHAR, golf VARCHAR)
| Which foot ball team played soccer at wooster, and Gold in Ashland? | SELECT football FROM table_name_2 WHERE soccer = "wooster" AND golf = "ashland" | SELECT "football" FROM "table_name_2" WHERE "ashland" = "golf" AND "soccer" = "wooster" | 0.084961 |
CREATE TABLE table_80086 ("Date" TEXT, "Opponent" TEXT, "Score" TEXT, "Loss" TEXT, "Record" TEXT)
| Name the score for september 11 | SELECT "Score" FROM table_80086 WHERE "Date" = 'september 11' | SELECT "Score" FROM "table_80086" WHERE "Date" = 'september 11' | 0.061523 |
CREATE TABLE candidates (candidate_id DECIMAL, candidate_details TEXT)
CREATE TABLE people_addresses (person_address_id DECIMAL, person_id DECIMAL, address_id DECIMAL, date_from TIME, date_to TIME)
CREATE TABLE candidate_assessments (candidate_id DECIMAL, qualification TEXT, assessment_date TIME, asessment_outcome_code TEXT)
CREATE TABLE addresses (address_id DECIMAL, line_1 TEXT, line_2 TEXT, city TEXT, zip_postcode TEXT, state_province_county TEXT, country TEXT)
CREATE TABLE people (person_id DECIMAL, first_name TEXT, middle_name TEXT, last_name TEXT, cell_mobile_number TEXT, email_address TEXT, login_name TEXT, password TEXT)
CREATE TABLE student_course_registrations (student_id DECIMAL, course_id DECIMAL, registration_date TIME)
CREATE TABLE students (student_id DECIMAL, student_details TEXT)
CREATE TABLE courses (course_id TEXT, course_name TEXT, course_description TEXT, other_details TEXT)
CREATE TABLE student_course_attendance (student_id DECIMAL, course_id DECIMAL, date_of_attendance TIME)
| List the id of students who registered course statistics in the order of registration date. | SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.registration_date | SELECT "T2"."student_id" FROM "courses" AS "T1" JOIN "student_course_registrations" AS "T2" ON "T1"."course_id" = "T2"."course_id" WHERE "T1"."course_name" = "statistics" ORDER BY "T2"."registration_date" NULLS FIRST | 0.210938 |
CREATE TABLE ship (Id VARCHAR)
| How many ships are there? | SELECT COUNT(*) FROM ship | SELECT COUNT(*) FROM "ship" | 0.026367 |
CREATE TABLE table_name_49 (captain VARCHAR, manager VARCHAR)
| Which captain's manager is Joe Royle? | SELECT captain FROM table_name_49 WHERE manager = "joe royle" | SELECT "captain" FROM "table_name_49" WHERE "joe royle" = "manager" | 0.06543 |
CREATE TABLE table_14951643_1 (record VARCHAR, result VARCHAR)
| what's the record with result being w 52 19 | SELECT record FROM table_14951643_1 WHERE result = "W 52–19" | SELECT "record" FROM "table_14951643_1" WHERE "W 52–19" = "result" | 0.064453 |
CREATE TABLE order_items (order_item_id DECIMAL, order_id DECIMAL, product_id DECIMAL, order_quantity TEXT)
CREATE TABLE customer_orders (order_id DECIMAL, customer_id DECIMAL, order_date TIME, order_status_code TEXT)
CREATE TABLE customer_address_history (customer_id DECIMAL, address_id DECIMAL, date_from TIME, date_to TIME)
CREATE TABLE customers (customer_id DECIMAL, payment_method_code TEXT, customer_number TEXT, customer_name TEXT, customer_address TEXT, customer_phone TEXT, customer_email TEXT)
CREATE TABLE contacts (contact_id DECIMAL, customer_id DECIMAL, gender TEXT, first_name TEXT, last_name TEXT, contact_phone TEXT)
CREATE TABLE products (product_id DECIMAL, product_type_code TEXT, product_name TEXT, product_price DECIMAL)
CREATE TABLE addresses (address_id DECIMAL, line_1_number_building TEXT, city TEXT, zip_postcode TEXT, state_province_county TEXT, country TEXT)
| Show the product type codes which have at least two products. | SELECT product_type_code FROM products GROUP BY product_type_code HAVING COUNT(*) >= 2 | SELECT "product_type_code" FROM "products" GROUP BY "product_type_code" HAVING COUNT(*) >= 2 | 0.089844 |
CREATE TABLE Movie (mID INT, title TEXT, year INT, director TEXT)
CREATE TABLE Reviewer (rID INT, name TEXT)
CREATE TABLE Rating (rID INT, mID INT, stars INT, ratingDate DATE)
| Ignore movies whose director is NULL For each director, what are the titles and ratings for all the movies they reviewed? Show the result by a bar chart, order y-axis in asc order please. | SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" ORDER BY stars | SELECT "title", "stars" FROM "Rating" AS "T1" JOIN "Movie" AS "T2" ON "T1"."mID" = "T2"."mID" WHERE "director" <> "null" ORDER BY "stars" NULLS FIRST | 0.145508 |
CREATE TABLE faculty (facid DECIMAL, lname TEXT, fname TEXT, rank TEXT, sex TEXT, phone DECIMAL, room TEXT, building TEXT)
CREATE TABLE member_of (facid DECIMAL, dno DECIMAL, appt_type TEXT)
CREATE TABLE gradeconversion (lettergrade TEXT, gradepoint DECIMAL)
CREATE TABLE student (stuid DECIMAL, lname TEXT, fname TEXT, age DECIMAL, sex TEXT, major DECIMAL, advisor DECIMAL, city_code TEXT)
CREATE TABLE department (dno DECIMAL, division TEXT, dname TEXT, room TEXT, building TEXT, dphone DECIMAL)
CREATE TABLE enrolled_in (stuid DECIMAL, cid TEXT, grade TEXT)
CREATE TABLE minor_in (stuid DECIMAL, dno DECIMAL)
CREATE TABLE course (cid TEXT, cname TEXT, credits DECIMAL, instructor DECIMAL, days TEXT, hours TEXT, dno DECIMAL)
| What are the names of courses that give either 3 credits, or 1 credit and 4 hours? | SELECT cname FROM course WHERE credits = 3 UNION SELECT cname FROM course WHERE credits = 1 AND hours = 4 | SELECT "cname" FROM "course" WHERE "credits" = 3 UNION SELECT "cname" FROM "course" WHERE "credits" = 1 AND "hours" = 4 | 0.116211 |
CREATE TABLE table_name_96 (country VARCHAR, player VARCHAR)
| What country is player thomas bj rn from? | SELECT country FROM table_name_96 WHERE player = "thomas bjørn" | SELECT "country" FROM "table_name_96" WHERE "player" = "thomas bjørn" | 0.067383 |
CREATE TABLE table_name_66 (name VARCHAR, president VARCHAR, left_office VARCHAR)
| What is Name, when President is Khamtai Siphandon, and when Left Office is 1999? | SELECT name FROM table_name_66 WHERE president = "khamtai siphandon" AND left_office = "1999" | SELECT "name" FROM "table_name_66" WHERE "1999" = "left_office" AND "khamtai siphandon" = "president" | 0.098633 |
CREATE TABLE table_name_84 (organisation VARCHAR, year VARCHAR, award VARCHAR)
| what is the organisation when the year is less than 2005 and the award is the best variety show host? | SELECT organisation FROM table_name_84 WHERE year < 2005 AND award = "best variety show host" | SELECT "organisation" FROM "table_name_84" WHERE "award" = "best variety show host" AND "year" < 2005 | 0.098633 |
CREATE TABLE table_14580 ("Type" TEXT, "Fleet numbers" TEXT, "Quantity made" FLOAT, "Manufacturer" TEXT, "Date made" TEXT, "GSWR Class" FLOAT, "GSWR Nos." TEXT, "GSR Class" TEXT, "Inchicore Class" TEXT, "Withdrawn" TEXT)
| What GSR class is associated with a 0-4-2t type? | SELECT "GSR Class" FROM table_14580 WHERE "Type" = '0-4-2t' | SELECT "GSR Class" FROM "table_14580" WHERE "Type" = '0-4-2t' | 0.05957 |
CREATE TABLE table_name_83 (position VARCHAR, name VARCHAR, nationality VARCHAR, goals VARCHAR)
| WHAT IS THE POSITION FOR BRAZIL, WITH 27 GOALS, AND FOR NECA? | SELECT position FROM table_name_83 WHERE nationality = "brazil" AND goals = 27 AND name = "neca" | SELECT "position" FROM "table_name_83" WHERE "brazil" = "nationality" AND "goals" = 27 AND "name" = "neca" | 0.103516 |
CREATE TABLE table_42223 ("Former kingdom" TEXT, "Province" TEXT, "Hangul" TEXT, "Hanja" TEXT, "Capital" TEXT, "Modern equivalent" TEXT)
| What is the capital of the province with in Hanja? | SELECT "Capital" FROM table_42223 WHERE "Hanja" = '漢州' | SELECT "Capital" FROM "table_42223" WHERE "Hanja" = '漢州' | 0.054688 |
CREATE TABLE table_15342 ("Client" TEXT, "Years of Operation" TEXT, "Area of Operation" TEXT, "Country" TEXT, "Services" TEXT)
| What services were in the area of operation Wadi Borjuj? | SELECT "Services" FROM table_15342 WHERE "Area of Operation" = 'wadi borjuj' | SELECT "Services" FROM "table_15342" WHERE "Area of Operation" = 'wadi borjuj' | 0.076172 |
CREATE TABLE Student_Addresses (student_id INT, address_id INT, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL, other_details VARCHAR)
CREATE TABLE Students_in_Detention (student_id INT, detention_id INT, incident_id INT)
CREATE TABLE Students (student_id INT, address_id INT, first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, cell_mobile_number VARCHAR, email_address VARCHAR, date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARCHAR)
CREATE TABLE Ref_Address_Types (address_type_code VARCHAR, address_type_description VARCHAR)
CREATE TABLE Behavior_Incident (incident_id INT, incident_type_code VARCHAR, student_id INT, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR, recommendations VARCHAR, other_details VARCHAR)
CREATE TABLE Ref_Detention_Type (detention_type_code VARCHAR, detention_type_description VARCHAR)
CREATE TABLE Ref_Incident_Type (incident_type_code VARCHAR, incident_type_description VARCHAR)
CREATE TABLE Teachers (teacher_id INT, address_id INT, first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, gender VARCHAR, cell_mobile_number VARCHAR, email_address VARCHAR, other_details VARCHAR)
CREATE TABLE Detention (detention_id INT, detention_type_code VARCHAR, teacher_id INT, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_summary VARCHAR, other_details VARCHAR)
CREATE TABLE Addresses (address_id INT, line_1 VARCHAR, line_2 VARCHAR, line_3 VARCHAR, city VARCHAR, zip_postcode VARCHAR, state_province_county VARCHAR, country VARCHAR, other_address_details VARCHAR)
CREATE TABLE Assessment_Notes (notes_id INT, student_id INT, teacher_id INT, date_of_notes DATETIME, text_of_notes VARCHAR, other_details VARCHAR)
| Give me the comparison about the amount of date_address_from over the date_address_from , and group by attribute other_details and bin date_address_from by weekday. | SELECT date_address_from, COUNT(date_address_from) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | SELECT "date_address_from", COUNT("date_address_from") FROM "Student_Addresses" GROUP BY "other_details" ORDER BY "monthly_rental" DESC NULLS LAST | 0.142578 |
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
| what is the ingesting method of 0.9%nacl 1,000 ml? | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = '0.9%nacl 1,000 ml' | SELECT DISTINCT "medication"."routeadmin" FROM "medication" WHERE "medication"."drugname" = '0.9%nacl 1,000 ml' | 0.108398 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| count the number of patients who have stayed in the hospital for more than one day and whose lab test fluid is joint fluid. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "1" AND lab.fluid = "Joint Fluid" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Joint Fluid" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "1" < "demographic"."days_stay" | 0.191406 |
CREATE TABLE table_11622392_1 (date VARCHAR, location VARCHAR)
| When was the tournament in Washington held? | SELECT date FROM table_11622392_1 WHERE location = "Washington" | SELECT "date" FROM "table_11622392_1" WHERE "Washington" = "location" | 0.067383 |
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
| how many days it's been since patient 027-120575 first got a total bilirubin lab test in the current hospital visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-120575' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'total bilirubin' ORDER BY lab.labresulttime LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."hospitaldischargetime" IS NULL AND "patient"."uniquepid" = '027-120575' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "lab"."labresulttime")) FROM "lab" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'total bilirubin' AND NOT "_u_1"."" IS NULL ORDER BY "lab"."labresulttime" NULLS FIRST LIMIT 1 | 0.669922 |
CREATE TABLE nuclear_power_plants (id TEXT, name TEXT, latitude TEXT, longitude TEXT, country TEXT, status TEXT, reactortype TEXT, reactormodel TEXT, constructionstartat TEXT, operationalfrom TEXT, operationalto TEXT, capacity TEXT, lastupdatedat TEXT, source TEXT)
| How many nuclear power plants are in preparation to be used in Japan? | SELECT COUNT(*) FROM nuclear_power_plants WHERE country = "Japan" AND status = "Under Construction" | SELECT COUNT(*) FROM "nuclear_power_plants" WHERE "Japan" = "country" AND "Under Construction" = "status" | 0.102539 |
CREATE TABLE table_54845 ("Team" TEXT, "Nation" TEXT, "From" TEXT, "Matches" FLOAT, "Drawn" FLOAT, "Lost" FLOAT, "Win %" FLOAT)
| Name the sum of drawn for 30 october 2006 and win % more than 43.2 | SELECT SUM("Drawn") FROM table_54845 WHERE "From" = '30 october 2006' AND "Win %" > '43.2' | SELECT SUM("Drawn") FROM "table_54845" WHERE "From" = '30 october 2006' AND "Win %" > '43.2' | 0.089844 |
CREATE TABLE table_72473 ("Country" FLOAT, "Rank" TEXT, "Aid" TEXT, "Trade" TEXT, "Investment" TEXT, "Migration" TEXT, "Environment" TEXT, "Security" TEXT, "Technology" TEXT, "Overall ( Average ) " TEXT)
| What is the migration rating when trade is 5.7? | SELECT "Migration" FROM table_72473 WHERE "Trade" = '5.7' | SELECT "Migration" FROM "table_72473" WHERE "Trade" = '5.7' | 0.057617 |
CREATE TABLE table_1341604_10 (candidates VARCHAR, result VARCHAR)
| how many candidates with result being new seat democratic gain | SELECT COUNT(candidates) FROM table_1341604_10 WHERE result = "New seat Democratic gain" | SELECT COUNT("candidates") FROM "table_1341604_10" WHERE "New seat Democratic gain" = "result" | 0.091797 |
CREATE TABLE table_name_55 (surface VARCHAR, date VARCHAR)
| Date of january 11, 1998 has what surface? | SELECT surface FROM table_name_55 WHERE date = "january 11, 1998" | SELECT "surface" FROM "table_name_55" WHERE "date" = "january 11, 1998" | 0.069336 |
CREATE TABLE table_54039 ("Driver" TEXT, "Entrant" TEXT, "Constructor" TEXT, "Chassis" TEXT, "Engine" TEXT, "Tyre" TEXT)
| what is the tyre when the entrant is scuderia milano? | SELECT "Tyre" FROM table_54039 WHERE "Entrant" = 'scuderia milano' | SELECT "Tyre" FROM "table_54039" WHERE "Entrant" = 'scuderia milano' | 0.066406 |
CREATE TABLE table_68292 ("Tournament" TEXT, "2007" TEXT, "2008" TEXT, "2009" TEXT, "2010" TEXT, "2011" TEXT, "2012" TEXT, "2013" TEXT)
| What was the 2012 finish in the US Open? | SELECT "2012" FROM table_68292 WHERE "Tournament" = 'us open' | SELECT "2012" FROM "table_68292" WHERE "Tournament" = 'us open' | 0.061523 |
CREATE TABLE table_43944 ("Round" FLOAT, "Pick" FLOAT, "Overall" FLOAT, "Name" TEXT, "Position" TEXT, "College" TEXT)
| Which Position has a College of colorado? | SELECT "Position" FROM table_43944 WHERE "College" = 'colorado' | SELECT "Position" FROM "table_43944" WHERE "College" = 'colorado' | 0.063477 |
CREATE TABLE table_204_862 (id DECIMAL, "rank" DECIMAL, "bib" DECIMAL, "athlete" TEXT, "country" TEXT, "run 1" TEXT, "run 2" TEXT, "total" TEXT, "behind" DECIMAL)
| what was the total number of competitors ? | SELECT COUNT("athlete") FROM table_204_862 | SELECT COUNT("athlete") FROM "table_204_862" | 0.042969 |
CREATE TABLE table_16952 ("Date" TEXT, "Tournament" TEXT, "Location" TEXT, "Purse ( $ ) " FLOAT, "Winner" TEXT, "Score" TEXT, "1st Prize ( $ ) " FLOAT)
| Where was the GTE Suncoast Classic tournament held? | SELECT "Location" FROM table_16952 WHERE "Tournament" = 'GTE Suncoast Classic' | SELECT "Location" FROM "table_16952" WHERE "Tournament" = 'GTE Suncoast Classic' | 0.078125 |
CREATE TABLE table_name_66 (country VARCHAR, value_in_usd VARCHAR, currency VARCHAR)
| Which country uses pound sterling with a value higher than 1.33 USD? | SELECT country FROM table_name_66 WHERE value_in_usd > 1.33 AND currency = "pound sterling" | SELECT "country" FROM "table_name_66" WHERE "currency" = "pound sterling" AND "value_in_usd" > 1.33 | 0.09668 |
CREATE TABLE table_55557 ("Channel" FLOAT, "Name" TEXT, "Language" TEXT, "Owner" TEXT, "Group" TEXT, "Type" TEXT)
| Which type is filed under the Group Animated? | SELECT "Type" FROM table_55557 WHERE "Group" = 'animated' | SELECT "Type" FROM "table_55557" WHERE "Group" = 'animated' | 0.057617 |
CREATE TABLE table_2639433_4 (episodes VARCHAR, year VARCHAR)
| What episode came out in the year 2007? | SELECT episodes FROM table_2639433_4 WHERE year = 2007 | SELECT "episodes" FROM "table_2639433_4" WHERE "year" = 2007 | 0.058594 |
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
| Questions with just two tags, [homework] and [CHOOSE YOUR OWN ADVENTURE]. | SELECT q.Id AS "post_link", q.Score, q.Tags, q.ClosedDate FROM Posts AS q WHERE q.PostTypeId = 1 AND q.Tags LIKE '%<homework>%' AND q.Tags LIKE '%<' + @CoTag + '>%' AND LENGTH(q.Tags) - LENGTH(REPLACE(q.Tags, '><', '')) = 2 AND ((q.ClosedDate IS NULL AND UPPER(@OpenQs) = 'Y') OR (NOT q.ClosedDate IS NULL AND UPPER(@ClosedQs) = 'Y')) | SELECT "q"."Id" AS "post_link", "q"."Score", "q"."Tags", "q"."ClosedDate" FROM "Posts" AS "q" WHERE ("q"."ClosedDate" IS NULL OR UPPER($ClosedQs) = 'Y') AND "q"."PostTypeId" = 1 AND "q"."Tags" LIKE '%<' + $CoTag + '>%' AND "q"."Tags" LIKE '%<homework>%' AND NOT "q"."ClosedDate" IS NULL AND LENGTH("q"."Tags") - LENGTH(REPLACE("q"."Tags", '><', '')) = 2 AND (UPPER($ClosedQs) = 'Y' OR UPPER($OpenQs) = 'Y') | 0.396484 |
CREATE TABLE table_34764 ("Operation" TEXT, "Binary" TEXT, "Binomial" TEXT, "Fibonacci" TEXT, "Pairing" TEXT, "Brodal ***" TEXT, "Strict Fibonacci Heap" TEXT)
| Binary of (log n), and a Fibonacci of (1) has what binomial? | SELECT "Binomial" FROM table_34764 WHERE "Binary" = 'θ(log n)' AND "Fibonacci" = 'θ(1)' | SELECT "Binomial" FROM "table_34764" WHERE "Binary" = 'θ(log n)' AND "Fibonacci" = 'θ(1)' | 0.086914 |
CREATE TABLE table_20590020_2 (best_finish VARCHAR, money_list_rank VARCHAR)
| What is the total number of players who had a money list rank of 96? | SELECT COUNT(best_finish) FROM table_20590020_2 WHERE money_list_rank = 96 | SELECT COUNT("best_finish") FROM "table_20590020_2" WHERE "money_list_rank" = 96 | 0.078125 |
CREATE TABLE table_203_771 (id DECIMAL, "#" DECIMAL, "artist" TEXT, "featuring" TEXT, "title" TEXT, "version" TEXT, "length" TEXT)
| what is the total number of tracks on the benassi bros. greatest hits album ? | SELECT COUNT("title") FROM table_203_771 | SELECT COUNT("title") FROM "table_203_771" | 0.041016 |
CREATE TABLE table_name_25 (location VARCHAR, game VARCHAR, points VARCHAR)
| Which game has a number lower than 57 and more than 50 points? | SELECT location FROM table_name_25 WHERE game < 57 AND points > 50 | SELECT "location" FROM "table_name_25" WHERE "game" < 57 AND "points" > 50 | 0.072266 |
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
| Java Questions from Recent times. | SELECT Id, Score, AcceptedAnswerId, Title, Body FROM Posts WHERE Tags LIKE '%<java>%' AND AcceptedAnswerId > 0 AND Id < 584234 ORDER BY Id DESC | SELECT "Id", "Score", "AcceptedAnswerId", "Title", "Body" FROM "Posts" WHERE "AcceptedAnswerId" > 0 AND "Id" < 584234 AND "Tags" LIKE '%<java>%' ORDER BY "Id" DESC NULLS LAST | 0.169922 |
CREATE TABLE table_203_853 (id DECIMAL, "date" TEXT, "opponent" TEXT, "home/away" TEXT, "field" TEXT, "result" TEXT)
| what is the most points that the barrage have scored at home ? | SELECT "result" FROM table_203_853 WHERE "home/away" = 'home' ORDER BY "result" DESC LIMIT 1 | SELECT "result" FROM "table_203_853" WHERE "home/away" = 'home' ORDER BY "result" DESC NULLS LAST LIMIT 1 | 0.102539 |
CREATE TABLE table_train_26 ("id" INT, "gender" TEXT, "pregnancy_or_lactation" BOOLEAN, "allergy_to_penicillin" BOOLEAN, "active_infection" BOOLEAN, "allergy_to_cephalosporin" BOOLEAN, "receiving_anticoagulants" BOOLEAN, "age" FLOAT, "NOUSE" FLOAT)
| known pregnancy or breastfeeding | SELECT * FROM table_train_26 WHERE pregnancy_or_lactation = 1 | SELECT * FROM "table_train_26" WHERE "pregnancy_or_lactation" = 1 | 0.063477 |
Subsets and Splits