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 job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, 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 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 jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
|
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, a scatter chart shows the correlation between employee_id and department_id .
|
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
|
SELECT "EMPLOYEE_ID", "DEPARTMENT_ID" FROM "employees" WHERE ("COMMISSION_PCT" <> "null" OR "DEPARTMENT_ID" <> 40) AND ("DEPARTMENT_ID" <> 40 OR "SALARY" <= 12000) AND ("DEPARTMENT_ID" <> 40 OR "SALARY" >= 8000)
| 0.206055 |
CREATE TABLE airlines (alid DECIMAL, name TEXT, iata TEXT, icao TEXT, callsign TEXT, country TEXT, active TEXT)
CREATE TABLE airports (apid DECIMAL, name TEXT, city TEXT, country TEXT, x DECIMAL, y DECIMAL, elevation DECIMAL, iata TEXT, icao TEXT)
CREATE TABLE routes (rid DECIMAL, dst_apid DECIMAL, dst_ap TEXT, src_apid DECIMAL, src_ap TEXT, alid DECIMAL, airline TEXT, codeshare TEXT)
|
What are the names of all cities with more than one airport and how many airports do they have?
|
SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1
|
SELECT "city", COUNT(*) FROM "airports" GROUP BY "city" HAVING COUNT(*) > 1
| 0.073242 |
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)
|
What is the number of urgent hospital admission patients who had a pleural fluid lab test?
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.fluid = "Pleural"
|
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Pleural" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "URGENT" = "demographic"."admission_type"
| 0.197266 |
CREATE TABLE table_name_87 (date VARCHAR, winning_score VARCHAR)
|
Which date was the Winning Score 72-66-67-71=276?
|
SELECT date FROM table_name_87 WHERE winning_score = 72 - 66 - 67 - 71 = 276
|
SELECT "date" FROM "table_name_87" WHERE "winning_score" = FALSE
| 0.0625 |
CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)
CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR)
|
Find the first and last name of all the teachers that teach EVELINA BROMLEY.
|
SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "EVELINA" AND T1.lastname = "BROMLEY"
|
SELECT "T2"."firstname", "T2"."lastname" FROM "list" AS "T1" JOIN "teachers" AS "T2" ON "T1"."classroom" = "T2"."classroom" WHERE "BROMLEY" = "T1"."lastname" AND "EVELINA" = "T1"."firstname"
| 0.185547 |
CREATE TABLE event (Event_ID INT, Date TEXT, Venue TEXT, Name TEXT, Event_Attendance INT)
CREATE TABLE news_report (journalist_ID INT, Event_ID INT, Work_Type TEXT)
CREATE TABLE journalist (journalist_ID INT, Name TEXT, Nationality TEXT, Age TEXT, Years_working INT)
|
Show me a bar chart for what are the nationalities and total ages of journalists?, I want to rank by the bar in descending.
|
SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality ORDER BY Nationality DESC
|
SELECT "Nationality", SUM("Age") FROM "journalist" GROUP BY "Nationality" ORDER BY "Nationality" DESC NULLS LAST
| 0.109375 |
CREATE TABLE table_16175217_1 (children_per_donor VARCHAR, allowed_recipients VARCHAR)
|
List the possible children per donor levels for countries where the allowed recipients is no data.
|
SELECT children_per_donor FROM table_16175217_1 WHERE allowed_recipients = "no data"
|
SELECT "children_per_donor" FROM "table_16175217_1" WHERE "allowed_recipients" = "no data"
| 0.087891 |
CREATE TABLE table_11734041_2 (position VARCHAR, height_in_ft VARCHAR, no_s_ VARCHAR)
|
What position is number 35 whose height is 6-6?
|
SELECT position FROM table_11734041_2 WHERE height_in_ft = "6-6" AND no_s_ = "35"
|
SELECT "position" FROM "table_11734041_2" WHERE "35" = "no_s_" AND "6-6" = "height_in_ft"
| 0.086914 |
CREATE TABLE table_50793 ("Event" TEXT, "Long Course/Short Course" TEXT, "Year Set" FLOAT, "Time" TEXT, "Meet" TEXT)
|
What was the latest year that had a 100m freestyle?
|
SELECT MAX("Year Set") FROM table_50793 WHERE "Event" = '100m freestyle'
|
SELECT MAX("Year Set") FROM "table_50793" WHERE "Event" = '100m freestyle'
| 0.072266 |
CREATE TABLE table_79761 ("Date" TEXT, "Home captain" TEXT, "Away captain" TEXT, "Venue" TEXT, "Result" TEXT)
|
What dates contained matches at the venue Bourda?
|
SELECT "Date" FROM table_79761 WHERE "Venue" = 'bourda'
|
SELECT "Date" FROM "table_79761" WHERE "Venue" = 'bourda'
| 0.055664 |
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)
|
how many patients were admitted to the hospital before the year 2184 with the procedure short title left heart cardiac cath?
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2184" AND procedures.short_title = "Left heart cardiac cath"
|
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Left heart cardiac cath" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "2184" > "demographic"."admityear"
| 0.232422 |
CREATE TABLE table_name_94 (municipality VARCHAR, rank VARCHAR)
|
What Municipality has a Rank of 44?
|
SELECT municipality FROM table_name_94 WHERE rank = 44
|
SELECT "municipality" FROM "table_name_94" WHERE "rank" = 44
| 0.058594 |
CREATE TABLE table_name_56 (date VARCHAR, game VARCHAR)
|
On what day was game 2 played?
|
SELECT date FROM table_name_56 WHERE game = 2
|
SELECT "date" FROM "table_name_56" WHERE "game" = 2
| 0.049805 |
CREATE TABLE table_56765 ("Year" FLOAT, "Film" TEXT, "Director" TEXT, "Producer" TEXT, "Cinematographer" TEXT)
|
What film was released in 1971?
|
SELECT "Film" FROM table_56765 WHERE "Year" = '1971'
|
SELECT "Film" FROM "table_56765" WHERE "Year" = '1971'
| 0.052734 |
CREATE TABLE table_test_20 ("id" INT, "ejection_fraction_ef" INT, "anemia" BOOLEAN, "gender" TEXT, "bleeding" INT, "systolic_blood_pressure_sbp" INT, "left_main_coronary_artery_stenosis" INT, "hemoglobin_a1c_hba1c" FLOAT, "renal_disease" BOOLEAN, "creatinine_clearance_cl" FLOAT, "prior_creatinine" FLOAT, "diastolic_blood_pressure_dbp" INT, "hypertension" BOOLEAN, "age" FLOAT, "NOUSE" FLOAT)
|
known renal insufficiency ( prior s _ creatinine > 2.5 mg % ( > 220 umol / l ) for male and 2 mg % ( > 175 umol / l ) ) for female
|
SELECT * FROM table_test_20 WHERE renal_disease = 1 OR ((gender = 'male' AND prior_creatinine > 2.5) OR (gender = 'female' AND prior_creatinine > 2))
|
SELECT * FROM "table_test_20" WHERE ("gender" = 'female' OR "gender" = 'male' OR "renal_disease" = 1) AND ("gender" = 'female' OR "prior_creatinine" > 2.5 OR "renal_disease" = 1) AND ("prior_creatinine" > 2 OR "renal_disease" = 1)
| 0.224609 |
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 treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
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 allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime 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 microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
|
what was the first height of patient 021-25705 in the last month.
|
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY patient.unitadmittime LIMIT 1
|
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '021-25705' GROUP BY "patienthealthsystemstayid") SELECT "patient"."admissionheight" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE DATETIME("patient"."unitadmittime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') AND NOT "_u_0"."" IS NULL AND NOT "patient"."admissionheight" IS NULL ORDER BY "patient"."unitadmittime" NULLS FIRST LIMIT 1
| 0.514648 |
CREATE TABLE table_49810 ("Player" TEXT, "Country" TEXT, "Year ( s ) won" TEXT, "Total" FLOAT, "To par" TEXT, "Finish" TEXT)
|
What finish has a total of more than 289 and won in 1979?
|
SELECT "Finish" FROM table_49810 WHERE "Total" > '289' AND "Year(s) won" = '1979'
|
SELECT "Finish" FROM "table_49810" WHERE "Total" > '289' AND "Year(s) won" = '1979'
| 0.081055 |
CREATE TABLE table_203_734 (id DECIMAL, "year" DECIMAL, "competition" TEXT, "venue" TEXT, "position" TEXT, "event" TEXT, "notes" TEXT)
|
what was the last year that had an achievement listed ?
|
SELECT MAX("year") FROM table_203_734
|
SELECT MAX("year") FROM "table_203_734"
| 0.038086 |
CREATE TABLE table_67569 ("Date" TEXT, "Location" TEXT, "Opponenent" TEXT, "Result" TEXT, "Match type" TEXT)
|
Who was the opponent when the result was 2-2 (draw)?
|
SELECT "Opponenent" FROM table_67569 WHERE "Result" = '2-2 (draw)'
|
SELECT "Opponenent" FROM "table_67569" WHERE "Result" = '2-2 (draw)'
| 0.066406 |
CREATE TABLE table_23286223_8 (location_attendance VARCHAR, date VARCHAR)
|
Where was the March 24 game played?
|
SELECT location_attendance FROM table_23286223_8 WHERE date = "March 24"
|
SELECT "location_attendance" FROM "table_23286223_8" WHERE "March 24" = "date"
| 0.076172 |
CREATE TABLE table_14589 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT)
|
Name the place for south africa and retief goosen
|
SELECT "Place" FROM table_14589 WHERE "Country" = 'south africa' AND "Player" = 'retief goosen'
|
SELECT "Place" FROM "table_14589" WHERE "Country" = 'south africa' AND "Player" = 'retief goosen'
| 0.094727 |
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label 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 inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount 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 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 d_icd_procedures (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 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 d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title 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 microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
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)
|
how many patients have received opn rt hemicolectomy nec during the same hospital encounter after the first treatment of contrast arteriogram-leg since 4 years ago?
|
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'contrast arteriogram-leg') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'opn rt hemicolectomy nec') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id
|
WITH "t2" AS (SELECT "admissions"."subject_id", "procedures_icd"."charttime", "admissions"."hadm_id" FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'opn rt hemicolectomy nec' JOIN "admissions" ON "admissions"."hadm_id" = "procedures_icd"."hadm_id" WHERE DATETIME("procedures_icd"."charttime") >= DATETIME(CURRENT_TIME(), '-4 year')) SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'contrast arteriogram-leg' JOIN "admissions" ON "admissions"."hadm_id" = "procedures_icd"."hadm_id" JOIN "t2" AS "t2" ON "admissions"."hadm_id" = "t2"."hadm_id" AND "admissions"."subject_id" = "t2"."subject_id" AND "procedures_icd"."charttime" < "t2"."charttime" WHERE DATETIME("procedures_icd"."charttime") >= DATETIME(CURRENT_TIME(), '-4 year')
| 0.958008 |
CREATE TABLE table_65812 ("Airing date" TEXT, "English title ( Chinese title ) " TEXT, "Number of episodes" FLOAT, "Genre" TEXT, "Official website" TEXT)
|
What's the official website of Burning Flame with 22 episodes?
|
SELECT "Official website" FROM table_65812 WHERE "Number of episodes" > '22' AND "English title (Chinese title)" = 'burning flame 烈火雄心'
|
SELECT "Official website" FROM "table_65812" WHERE "English title (Chinese title)" = 'burning flame 烈火雄心' AND "Number of episodes" > '22'
| 0.133789 |
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 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)
|
how many admitted in emergency underwent the procedure left heart cardiac catheterization?
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Left heart cardiac catheterization"
|
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Left heart cardiac catheterization" = "procedures"."long_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "EMERGENCY" = "demographic"."admission_type"
| 0.251953 |
CREATE TABLE table_name_97 (division VARCHAR, regular_season VARCHAR)
|
What division was the regular season 5th, Northeast?
|
SELECT division FROM table_name_97 WHERE regular_season = "5th, northeast"
|
SELECT "division" FROM "table_name_97" WHERE "5th, northeast" = "regular_season"
| 0.078125 |
CREATE TABLE university (School_ID INT, School TEXT, Location TEXT, Founded FLOAT, Affiliation TEXT, Enrollment FLOAT, Nickname TEXT, Primary_conference TEXT)
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)
|
Plot all_games_percent by grouped by all games as a bar graph, order y axis in desc order.
|
SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
|
SELECT "All_Games", "All_Games_Percent" FROM "basketball_match" ORDER BY "All_Games_Percent" DESC NULLS LAST
| 0.105469 |
CREATE TABLE table_26636 ("Episode #" TEXT, "Segment 1" TEXT, "Segment 2" TEXT, "Original airdate" TEXT, "Lessons taught" TEXT)
|
Name the lessons taught for episode # 2/205
|
SELECT "Lessons taught" FROM table_26636 WHERE "Episode #" = '2/205'
|
SELECT "Lessons taught" FROM "table_26636" WHERE "Episode #" = '2/205'
| 0.068359 |
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)
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)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
|
what is admission time and diagnoses short title of subject id 30011?
|
SELECT demographic.admittime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "30011"
|
SELECT "demographic"."admittime", "diagnoses"."short_title" FROM "demographic" JOIN "diagnoses" ON "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "30011" = "demographic"."subject_id"
| 0.18457 |
CREATE TABLE table_14308895_2 (country_territory VARCHAR, former_pageant VARCHAR)
|
which country has miss universe Hungary as former pageant?
|
SELECT country_territory FROM table_14308895_2 WHERE former_pageant = "Miss Universe Hungary"
|
SELECT "country_territory" FROM "table_14308895_2" WHERE "Miss Universe Hungary" = "former_pageant"
| 0.09668 |
CREATE TABLE table_21694 ("Winner" TEXT, "Country" TEXT, "Winter Olympics" TEXT, "FIS Nordic World Ski Championships" TEXT, "Holmenkollen" TEXT)
|
What year did the man from Norway who won the Holmenkollen in 1958 win the FIS Nordic World Ski Championships?
|
SELECT "FIS Nordic World Ski Championships" FROM table_21694 WHERE "Country" = 'Norway' AND "Holmenkollen" = '1958'
|
SELECT "FIS Nordic World Ski Championships" FROM "table_21694" WHERE "Country" = 'Norway' AND "Holmenkollen" = '1958'
| 0.114258 |
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 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 d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name 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 d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE diagnoses_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 chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE procedures_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)
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)
|
have there been any organisms found in the last microbiological tissue test of patient 88180 in 09/this year?
|
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88180) AND microbiologyevents.spec_type_desc = 'tissue' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', microbiologyevents.charttime) = '09' ORDER BY microbiologyevents.charttime DESC LIMIT 1
|
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 88180 GROUP BY "hadm_id") SELECT COUNT(*) > 0 FROM "microbiologyevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "microbiologyevents"."hadm_id" WHERE "microbiologyevents"."spec_type_desc" = 'tissue' AND DATETIME("microbiologyevents"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_0"."" IS NULL AND NOT "microbiologyevents"."org_name" IS NULL AND STRFTIME('%m', "microbiologyevents"."charttime") = '09' ORDER BY "microbiologyevents"."charttime" DESC NULLS LAST LIMIT 1
| 0.601563 |
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 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)
|
what is primary disease and discharge time of subject id 7273?
|
SELECT demographic.diagnosis, demographic.dischtime FROM demographic WHERE demographic.subject_id = "7273"
|
SELECT "demographic"."diagnosis", "demographic"."dischtime" FROM "demographic" WHERE "7273" = "demographic"."subject_id"
| 0.117188 |
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 allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
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 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 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 diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
|
what was the total enteral flush dose for patient 035-166 on 04/19/last year?
|
SELECT SUM(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 = '035-166')) AND intakeoutput.celllabel = 'enteral flush' AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m-%d', intakeoutput.intakeoutputtime) = '04-19'
|
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '035-166' 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 SUM("intakeoutput"."cellvaluenumeric") FROM "intakeoutput" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = 'enteral flush' AND "intakeoutput"."cellpath" LIKE '%intake%' AND DATETIME("intakeoutput"."intakeoutputtime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_1"."" IS NULL AND STRFTIME('%m-%d', "intakeoutput"."intakeoutputtime") = '04-19'
| 0.789063 |
CREATE TABLE table_23214833_1 (stadium VARCHAR, capacity VARCHAR)
|
What stadium has capacity for 13800?
|
SELECT stadium FROM table_23214833_1 WHERE capacity = 13800
|
SELECT "stadium" FROM "table_23214833_1" WHERE "capacity" = 13800
| 0.063477 |
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
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 lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime 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 microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
|
what was the medicine that was prescribed to patient 030-51920 in the same hospital encounter after undergoing a analgesics - narcotic analgesic in 06/this year?
|
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-51920') AND treatment.treatmentname = 'analgesics - narcotic analgesic' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', treatment.treatmenttime) = '06') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-51920') AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', medication.drugstarttime) = '06') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.drugstarttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid
|
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '030-51920' GROUP BY "patienthealthsystemstayid"), "t2" AS (SELECT "patient"."uniquepid", "medication"."drugname", "medication"."drugstarttime", "patient"."patienthealthsystemstayid" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" LEFT JOIN "_u_0" AS "_u_1" ON "_u_1"."" = "patient"."patienthealthsystemstayid" WHERE DATETIME("medication"."drugstarttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_1"."" IS NULL AND STRFTIME('%m', "medication"."drugstarttime") = '06') SELECT "t2"."drugname" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" JOIN "t2" AS "t2" ON "patient"."patienthealthsystemstayid" = "t2"."patienthealthsystemstayid" AND "patient"."uniquepid" = "t2"."uniquepid" AND "t2"."drugstarttime" > "treatment"."treatmenttime" WHERE "treatment"."treatmentname" = 'analgesics - narcotic analgesic' AND DATETIME("treatment"."treatmenttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_0"."" IS NULL AND STRFTIME('%m', "treatment"."treatmenttime") = '06'
| 1.298828 |
CREATE TABLE table_2817196_1 (points INT)
|
What is the largest number of points in a season?
|
SELECT MAX(points) FROM table_2817196_1
|
SELECT MAX("points") FROM "table_2817196_1"
| 0.041992 |
CREATE TABLE table_21025437_5 (title VARCHAR, written_by VARCHAR)
|
What was the title of the episode written by Keith Temple?
|
SELECT title FROM table_21025437_5 WHERE written_by = "Keith Temple"
|
SELECT "title" FROM "table_21025437_5" WHERE "Keith Temple" = "written_by"
| 0.072266 |
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 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 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 d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title 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 inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name 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_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
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)
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)
|
what was the last test that patient 27465 had received since 100 months ago?
|
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27465) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-100 month') ORDER BY labevents.charttime DESC LIMIT 1)
|
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 27465 GROUP BY "hadm_id") SELECT "d_labitems"."label" FROM "d_labitems" WHERE "d_labitems"."itemid" IN (SELECT "labevents"."itemid" FROM "labevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "labevents"."hadm_id" WHERE DATETIME("labevents"."charttime") >= DATETIME(CURRENT_TIME(), '-100 month') AND NOT "_u_0"."" IS NULL ORDER BY "labevents"."charttime" DESC NULLS LAST LIMIT 1)
| 0.464844 |
CREATE TABLE table_204_256 (id DECIMAL, "position" DECIMAL, "club" TEXT, "played" DECIMAL, "points" DECIMAL, "wins" DECIMAL, "draws" DECIMAL, "losses" DECIMAL, "goals for" DECIMAL, "goals against" DECIMAL, "goal difference" DECIMAL)
|
how many teams are there in total ?
|
SELECT COUNT("club") FROM table_204_256
|
SELECT COUNT("club") FROM "table_204_256"
| 0.040039 |
CREATE TABLE table_15738 ("Driver" TEXT, "Constructor" TEXT, "Laps" FLOAT, "Time/Retired" TEXT, "Grid" FLOAT)
|
How many laps did gunnar nilsson drive?
|
SELECT SUM("Laps") FROM table_15738 WHERE "Driver" = 'gunnar nilsson'
|
SELECT SUM("Laps") FROM "table_15738" WHERE "Driver" = 'gunnar nilsson'
| 0.069336 |
CREATE TABLE table_11609 ("Type" TEXT, "Model" TEXT, "Tuner" TEXT, "Host Interface" TEXT, "Digital" TEXT)
|
Tell me the Host interface for digital of dvb-t (cx22702) and model of nova-t pci (90002)
|
SELECT "Host Interface" FROM table_11609 WHERE "Digital" = 'dvb-t (cx22702)' AND "Model" = 'nova-t pci (90002)'
|
SELECT "Host Interface" FROM "table_11609" WHERE "Digital" = 'dvb-t (cx22702)' AND "Model" = 'nova-t pci (90002)'
| 0.110352 |
CREATE TABLE business (bid INT, business_id VARCHAR, name VARCHAR, full_address VARCHAR, city VARCHAR, latitude VARCHAR, longitude VARCHAR, review_count BIGINT, is_open TINYINT, rating FLOAT, state VARCHAR)
CREATE TABLE review (rid INT, business_id VARCHAR, user_id VARCHAR, rating FLOAT, text TEXT, year INT, month VARCHAR)
CREATE TABLE neighborhood (id INT, business_id VARCHAR, neighborhood_name VARCHAR)
CREATE TABLE checkin (cid INT, business_id VARCHAR, count INT, day VARCHAR)
CREATE TABLE category (id INT, business_id VARCHAR, category_name VARCHAR)
CREATE TABLE user (uid INT, user_id VARCHAR, name VARCHAR)
CREATE TABLE tip (tip_id INT, business_id VARCHAR, text TEXT, user_id VARCHAR, likes INT, year INT, month VARCHAR)
|
Find all Pet Groomers which have more than 100 reviews
|
SELECT business.name FROM business, category WHERE business.review_count > 100 AND category.business_id = business.business_id AND category.category_name = 'Pet Groomers'
|
SELECT "business"."name" FROM "business" JOIN "category" ON "business"."business_id" = "category"."business_id" AND "category"."category_name" = 'Pet Groomers' WHERE "business"."review_count" > 100
| 0.192383 |
CREATE TABLE table_27940 ("meas. num." FLOAT, "passed" TEXT, "YES votes" FLOAT, "NO votes" FLOAT, "% YES" TEXT, "Const. Amd.?" TEXT, "type" TEXT, "description" TEXT)
|
What is the aggregate number of yes votes where no votes is littler than 299939.1619948521 and % yes is 66.49%
|
SELECT COUNT("YES votes") FROM table_27940 WHERE "NO votes" < '299939.1619948521' AND "% YES" = '66.49%'
|
SELECT COUNT("YES votes") FROM "table_27940" WHERE "% YES" = '66.49%' AND "NO votes" < '299939.1619948521'
| 0.103516 |
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress 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 PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment 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 ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId 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 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 Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PostTypes (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 FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskStates (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 ReviewTaskTypes (Id DECIMAL, Name TEXT, Description 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 VoteTypes (Id DECIMAL, Name 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 SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
|
Number of Questions for a given tag.
|
SELECT COUNT(Questions.Id) AS Questions FROM Posts AS Questions INNER JOIN PostTags ON Questions.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Questions.PostTypeId = 1 AND Tags.TagName = 'microsoft-cognitive' OR Tags.TagName = 'azure-cognitive-services'
|
SELECT COUNT("Questions"."Id") AS "Questions" FROM "Posts" AS "Questions" JOIN "PostTags" ON "PostTags"."PostId" = "Questions"."Id" JOIN "Tags" ON "PostTags"."TagId" = "Tags"."Id" AND ("Questions"."PostTypeId" = 1 OR "Tags"."TagName" = 'azure-cognitive-services') AND ("Tags"."TagName" = 'azure-cognitive-services' OR "Tags"."TagName" = 'microsoft-cognitive')
| 0.350586 |
CREATE TABLE table_73716 ("Year" TEXT, "Superintendent" TEXT, "Middlesex Principal" TEXT, "Gorham Principal" TEXT, "Middle School Principal" TEXT, "High School Principal" TEXT)
|
How many years was lynn muscarella the high school principal and charlie wiltse the superintendent?
|
SELECT COUNT("Year") FROM table_73716 WHERE "High School Principal" = 'Lynn Muscarella' AND "Superintendent" = 'Charlie Wiltse'
|
SELECT COUNT("Year") FROM "table_73716" WHERE "High School Principal" = 'Lynn Muscarella' AND "Superintendent" = 'Charlie Wiltse'
| 0.125977 |
CREATE TABLE table_33925 ("City" TEXT, "Country" TEXT, "IATA" TEXT, "ICAO" TEXT, "Airport" TEXT)
|
What is the IATA for the chennai international airport?
|
SELECT "IATA" FROM table_33925 WHERE "Airport" = 'chennai international airport'
|
SELECT "IATA" FROM "table_33925" WHERE "Airport" = 'chennai international airport'
| 0.080078 |
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR)
|
what is the cheapest flight from DALLAS to BALTIMORE
|
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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND fare.one_direction_cost = (SELECT MIN(FAREalias1.one_direction_cost) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, fare AS FAREalias1, flight AS FLIGHTalias1, flight_fare AS FLIGHT_FAREalias1 WHERE CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'DALLAS' AND CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'BALTIMORE' AND FLIGHT_FAREalias1.fare_id = FAREalias1.fare_id AND FLIGHTalias1.flight_id = FLIGHT_FAREalias1.flight_id AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code) AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id
|
WITH "_u_0" AS (SELECT MIN("FAREalias1"."one_direction_cost") FROM "airport_service" AS "AIRPORT_SERVICEalias2" JOIN "city" AS "CITYalias2" ON "AIRPORT_SERVICEalias2"."city_code" = "CITYalias2"."city_code" AND "CITYalias2"."city_name" = 'DALLAS' JOIN "flight" AS "FLIGHTalias1" ON "AIRPORT_SERVICEalias2"."airport_code" = "FLIGHTalias1"."from_airport" JOIN "airport_service" AS "AIRPORT_SERVICEalias3" ON "AIRPORT_SERVICEalias3"."airport_code" = "FLIGHTalias1"."to_airport" JOIN "flight_fare" AS "FLIGHT_FAREalias1" ON "FLIGHT_FAREalias1"."flight_id" = "FLIGHTalias1"."flight_id" JOIN "city" AS "CITYalias3" ON "AIRPORT_SERVICEalias3"."city_code" = "CITYalias3"."city_code" AND "CITYalias3"."city_name" = 'BALTIMORE' JOIN "fare" AS "FAREalias1" ON "FAREalias1"."fare_id" = "FLIGHT_FAREalias1"."fare_id") SELECT DISTINCT "flight"."flight_id" FROM "airport_service" AS "AIRPORT_SERVICE_0" JOIN "city" AS "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'DALLAS' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" AS "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "flight_fare" ON "flight"."flight_id" = "flight_fare"."flight_id" JOIN "city" AS "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'BALTIMORE' JOIN "fare" ON "fare"."fare_id" = "flight_fare"."fare_id" JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "fare"."one_direction_cost"
| 1.469727 |
CREATE TABLE table_63815 ("Position" FLOAT, "Team" TEXT, "Played" FLOAT, "Wins" FLOAT, "Draws" FLOAT, "Losses" FLOAT, "Scored" FLOAT, "Conceded" FLOAT, "Points" FLOAT)
|
What is the number of wins when position was larger than 6, and conceded was smaller than 19?
|
SELECT COUNT("Wins") FROM table_63815 WHERE "Position" > '6' AND "Conceded" < '19'
|
SELECT COUNT("Wins") FROM "table_63815" WHERE "Conceded" < '19' AND "Position" > '6'
| 0.082031 |
CREATE TABLE table_name_62 (venue VARCHAR, home_team VARCHAR)
|
What venue featured fitzroy as the home squad?
|
SELECT venue FROM table_name_62 WHERE home_team = "fitzroy"
|
SELECT "venue" FROM "table_name_62" WHERE "fitzroy" = "home_team"
| 0.063477 |
CREATE TABLE table_63193 ("Artist" TEXT, "Album" TEXT, "Track ( s ) " TEXT, "Date" TEXT, "Label" TEXT)
|
Which Album has an Artist of various artists (compilation), and a Label of laface?
|
SELECT "Album" FROM table_63193 WHERE "Artist" = 'various artists (compilation)' AND "Label" = 'laface'
|
SELECT "Album" FROM "table_63193" WHERE "Artist" = 'various artists (compilation)' AND "Label" = 'laface'
| 0.102539 |
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
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 job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, 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)
|
Create a bar chart showing the number of state province across state province, and rank by the y-axis from high to low.
|
SELECT STATE_PROVINCE, COUNT(STATE_PROVINCE) FROM locations GROUP BY STATE_PROVINCE ORDER BY COUNT(STATE_PROVINCE) DESC
|
SELECT "STATE_PROVINCE", COUNT("STATE_PROVINCE") FROM "locations" GROUP BY "STATE_PROVINCE" ORDER BY COUNT("STATE_PROVINCE") DESC NULLS LAST
| 0.136719 |
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 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 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)
|
how many patients whose discharge location is long term care hospital and age is less than 61?
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND demographic.age < "61"
|
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "61" > "demographic"."age" AND "LONG TERM CARE HOSPITAL" = "demographic"."discharge_location"
| 0.164063 |
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
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 labevents (row_id DECIMAL, subject_id DECIMAL, hadm_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 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 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_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 d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
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)
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)
|
what are the top four most common surgeries of patients 50s this year?
|
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 50 AND 59) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 <= 4)
|
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."age" <= 59 AND "admissions"."age" >= 50 GROUP BY "hadm_id"), "t1" AS (SELECT "procedures_icd"."icd9_code", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "procedures_icd" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "procedures_icd"."hadm_id" WHERE DATETIME("procedures_icd"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_0"."" IS NULL GROUP BY "procedures_icd"."icd9_code"), "_u_1" AS (SELECT "t1"."icd9_code" FROM "t1" AS "t1" WHERE "t1"."c1" <= 4 GROUP BY "icd9_code") SELECT "d_icd_procedures"."short_title" FROM "d_icd_procedures" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "d_icd_procedures"."icd9_code" WHERE NOT "_u_1"."" IS NULL
| 0.768555 |
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)
|
find out the short title of diagnoses and long title of diagnoses for patient with patient id 11221.
|
SELECT diagnoses.short_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "11221"
|
SELECT "diagnoses"."short_title", "procedures"."long_title" FROM "diagnoses" JOIN "procedures" ON "diagnoses"."hadm_id" = "procedures"."hadm_id" WHERE "11221" = "diagnoses"."subject_id"
| 0.180664 |
CREATE TABLE table_26400041_2 (weeks_in_top_10 INT, peak VARCHAR)
|
if the peak is 9, how many weeks was it in the top 10?
|
SELECT MAX(weeks_in_top_10) FROM table_26400041_2 WHERE peak = 9
|
SELECT MAX("weeks_in_top_10") FROM "table_26400041_2" WHERE "peak" = 9
| 0.068359 |
CREATE TABLE table_15631 ("Season" TEXT, "Games" FLOAT, "Lost" FLOAT, "Tied" TEXT, "Points" FLOAT, "Goals for" FLOAT, "Goals against" FLOAT, "Standing" TEXT)
|
What are the total Goals against with 72 points and more than 37 losses?
|
SELECT SUM("Goals against") FROM table_15631 WHERE "Points" = '72' AND "Lost" > '37'
|
SELECT SUM("Goals against") FROM "table_15631" WHERE "Lost" > '37' AND "Points" = '72'
| 0.083984 |
CREATE TABLE table_45515 ("Rank" TEXT, "Team" TEXT, "Athletes" TEXT, "Run 1" TEXT, "Run 2" TEXT, "Run 3" TEXT, "Run 4" TEXT, "Final" TEXT)
|
Which Run 2 has a Rank of 4?
|
SELECT "Run 2" FROM table_45515 WHERE "Rank" = '4'
|
SELECT "Run 2" FROM "table_45515" WHERE "Rank" = '4'
| 0.050781 |
CREATE TABLE table_12496904_1 (_august_15 VARCHAR, _2002 VARCHAR, population INT)
|
What is the highest population for the
|
SELECT MAX(population), _august_15, _2002 FROM table_12496904_1
|
SELECT MAX("population"), "_august_15", "_2002" FROM "table_12496904_1"
| 0.069336 |
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)
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)
|
count the number of patients whose religion is romanian east. orth.
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "ROMANIAN EAST. ORTH"
|
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "ROMANIAN EAST. ORTH" = "demographic"."religion"
| 0.120117 |
CREATE TABLE table_10667 ("Driver" TEXT, "Constructor" TEXT, "Laps" FLOAT, "Time/Retired" TEXT, "Grid" FLOAT)
|
how many laps have a time/retired of +1 lap and mark blundell is the driver?
|
SELECT AVG("Laps") FROM table_10667 WHERE "Time/Retired" = '+1 lap' AND "Driver" = 'mark blundell'
|
SELECT AVG("Laps") FROM "table_10667" WHERE "Driver" = 'mark blundell' AND "Time/Retired" = '+1 lap'
| 0.097656 |
CREATE TABLE table_name_51 (margin_of_victory VARCHAR, runner_s__up VARCHAR)
|
What was the margin of victory over Brad Faxon?
|
SELECT margin_of_victory FROM table_name_51 WHERE runner_s__up = "brad faxon"
|
SELECT "margin_of_victory" FROM "table_name_51" WHERE "brad faxon" = "runner_s__up"
| 0.081055 |
CREATE TABLE table_name_2 (venue VARCHAR, result VARCHAR)
|
What is the Venue where the Result is 5 1?
|
SELECT venue FROM table_name_2 WHERE result = "5–1"
|
SELECT "venue" FROM "table_name_2" WHERE "5–1" = "result"
| 0.055664 |
CREATE TABLE trust (source_u_id INT, target_u_id INT, trust INT)
CREATE TABLE review (a_id INT, u_id INT, i_id INT, rating INT, rank INT)
CREATE TABLE useracct (u_id INT, name VARCHAR)
CREATE TABLE item (i_id INT, title VARCHAR)
|
For each user, find their name and the number of reviews written by them Show bar chart, and I want to list by the names from low to high.
|
SELECT name, COUNT(*) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id ORDER BY name
|
SELECT "name", COUNT(*) FROM "useracct" AS "T1" JOIN "review" AS "T2" ON "T1"."u_id" = "T2"."u_id" GROUP BY "T2"."u_id" ORDER BY "name" NULLS FIRST
| 0.143555 |
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 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 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 intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime 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)
|
tell me the change in bedside glucose levels of patient 027-178495 measured at 2102-06-02 12:25:17 compared to the value measured at 2102-06-02 00:23:17?
|
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-178495')) AND lab.labname = 'bedside glucose' AND lab.labresulttime = '2102-06-02 12:25:17') - (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-178495')) AND lab.labname = 'bedside glucose' AND lab.labresulttime = '2102-06-02 00:23:17')
|
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '027-178495' 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"), "_u_4" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_3" ON "_u_3"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_3"."" IS NULL GROUP BY "patientunitstayid") SELECT (SELECT "lab"."labresult" FROM "lab" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'bedside glucose' AND "lab"."labresulttime" = '2102-06-02 12:25:17' AND NOT "_u_1"."" IS NULL) - (SELECT "lab"."labresult" FROM "lab" LEFT JOIN "_u_4" AS "_u_4" ON "_u_4"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'bedside glucose' AND "lab"."labresulttime" = '2102-06-02 00:23:17' AND NOT "_u_4"."" IS NULL)
| 0.993164 |
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 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 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)
|
how many patients with white ethnic background are diagnosed with unspecified pleural effusion?
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.short_title = "Pleural effusion NOS"
|
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Pleural effusion NOS" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "WHITE" = "demographic"."ethnicity"
| 0.227539 |
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)
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)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
|
what is the number of patients whose admission type is emergency and procedure short title is nasal sinus dx proc nec?
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.short_title = "Nasal sinus dx proc NEC"
|
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Nasal sinus dx proc NEC" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "EMERGENCY" = "demographic"."admission_type"
| 0.242188 |
CREATE TABLE table_9848 ("Volume:Issue" TEXT, "Issue Date ( s ) " TEXT, "Weeks on Top" TEXT, "Song" TEXT, "Artist" TEXT)
|
Volume:Issue 67:3-11 had how many weeks on top?
|
SELECT "Weeks on Top" FROM table_9848 WHERE "Volume:Issue" = '67:3-11'
|
SELECT "Weeks on Top" FROM "table_9848" WHERE "Volume:Issue" = '67:3-11'
| 0.070313 |
CREATE TABLE student (stuid DECIMAL, lname TEXT, fname TEXT, age DECIMAL, sex TEXT, major DECIMAL, advisor DECIMAL, city_code TEXT)
CREATE TABLE has_allergy (stuid DECIMAL, allergy TEXT)
CREATE TABLE allergy_type (allergy TEXT, allergytype TEXT)
|
What are the student ids for all male students?
|
SELECT stuid FROM student WHERE sex = 'M'
|
SELECT "stuid" FROM "student" WHERE "sex" = 'M'
| 0.045898 |
CREATE TABLE table_name_84 (away_team VARCHAR, venue VARCHAR)
|
Who is the away team at western oval?
|
SELECT away_team AS score FROM table_name_84 WHERE venue = "western oval"
|
SELECT "away_team" AS "score" FROM "table_name_84" WHERE "venue" = "western oval"
| 0.079102 |
CREATE TABLE table_32905 ("Stage" TEXT, "Winner" TEXT, "General classification" TEXT, "Points classification" TEXT, "Young rider classification" TEXT, "Team classification" TEXT)
|
What is Ludo Peeters' team classification?
|
SELECT "Team classification" FROM table_32905 WHERE "Winner" = 'ludo peeters'
|
SELECT "Team classification" FROM "table_32905" WHERE "Winner" = 'ludo peeters'
| 0.077148 |
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)
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 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)
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 cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
|
how many days have passed since cephulac was prescribed to patient 006-47576 first in the current hospital encounter?
|
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47576') AND patient.hospitaldischargetime IS NULL) AND medication.drugname = 'cephulac' ORDER BY medication.drugstarttime LIMIT 1
|
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '006-47576' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE "patient"."hospitaldischargetime" IS NULL AND NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "medication"."drugstarttime")) FROM "medication" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "medication"."patientunitstayid" WHERE "medication"."drugname" = 'cephulac' AND NOT "_u_1"."" IS NULL ORDER BY "medication"."drugstarttime" NULLS FIRST LIMIT 1
| 0.697266 |
CREATE TABLE table_name_8 (song VARCHAR, artist VARCHAR)
|
What's the song of artist liam reilly?
|
SELECT song FROM table_name_8 WHERE artist = "liam reilly"
|
SELECT "song" FROM "table_name_8" WHERE "artist" = "liam reilly"
| 0.0625 |
CREATE TABLE Stores (Store_ID VARCHAR, Address_ID INT, Marketing_Region_Code CHAR, Store_Name VARCHAR, Store_Phone VARCHAR, Store_Email_Address VARCHAR, Other_Details VARCHAR)
CREATE TABLE Order_Items (Order_Item_ID INT, Order_ID INT, Product_ID INT, Order_Quantity VARCHAR, Other_Item_Details VARCHAR)
CREATE TABLE Ref_Payment_Methods (payment_method_code CHAR, payment_method_description VARCHAR)
CREATE TABLE Invoices (Invoice_ID INT, Order_ID INT, payment_method_code CHAR, Product_ID INT, Order_Quantity VARCHAR, Other_Item_Details VARCHAR, Order_Item_ID INT)
CREATE TABLE Invoice_Items (Invoice_Item_ID INT, Invoice_ID INT, Order_ID INT, Order_Item_ID INT, Product_ID INT, Order_Quantity INT, Other_Item_Details VARCHAR)
CREATE TABLE Customer_Orders (Order_ID INT, Customer_ID INT, Store_ID INT, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR)
CREATE TABLE Performers_in_Bookings (Order_ID INT, Performer_ID INT)
CREATE TABLE Customers (Customer_ID VARCHAR, Address_ID INT, Customer_Name VARCHAR, Customer_Phone VARCHAR, Customer_Email_Address VARCHAR, Other_Details VARCHAR)
CREATE TABLE Ref_Service_Types (Service_Type_Code CHAR, Parent_Service_Type_Code CHAR, Service_Type_Description VARCHAR)
CREATE TABLE Performers (Performer_ID INT, Address_ID INT, Customer_Name VARCHAR, Customer_Phone VARCHAR, Customer_Email_Address VARCHAR, Other_Details VARCHAR)
CREATE TABLE Products (Product_ID VARCHAR, Product_Name VARCHAR, Product_Price DECIMAL, Product_Description VARCHAR, Other_Product_Service_Details VARCHAR)
CREATE TABLE Drama_Workshop_Groups (Workshop_Group_ID INT, Address_ID INT, Currency_Code CHAR, Marketing_Region_Code CHAR, Store_Name VARCHAR, Store_Phone VARCHAR, Store_Email_Address VARCHAR, Other_Details VARCHAR)
CREATE TABLE Addresses (Address_ID VARCHAR, Line_1 VARCHAR, Line_2 VARCHAR, City_Town VARCHAR, State_County VARCHAR, Other_Details VARCHAR)
CREATE TABLE Bookings (Booking_ID INT, Customer_ID INT, Workshop_Group_ID VARCHAR, Status_Code CHAR, Store_ID INT, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR)
CREATE TABLE Services (Service_ID INT, Service_Type_Code CHAR, Workshop_Group_ID INT, Product_Description VARCHAR, Product_Name VARCHAR, Product_Price DECIMAL, Other_Product_Service_Details VARCHAR)
CREATE TABLE Bookings_Services (Order_ID INT, Product_ID INT)
CREATE TABLE Clients (Client_ID INT, Address_ID INT, Customer_Email_Address VARCHAR, Customer_Name VARCHAR, Customer_Phone VARCHAR, Other_Details VARCHAR)
CREATE TABLE Marketing_Regions (Marketing_Region_Code CHAR, Marketing_Region_Name VARCHAR, Marketing_Region_Descriptrion VARCHAR, Other_Details VARCHAR)
|
Give me the descriptions of the service types that cost more than 100, and count them by a bar chart, and display by the bar in descending.
|
SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY Service_Type_Description DESC
|
SELECT "Service_Type_Description", COUNT("Service_Type_Description") FROM "Ref_Service_Types" AS "T1" JOIN "Services" AS "T2" ON "T1"."Service_Type_Code" = "T2"."Service_Type_Code" AND "T2"."Product_Price" > 100 GROUP BY "Service_Type_Description" ORDER BY "Service_Type_Description" DESC NULLS LAST
| 0.291992 |
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 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 gsi (course_offering_id INT, student_id INT)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE area (course_id INT, area 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 program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year 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 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 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 comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
|
What has Dr. Brian Zikmund-fisher taught ?
|
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = course_offering.course_id AND instructor.name LIKE '%Brian Zikmund-fisher%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id
|
SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "semester" AS "SEMESTERalias0" ON "SEMESTERalias0"."semester" = 'WN' AND "SEMESTERalias0"."semester_id" > "course_offering"."semester" AND "SEMESTERalias0"."year" = 2016 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 '%Brian Zikmund-fisher%'
| 0.571289 |
CREATE TABLE Subjects (subject_id INT, subject_name VARCHAR)
CREATE TABLE Students (student_id INT, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR, password VARCHAR, personal_name VARCHAR, middle_name VARCHAR, family_name VARCHAR)
CREATE TABLE Courses (course_id INT, author_id INT, subject_id INT, course_name VARCHAR, course_description VARCHAR)
CREATE TABLE Student_Tests_Taken (registration_id INT, date_test_taken DATETIME, test_result VARCHAR)
CREATE TABLE Student_Course_Enrolment (registration_id INT, student_id INT, course_id INT, date_of_enrolment DATETIME, date_of_completion DATETIME)
CREATE TABLE Course_Authors_and_Tutors (author_id INT, author_tutor_ATB VARCHAR, login_name VARCHAR, password VARCHAR, personal_name VARCHAR, middle_name VARCHAR, family_name VARCHAR, gender_mf VARCHAR, address_line_1 VARCHAR)
|
List each test result and its count in descending order of count by a bar chart.
|
SELECT test_result, COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC
|
SELECT "test_result", COUNT(*) FROM "Student_Tests_Taken" GROUP BY "test_result" ORDER BY COUNT(*) DESC NULLS LAST
| 0.111328 |
CREATE TABLE table_17984 ("No." FLOAT, "Air Date" TEXT, "Rating" TEXT, "Share" FLOAT, "18-49 ( Rating/Share ) " TEXT, "Viewers ( m ) " TEXT, "Night" FLOAT, "Timeslot" FLOAT, "Overall" TEXT)
|
how many air date with overall being 83/95
|
SELECT COUNT("Air Date") FROM table_17984 WHERE "Overall" = '83/95'
|
SELECT COUNT("Air Date") FROM "table_17984" WHERE "Overall" = '83/95'
| 0.067383 |
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 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 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 admission location is clinic referral/premature and year of birth is less than 2112?
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.dob_year < "2112"
|
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2112" > "demographic"."dob_year" AND "CLINIC REFERRAL/PREMATURE" = "demographic"."admission_location"
| 0.172852 |
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 Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, 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 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 PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount 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 VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId 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 PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
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 PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description 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)
|
Top SO users in South Carolina area.
|
SELECT Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%south carolina%' ORDER BY Reputation DESC
|
SELECT "Id" AS "user_link", "Reputation", "Location" FROM "Users" WHERE LOWER("Location") LIKE '%south carolina%' ORDER BY "Reputation" DESC NULLS LAST
| 0.147461 |
CREATE TABLE table_name_61 (area_km_2 INT, official_name VARCHAR, population VARCHAR)
|
Which Area km 2 has an Official Name of southampton, and a Population larger than 1,601?
|
SELECT MIN(area_km_2) FROM table_name_61 WHERE official_name = "southampton" AND population > 1 OFFSET 601
|
SELECT MIN("area_km_2") FROM "table_name_61" WHERE "official_name" = "southampton" AND "population" > 1 OFFSET 601
| 0.111328 |
CREATE TABLE table_14023 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Attendance" FLOAT)
|
Who did the Eagle's play on November 5, 1961?
|
SELECT "Opponent" FROM table_14023 WHERE "Date" = 'november 5, 1961'
|
SELECT "Opponent" FROM "table_14023" WHERE "Date" = 'november 5, 1961'
| 0.068359 |
CREATE TABLE table_16250 ("Season" TEXT, "Series" TEXT, "Team Name" TEXT, "Races" FLOAT, "Poles" FLOAT, "Wins" FLOAT, "Points" FLOAT, "Position" TEXT)
|
what is the score for the dams?
|
SELECT "Points" FROM table_16250 WHERE "Team Name" = 'DAMS'
|
SELECT "Points" FROM "table_16250" WHERE "Team Name" = 'DAMS'
| 0.05957 |
CREATE TABLE nurse (employeeid DECIMAL, name TEXT, position TEXT, registered BOOLEAN, ssn DECIMAL)
CREATE TABLE medication (code DECIMAL, name TEXT, brand TEXT, description TEXT)
CREATE TABLE undergoes (patient DECIMAL, procedures DECIMAL, stay DECIMAL, dateundergoes TIME, physician DECIMAL, assistingnurse DECIMAL)
CREATE TABLE procedures (code DECIMAL, name TEXT, cost DECIMAL)
CREATE TABLE appointment (appointmentid DECIMAL, patient DECIMAL, prepnurse DECIMAL, physician DECIMAL, start TIME, end TIME, examinationroom TEXT)
CREATE TABLE prescribes (physician DECIMAL, patient DECIMAL, medication DECIMAL, date TIME, appointment DECIMAL, dose TEXT)
CREATE TABLE trained_in (physician DECIMAL, treatment DECIMAL, certificationdate TIME, certificationexpires TIME)
CREATE TABLE department (departmentid DECIMAL, name TEXT, head DECIMAL)
CREATE TABLE patient (ssn DECIMAL, name TEXT, address TEXT, phone TEXT, insuranceid DECIMAL, pcp DECIMAL)
CREATE TABLE room (roomnumber DECIMAL, roomtype TEXT, blockfloor DECIMAL, blockcode DECIMAL, unavailable BOOLEAN)
CREATE TABLE on_call (nurse DECIMAL, blockfloor DECIMAL, blockcode DECIMAL, oncallstart TIME, oncallend TIME)
CREATE TABLE physician (employeeid DECIMAL, name TEXT, position TEXT, ssn DECIMAL)
CREATE TABLE block (blockfloor DECIMAL, blockcode DECIMAL)
CREATE TABLE stay (stayid DECIMAL, patient DECIMAL, room DECIMAL, staystart TIME, stayend TIME)
CREATE TABLE affiliated_with (physician DECIMAL, department DECIMAL, primaryaffiliation BOOLEAN)
|
Tell me the distinct block codes where some rooms are available.
|
SELECT DISTINCT blockcode FROM room WHERE unavailable = 0
|
SELECT DISTINCT "blockcode" FROM "room" WHERE "unavailable" = 0
| 0.061523 |
CREATE TABLE table_name_76 (name VARCHAR, species_authority VARCHAR)
|
What is the name for the species Authority of sigmodon hispidus say & ord, 1825?
|
SELECT name FROM table_name_76 WHERE species_authority = "sigmodon hispidus say & ord, 1825"
|
SELECT "name" FROM "table_name_76" WHERE "sigmodon hispidus say & ord, 1825" = "species_authority"
| 0.095703 |
CREATE TABLE candidate (Candidate_ID INT, People_ID INT, Poll_Source TEXT, Date TEXT, Support_rate FLOAT, Consider_rate FLOAT, Oppose_rate FLOAT, Unsure_rate FLOAT)
CREATE TABLE people (People_ID INT, Sex TEXT, Name TEXT, Date_of_Birth TEXT, Height FLOAT, Weight FLOAT)
|
Visualize a bar chart about the distribution of Sex and the average of Height , and group by attribute Sex, I want to order mean height from high to low order.
|
SELECT Sex, AVG(Height) FROM people GROUP BY Sex ORDER BY AVG(Height) DESC
|
SELECT "Sex", AVG("Height") FROM "people" GROUP BY "Sex" ORDER BY AVG("Height") DESC NULLS LAST
| 0.092773 |
CREATE TABLE table_7129 ("Television service" TEXT, "Country" TEXT, "Language" TEXT, "Content" TEXT, "HDTV" TEXT, "Package/Option" TEXT)
|
What is the HDTV when the content is general television?
|
SELECT "HDTV" FROM table_7129 WHERE "Content" = 'general television'
|
SELECT "HDTV" FROM "table_7129" WHERE "Content" = 'general television'
| 0.068359 |
CREATE TABLE cite (citingpaperid INT, citedpaperid INT)
CREATE TABLE journal (journalid INT, journalname VARCHAR)
CREATE TABLE venue (venueid INT, venuename VARCHAR)
CREATE TABLE paperfield (fieldid INT, paperid INT)
CREATE TABLE paperkeyphrase (paperid INT, keyphraseid INT)
CREATE TABLE paper (paperid INT, title VARCHAR, venueid INT, year INT, numciting INT, numcitedby INT, journalid INT)
CREATE TABLE dataset (datasetid INT, datasetname VARCHAR)
CREATE TABLE paperdataset (paperid INT, datasetid INT)
CREATE TABLE writes (paperid INT, authorid INT)
CREATE TABLE keyphrase (keyphraseid INT, keyphrasename VARCHAR)
CREATE TABLE author (authorid INT, authorname VARCHAR)
CREATE TABLE field (fieldid INT)
|
newest deep learning papers
|
SELECT DISTINCT paper.paperid, paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'deep learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid ORDER BY paper.year DESC
|
SELECT DISTINCT "paper"."paperid", "paper"."year" FROM "keyphrase" JOIN "paperkeyphrase" ON "keyphrase"."keyphraseid" = "paperkeyphrase"."keyphraseid" JOIN "paper" ON "paper"."paperid" = "paperkeyphrase"."paperid" WHERE "keyphrase"."keyphrasename" = 'deep learning' ORDER BY "paper"."year" DESC NULLS LAST
| 0.297852 |
CREATE TABLE table_72154 ("School" TEXT, "Mascot" TEXT, "Location" TEXT, "League" TEXT, "Enrollment" FLOAT)
|
Which school has the Raiders as their mascot?
|
SELECT "School" FROM table_72154 WHERE "Mascot" = 'Raiders'
|
SELECT "School" FROM "table_72154" WHERE "Mascot" = 'Raiders'
| 0.05957 |
CREATE TABLE table_58904 ("Date" TEXT, "Tournament" TEXT, "Surface" TEXT, "Opponent in Final" TEXT, "Score in Final" TEXT)
|
What is Opponent in Final, when Date is '13 January 1992'?
|
SELECT "Opponent in Final" FROM table_58904 WHERE "Date" = '13 january 1992'
|
SELECT "Opponent in Final" FROM "table_58904" WHERE "Date" = '13 january 1992'
| 0.076172 |
CREATE TABLE table_name_7 (date VARCHAR, winning_score VARCHAR)
|
When was the winning score 6 (69-69-73-71=282)?
|
SELECT date FROM table_name_7 WHERE winning_score = −6(69 - 69 - 73 - 71 = 282)
|
SELECT "date" FROM "table_name_7" WHERE "winning_score" = −6(FALSE)
| 0.06543 |
CREATE TABLE table_name_1 (kit_manufacturer VARCHAR, shirt_sponsor VARCHAR)
|
What is the kit manufacturer with Walkers as the shirt sponsor?
|
SELECT kit_manufacturer FROM table_name_1 WHERE shirt_sponsor = "walkers"
|
SELECT "kit_manufacturer" FROM "table_name_1" WHERE "shirt_sponsor" = "walkers"
| 0.077148 |
CREATE TABLE table_name_79 (name VARCHAR, transfer_window VARCHAR, moving_from VARCHAR)
|
What is the name of the player with a winter transfer window moving from Roma?
|
SELECT name FROM table_name_79 WHERE transfer_window = "winter" AND moving_from = "roma"
|
SELECT "name" FROM "table_name_79" WHERE "moving_from" = "roma" AND "transfer_window" = "winter"
| 0.09375 |
CREATE TABLE table_name_88 (phonetic VARCHAR, standard_thai VARCHAR)
|
What is the phonetic when the standard thai is ?
|
SELECT phonetic FROM table_name_88 WHERE standard_thai = "ผ่า"
|
SELECT "phonetic" FROM "table_name_88" WHERE "standard_thai" = "ผ่า"
| 0.066406 |
CREATE TABLE table_name_14 (competition VARCHAR, date VARCHAR)
|
what is the competition when the date is 16 january 1996?
|
SELECT competition FROM table_name_14 WHERE date = "16 january 1996"
|
SELECT "competition" FROM "table_name_14" WHERE "16 january 1996" = "date"
| 0.072266 |
CREATE TABLE table_name_59 (rank VARCHAR, name VARCHAR, assists VARCHAR)
|
With more than 69 Assists, what is Dejuan Collins' Rank?
|
SELECT COUNT(rank) FROM table_name_59 WHERE name = "dejuan collins" AND assists > 69
|
SELECT COUNT("rank") FROM "table_name_59" WHERE "assists" > 69 AND "dejuan collins" = "name"
| 0.089844 |
CREATE TABLE table_51825 ("Outcome" TEXT, "Date" FLOAT, "Championship" TEXT, "Surface" TEXT, "Opponent in the final" TEXT, "Score in the final" TEXT)
|
What is the most recent date for a singles final with the score of 1 6, 4 6, 5 7?
|
SELECT MAX("Date") FROM table_51825 WHERE "Score in the final" = '1–6, 4–6, 5–7'
|
SELECT MAX("Date") FROM "table_51825" WHERE "Score in the final" = '1–6, 4–6, 5–7'
| 0.080078 |
CREATE TABLE table_64238 ("Title" TEXT, "Label" TEXT, "Year of Release" FLOAT, "Country of Release" TEXT, "Peaches:" TEXT)
|
When the country of release is EU, what is the label name?
|
SELECT "Label" FROM table_64238 WHERE "Country of Release" = 'eu'
|
SELECT "Label" FROM "table_64238" WHERE "Country of Release" = 'eu'
| 0.06543 |
CREATE TABLE table_name_39 (round INT, name VARCHAR, pick VARCHAR)
|
What is the sum of the round of Fred Smoot, who has a pick number greater than 14?
|
SELECT SUM(round) FROM table_name_39 WHERE name = "fred smoot" AND pick > 14
|
SELECT SUM("round") FROM "table_name_39" WHERE "fred smoot" = "name" AND "pick" > 14
| 0.082031 |
CREATE TABLE table_31754 ("Year" FLOAT, "Class" TEXT, "Team" TEXT, "Points" FLOAT, "Rank" TEXT, "Wins" FLOAT)
|
Tell me the total number of years for wins less than 2 and class of 50cc with points of 15
|
SELECT COUNT("Year") FROM table_31754 WHERE "Wins" < '2' AND "Class" = '50cc' AND "Points" = '15'
|
SELECT COUNT("Year") FROM "table_31754" WHERE "Class" = '50cc' AND "Points" = '15' AND "Wins" < '2'
| 0.09668 |
CREATE TABLE table_59739 ("Year" TEXT, "Winner" TEXT, "Runner-up" TEXT, "Venue" TEXT, "Location" TEXT)
|
Who is the winner when mark fuller was the runner-up?
|
SELECT "Winner" FROM table_59739 WHERE "Runner-up" = 'mark fuller'
|
SELECT "Winner" FROM "table_59739" WHERE "Runner-up" = 'mark fuller'
| 0.066406 |
CREATE TABLE table_43765 ("Date" TEXT, "Visitor" TEXT, "Score" TEXT, "Home" TEXT, "Leading scorer" TEXT, "Attendance" TEXT, "Record" TEXT)
|
Where was the home court on April 14?
|
SELECT "Home" FROM table_43765 WHERE "Date" = 'april 14'
|
SELECT "Home" FROM "table_43765" WHERE "Date" = 'april 14'
| 0.056641 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.