schema
stringlengths
29
5.42k
question
stringlengths
0
752
rejected
stringlengths
2
4.44k
chosen
stringlengths
4
8.94k
weight
float64
0
8.73
CREATE TABLE table_43409 ("Year ( Ceremony ) " CLOB, "Film title used in nomination" CLOB, "Serbian title" CLOB, "Director" CLOB, "Result" CLOB)
In what Year was Labyrinth nominated?
SELECT "Year (Ceremony)" FROM table_43409 WHERE "Film title used in nomination" = 'labyrinth'
SELECT "Year (Ceremony)" FROM "table_43409" WHERE "Film title used in nomination" = 'labyrinth'
0.092773
CREATE TABLE camera_lens (id NUMBER, brand CLOB, name CLOB, focal_length_mm FLOAT, max_aperture FLOAT) CREATE TABLE photos (id NUMBER, camera_lens_id NUMBER, mountain_id NUMBER, color CLOB, name CLOB) CREATE TABLE mountain (id NUMBER, name CLOB, Height FLOAT, Prominence FLOAT, Range CLOB, Country CLOB)
What are the correlation between the height and prominence of mountains which do not belong to the range 'Aberdare Range'? Plot the result by a scatter chart.
SELECT Height, Prominence FROM mountain WHERE Range <> 'Aberdare Range'
SELECT "Height", "Prominence" FROM "mountain" WHERE "Range" <> 'Aberdare Range'
0.077148
CREATE TABLE table_204_143 (id NUMBER, "national park" CLOB, "region" CLOB, "land area ( km2 ) " NUMBER, "established" NUMBER, "visitation ( 2009 ) " NUMBER, "coordinates" CLOB)
how many of finland 's national parks were established after the year 2000 ?
SELECT COUNT("national park") FROM table_204_143 WHERE "established" > 2000
SELECT COUNT("national park") FROM "table_204_143" WHERE "established" > 2000
0.075195
CREATE TABLE table_name_88 (player VARCHAR2, score VARCHAR2)
What Player's Score is 69-71-69=208?
SELECT player FROM table_name_88 WHERE score = 69 - 71 - 69 = 208
SELECT "player" FROM "table_name_88" WHERE "score" = FALSE
0.056641
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
give me the number of patients whose year of birth is less than 2101 and procedure short title is gastroenterostomy nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2101" AND procedures.short_title = "Gastroenterostomy NEC"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Gastroenterostomy NEC" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "2101" > "demographic"."dob_year"
0.229492
CREATE TABLE table_65720 ("School" CLOB, "Location" CLOB, "Mascot" CLOB, "Enrollment" FLOAT, "IHSAA Class" CLOB, "# / County" CLOB)
What school in 72 Scott county has an enrollment more than 473 with an AAA IHSAA Class?
SELECT "School" FROM table_65720 WHERE "Enrollment" > '473' AND "IHSAA Class" = 'aaa' AND "# / County" = '72 scott'
SELECT "School" FROM "table_65720" WHERE "# / County" = '72 scott' AND "Enrollment" > '473' AND "IHSAA Class" = 'aaa'
0.114258
CREATE TABLE table_name_50 (song VARCHAR2, draw VARCHAR2, points VARCHAR2, national_final VARCHAR2)
what is the song when the points is more than 64, the national final is 4th and draw is more than 3?
SELECT song FROM table_name_50 WHERE points > 64 AND national_final = "4th" AND draw > 3
SELECT "song" FROM "table_name_50" WHERE "4th" = "national_final" AND "draw" > 3 AND "points" > 64
0.095703
CREATE TABLE table_52500 ("Film" CLOB, "Song" CLOB, "Year" FLOAT, "Music Director" CLOB, "Language" CLOB)
Tell me the song with year before 2013 and music director of yuvan shankar raja and film of billa ii
SELECT "Song" FROM table_52500 WHERE "Year" < '2013' AND "Music Director" = 'yuvan shankar raja' AND "Film" = 'billa ii'
SELECT "Song" FROM "table_52500" WHERE "Film" = 'billa ii' AND "Music Director" = 'yuvan shankar raja' AND "Year" < '2013'
0.119141
CREATE TABLE table_2911781_3 (constructor VARCHAR2, grand_prix VARCHAR2)
What was the constructor in the Belgian Grand Prix round?
SELECT constructor FROM table_2911781_3 WHERE grand_prix = "Belgian grand_prix"
SELECT "constructor" FROM "table_2911781_3" WHERE "Belgian grand_prix" = "grand_prix"
0.083008
CREATE TABLE tip (tip_id NUMBER, business_id VARCHAR2, text TEXT, user_id VARCHAR2, likes NUMBER, year NUMBER, month VARCHAR2) CREATE TABLE category (id NUMBER, business_id VARCHAR2, category_name VARCHAR2) CREATE TABLE neighborhood (id NUMBER, business_id VARCHAR2, neighborhood_name VARCHAR2) CREATE TABLE user (uid NUMBER, user_id VARCHAR2, name VARCHAR2) CREATE TABLE checkin (cid NUMBER, business_id VARCHAR2, count NUMBER, day VARCHAR2) CREATE TABLE business (bid NUMBER, business_id VARCHAR2, name VARCHAR2, full_address VARCHAR2, city VARCHAR2, latitude VARCHAR2, longitude VARCHAR2, review_count NUMBER, is_open NUMBER, rating FLOAT, state VARCHAR2) CREATE TABLE review (rid NUMBER, business_id VARCHAR2, user_id VARCHAR2, rating FLOAT, text TEXT, year NUMBER, month VARCHAR2)
Find all Bars reviewed by Patrick with at least 3 stars
SELECT business.name FROM business, category, review, user WHERE business.rating >= 3 AND category.business_id = business.business_id AND category.category_name = 'Bars' AND review.business_id = business.business_id AND user.name = 'Patrick' AND user.user_id = review.user_id
SELECT "business"."name" FROM "business" JOIN "category" ON "business"."business_id" = "category"."business_id" AND "category"."category_name" = 'Bars' JOIN "review" ON "business"."business_id" = "review"."business_id" JOIN "user" ON "review"."user_id" = "user"."user_id" AND "user"."name" = 'Patrick' WHERE "business"."rating" >= 3
0.324219
CREATE TABLE table_name_87 (game NUMBER, date VARCHAR2)
What average game was played on October 16?
SELECT AVG(game) FROM table_name_87 WHERE date = "october 16"
SELECT AVG("game") FROM "table_name_87" WHERE "date" = "october 16"
0.06543
CREATE TABLE table_203_43 (id NUMBER, "polling firm" CLOB, "month" CLOB, "link" CLOB, "favor" NUMBER, "oppose" NUMBER)
how many months had more than 55 favor votes ?
SELECT COUNT("month") FROM table_203_43 WHERE "favor" > 55
SELECT COUNT("month") FROM "table_203_43" WHERE "favor" > 55
0.058594
CREATE TABLE table_39196 ("Season" FLOAT, "Series" CLOB, "Team" CLOB, "Races" FLOAT, "Wins" FLOAT, "Poles" FLOAT, "Podiums" FLOAT)
What is the largest amount of wins that was before the 2007 season, as well as the Team being silverstone motorsport academy?
SELECT MAX("Wins") FROM table_39196 WHERE "Season" < '2007' AND "Team" = 'silverstone motorsport academy'
SELECT MAX("Wins") FROM "table_39196" WHERE "Season" < '2007' AND "Team" = 'silverstone motorsport academy'
0.104492
CREATE TABLE table_26783 ("Railroad" CLOB, "Game Cost" CLOB, "Real-Life Years of Operation" CLOB, "Real-Life Eventual Outcome" CLOB, "Currently\\u00b9 Part Of..." CLOB)
Name the game cost for merged with new york central to form penn central
SELECT "Game Cost" FROM table_26783 WHERE "Real-Life Eventual Outcome" = 'Merged with New York Central to form Penn Central'
SELECT "Game Cost" FROM "table_26783" WHERE "Real-Life Eventual Outcome" = 'Merged with New York Central to form Penn Central'
0.123047
CREATE TABLE table_75265 ("Nation" CLOB, "Skip" CLOB, "Third" CLOB, "Second" CLOB, "Lead" CLOB)
Which lead has Kirsty Balfour as second?
SELECT "Lead" FROM table_75265 WHERE "Skip" = 'kirsty balfour'
SELECT "Lead" FROM "table_75265" WHERE "Skip" = 'kirsty balfour'
0.0625
CREATE TABLE table_39090 ("Election" FLOAT, "Labour" FLOAT, "Conservative" FLOAT, "Liberal" FLOAT, "Social Democratic Party" FLOAT, "Social and Liberal Democrats/ Liberal Democrats" FLOAT, "Independent" FLOAT, "Green" FLOAT, "Other" CLOB, "Control" CLOB)
Which Social Democratic Party has a Green smaller than 0?
SELECT AVG("Social Democratic Party") FROM table_39090 WHERE "Green" < '0'
SELECT AVG("Social Democratic Party") FROM "table_39090" WHERE "Green" < '0'
0.074219
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER) CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER) CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER) CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2) CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2) CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER) CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
What are all the employee ids and the names of the countries in which they work Visualize by bar chart, I want to order in asc by the X-axis.
SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME ORDER BY COUNTRY_NAME
SELECT "COUNTRY_NAME", SUM("EMPLOYEE_ID") FROM "employees" "T1" JOIN "departments" "T2" ON "T1"."DEPARTMENT_ID" = "T2"."DEPARTMENT_ID" JOIN "locations" "T3" ON "T2"."LOCATION_ID" = "T3"."LOCATION_ID" JOIN "countries" "T4" ON "T3"."COUNTRY_ID" = "T4"."COUNTRY_ID" GROUP BY "COUNTRY_NAME" ORDER BY "COUNTRY_NAME"
0.302734
CREATE TABLE table_name_17 (name VARCHAR2, country VARCHAR2)
What is the name of the player from NGA?
SELECT name FROM table_name_17 WHERE country = "nga"
SELECT "name" FROM "table_name_17" WHERE "country" = "nga"
0.056641
CREATE TABLE Research_Staff (staff_details VARCHAR2)
List the research staff details, and order in ascending order.
SELECT staff_details FROM Research_Staff ORDER BY staff_details
SELECT "staff_details" FROM "Research_Staff" ORDER BY "staff_details"
0.067383
CREATE TABLE table_53539 ("Driver" CLOB, "Constructor" CLOB, "Laps" FLOAT, "Time/retired" CLOB, "Grid" FLOAT)
what is the time/retired when the driver is toulo de graffenried?
SELECT "Time/retired" FROM table_53539 WHERE "Driver" = 'toulo de graffenried'
SELECT "Time/retired" FROM "table_53539" WHERE "Driver" = 'toulo de graffenried'
0.078125
CREATE TABLE table_41875 ("First District" CLOB, "Second District" CLOB, "Third District" CLOB, "Fourth District" CLOB, "Fifth District" CLOB)
Who's the Fourth District with a First District of beverly bodem?
SELECT "Fourth District" FROM table_41875 WHERE "First District" = 'beverly bodem'
SELECT "Fourth District" FROM "table_41875" WHERE "First District" = 'beverly bodem'
0.082031
CREATE TABLE table_name_92 (singapore_cup VARCHAR2, s_league VARCHAR2)
What is the Singapore Cup when the S-League is 5 (14)?
SELECT singapore_cup FROM table_name_92 WHERE s_league = "5 (14)"
SELECT "singapore_cup" FROM "table_name_92" WHERE "5 (14)" = "s_league"
0.069336
CREATE TABLE table_name_92 (team_classification VARCHAR2, stage VARCHAR2)
Name the team classification for stage of 20
SELECT team_classification FROM table_name_92 WHERE stage = "20"
SELECT "team_classification" FROM "table_name_92" WHERE "20" = "stage"
0.068359
CREATE TABLE table_73602 ("Code name" CLOB, "Brand name" CLOB, "Model ( list ) " CLOB, "Frequency" CLOB, "Cores/Threads" CLOB, "Max Memory Speed" CLOB)
What frequency does model L34xx use?
SELECT "Frequency" FROM table_73602 WHERE "Model (list)" = 'L34xx'
SELECT "Frequency" FROM "table_73602" WHERE "Model (list)" = 'L34xx'
0.066406
CREATE TABLE table_name_92 (scoring_average VARCHAR2, year VARCHAR2, wins VARCHAR2)
Tell me the scoring average for year less than 1998 and wins more than 3
SELECT scoring_average FROM table_name_92 WHERE year < 1998 AND wins > 3
SELECT "scoring_average" FROM "table_name_92" WHERE "wins" > 3 AND "year" < 1998
0.078125
CREATE TABLE club (Club_ID NUMBER, name CLOB, Region CLOB, Start_year CLOB) CREATE TABLE competition (Competition_ID NUMBER, Year FLOAT, Competition_type CLOB, Country CLOB) CREATE TABLE club_rank (Rank FLOAT, Club_ID NUMBER, Gold FLOAT, Silver FLOAT, Bronze FLOAT, Total FLOAT) CREATE TABLE competition_result (Competition_ID NUMBER, Club_ID_1 NUMBER, Club_ID_2 NUMBER, Score CLOB) CREATE TABLE player (Player_ID NUMBER, name CLOB, Position CLOB, Club_ID NUMBER, Apps FLOAT, Tries FLOAT, Goals CLOB, Points FLOAT)
List the positions of players whose average number of points scored by that position is larger than 20, give me a bar chart showing the number of different positions, and I want to list by the Y in descending.
SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position) DESC
SELECT "Position", COUNT("Position") FROM "player" GROUP BY "Position" HAVING AVG("Points") >= 20 ORDER BY COUNT("Position") DESC
0.125977
CREATE TABLE table_48305 ("Rank" FLOAT, "Company" CLOB, "Headquarters" CLOB, "Industry" CLOB, "Sales ( billion $ ) " FLOAT, "Profits ( billion $ ) " FLOAT, "Assets ( billion $ ) " FLOAT, "Market Value ( billion $ ) " FLOAT)
What is the average assets in billions of the company Bank of America, which has less than 49.01 billions in sales?
SELECT AVG("Assets (billion $)") FROM table_48305 WHERE "Company" = 'bank of america' AND "Sales (billion $)" < '49.01'
SELECT AVG("Assets (billion $)") FROM "table_48305" WHERE "Company" = 'bank of america' AND "Sales (billion $)" < '49.01'
0.118164
CREATE TABLE table_46250 ("Date" CLOB, "Home team" CLOB, "Score" CLOB, "Away team" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Box Score" CLOB, "Report" CLOB)
Which Date has a Crowd smaller than 4,485?
SELECT "Date" FROM table_46250 WHERE "Crowd" < '4,485'
SELECT "Date" FROM "table_46250" WHERE "Crowd" < '4,485'
0.054688
CREATE TABLE table_32857 ("Sanctioning" CLOB, "Race Name" CLOB, "Circuit" CLOB, "City/Location" CLOB, "Date" CLOB)
What is the date for the race that has a circuit of Milwaukee Mile and the sanctioning of cart?
SELECT "Date" FROM table_32857 WHERE "Circuit" = 'milwaukee mile' AND "Sanctioning" = 'cart'
SELECT "Date" FROM "table_32857" WHERE "Circuit" = 'milwaukee mile' AND "Sanctioning" = 'cart'
0.091797
CREATE TABLE table_11934032_1 (location VARCHAR2, station_number VARCHAR2)
what are all the location where station number is c11
SELECT location FROM table_11934032_1 WHERE station_number = "C11"
SELECT "location" FROM "table_11934032_1" WHERE "C11" = "station_number"
0.070313
CREATE TABLE table_41272 ("Year ( Ceremony ) " CLOB, "Film title used in nomination" CLOB, "Original title" CLOB, "Director" CLOB, "Result" CLOB)
What is Result, when Director is Veljko Bulaji category:articles with hcards, and when Original title is Sarajevski Atentat?
SELECT "Result" FROM table_41272 WHERE "Director" = 'veljko bulajić category:articles with hcards' AND "Original title" = 'sarajevski atentat'
SELECT "Result" FROM "table_41272" WHERE "Director" = 'veljko bulajić category:articles with hcards' AND "Original title" = 'sarajevski atentat'
0.140625
CREATE TABLE table_name_4 (against NUMBER, wins VARCHAR2, byes VARCHAR2)
What is the highest score with 0 wins and more than 2 Byes?
SELECT MAX(against) FROM table_name_4 WHERE wins = 0 AND byes > 2
SELECT MAX("against") FROM "table_name_4" WHERE "byes" > 2 AND "wins" = 0
0.071289
CREATE TABLE table_50944 ("Rider" CLOB, "Manufacturer" CLOB, "Laps" FLOAT, "Time" CLOB, "Grid" FLOAT)
What are the average Laps on Grid 15?
SELECT AVG("Laps") FROM table_50944 WHERE "Grid" = '15'
SELECT AVG("Laps") FROM "table_50944" WHERE "Grid" = '15'
0.055664
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
when was the first time that patient 006-143187 had the urine output on the first intensive care unit visit?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-143187') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'urine' ORDER BY intakeoutput.intakeoutputtime LIMIT 1
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '006-143187' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL AND NOT "patient"."unitdischargetime" IS NULL GROUP BY "patientunitstayid" ORDER BY "patient"."unitadmittime" FETCH FIRST 1 ROWS ONLY) SELECT "intakeoutput"."intakeoutputtime" FROM "intakeoutput" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."celllabel" = 'urine' AND "intakeoutput"."cellpath" LIKE '%output%' AND NOT "_u_1"."" IS NULL ORDER BY "intakeoutput"."intakeoutputtime" FETCH FIRST 1 ROWS ONLY
0.758789
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
provide the number of patients whose admission year is less than 2184 and lab test fluid is joint fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2184" AND lab.fluid = "Joint Fluid"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Joint Fluid" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "2184" > "demographic"."admityear"
0.194336
CREATE TABLE table_name_52 (result VARCHAR2, week VARCHAR2)
What is the result of the game on week 11?
SELECT result FROM table_name_52 WHERE week = 11
SELECT "result" FROM "table_name_52" WHERE "week" = 11
0.052734
CREATE TABLE table_name_80 (assist_pass VARCHAR2, location VARCHAR2)
Which assist/pass is in Ferreiras?
SELECT assist_pass FROM table_name_80 WHERE location = "ferreiras"
SELECT "assist_pass" FROM "table_name_80" WHERE "ferreiras" = "location"
0.070313
CREATE TABLE table_24066938_1 (pop_density_people_km_2 VARCHAR2, member_state VARCHAR2)
How many inhabitants does Sweden have per square kilometer?
SELECT pop_density_people_km_2 FROM table_24066938_1 WHERE member_state = "Sweden"
SELECT "pop_density_people_km_2" FROM "table_24066938_1" WHERE "Sweden" = "member_state"
0.085938
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
what is age and primary disease of subject id 2560?
SELECT demographic.age, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560"
SELECT "demographic"."age", "demographic"."diagnosis" FROM "demographic" WHERE "2560" = "demographic"."subject_id"
0.111328
CREATE TABLE news_report (journalist_ID NUMBER, Event_ID NUMBER, Work_Type CLOB) CREATE TABLE event (Event_ID NUMBER, Date CLOB, Venue CLOB, Name CLOB, Event_Attendance NUMBER) CREATE TABLE journalist (journalist_ID NUMBER, Name CLOB, Nationality CLOB, Age CLOB, Years_working NUMBER)
Show the names of journalists and the number of events they reported. Visualize by bar chart.
SELECT T3.Name, COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name
SELECT "T3"."Name", COUNT(*) FROM "news_report" "T1" JOIN "event" "T2" ON "T1"."Event_ID" = "T2"."Event_ID" JOIN "journalist" "T3" ON "T1"."journalist_ID" = "T3"."journalist_ID" GROUP BY "T3"."Name"
0.193359
CREATE TABLE table_18524_6 (tourism_receipts__2011___us VARCHAR2, tourism_receipts__2003___as__percentage_of_gdp_ VARCHAR2)
Name the total number of tourism receipts 2011 where tourism receipts 2003 13.5
SELECT COUNT(tourism_receipts__2011___us) AS $_per_capita_ FROM table_18524_6 WHERE tourism_receipts__2003___as__percentage_of_gdp_ = "13.5"
SELECT COUNT("tourism_receipts__2011___us") AS "$_per_capita_" FROM "table_18524_6" WHERE "13.5" = "tourism_receipts__2003___as__percentage_of_gdp_"
0.144531
CREATE TABLE table_63120 ("Tournament" CLOB, "Wins" FLOAT, "Top-5" FLOAT, "Events" FLOAT, "Cuts made" FLOAT)
In the Open Championship with more than 3 cuts made, what is the average wins?
SELECT AVG("Wins") FROM table_63120 WHERE "Tournament" = 'the open championship' AND "Cuts made" > '3'
SELECT AVG("Wins") FROM "table_63120" WHERE "Cuts made" > '3' AND "Tournament" = 'the open championship'
0.101563
CREATE TABLE table_32382 ("Stage" CLOB, "Date" CLOB, "Route" CLOB, "Terrain" CLOB, "Length" CLOB, "Winner" CLOB)
Which date has a Terrain of plain stage, and a Stage of 4?
SELECT "Date" FROM table_32382 WHERE "Terrain" = 'plain stage' AND "Stage" = '4'
SELECT "Date" FROM "table_32382" WHERE "Stage" = '4' AND "Terrain" = 'plain stage'
0.080078
CREATE TABLE table_12975 ("Club" CLOB, "Played" CLOB, "Drawn" CLOB, "Lost" CLOB, "Points for" CLOB, "Points against" CLOB, "Tries for" CLOB, "Tries against" CLOB, "Try bonus" CLOB, "Losing bonus" CLOB, "Points" CLOB)
What is Played, when Tries Against is '63'?
SELECT "Played" FROM table_12975 WHERE "Tries against" = '63'
SELECT "Played" FROM "table_12975" WHERE "Tries against" = '63'
0.061523
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
Find out the type of admission and death status of the patient with patient id 18372.
SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "18372"
SELECT "demographic"."admission_type", "demographic"."expire_flag" FROM "demographic" WHERE "18372" = "demographic"."subject_id"
0.125
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
what are the top four most common procedures in patients with age 60 or above since 2105?
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 >= 60) AND STRFTIME('%y', procedures_icd.charttime) >= '2105' 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" >= 60 GROUP BY "hadm_id"), "t1" AS (SELECT "procedures_icd"."icd9_code", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "procedures_icd" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "procedures_icd"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND STRFTIME('%y', "procedures_icd"."charttime") >= '2105' GROUP BY "procedures_icd"."icd9_code"), "_u_1" AS (SELECT "t1"."icd9_code" FROM "t1" "t1" WHERE "t1"."c1" <= 4 GROUP BY "icd9_code") SELECT "d_icd_procedures"."short_title" FROM "d_icd_procedures" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "d_icd_procedures"."icd9_code" WHERE NOT "_u_1"."" IS NULL
0.666016
CREATE TABLE table_49842 ("Res." CLOB, "Record" CLOB, "Opponent" CLOB, "Method" CLOB, "Event" CLOB, "Round" FLOAT)
Who was the opponent in the WMMA 1: McCorkle vs. Heden event that went more than 1 round?
SELECT "Opponent" FROM table_49842 WHERE "Round" > '1' AND "Event" = 'wmma 1: mccorkle vs. heden'
SELECT "Opponent" FROM "table_49842" WHERE "Event" = 'wmma 1: mccorkle vs. heden' AND "Round" > '1'
0.09668
CREATE TABLE table_name_27 (club VARCHAR2, runners_up VARCHAR2)
Which club had 13 runners-up?
SELECT club FROM table_name_27 WHERE runners_up = "13"
SELECT "club" FROM "table_name_27" WHERE "13" = "runners_up"
0.058594
CREATE TABLE table_44570 ("Event" CLOB, "Record" CLOB, "Athlete" CLOB, "Nationality" CLOB, "Date" CLOB, "Meet" CLOB, "Place" CLOB)
What is the Record that has a Nationality of new zealand?
SELECT "Record" FROM table_44570 WHERE "Nationality" = 'new zealand'
SELECT "Record" FROM "table_44570" WHERE "Nationality" = 'new zealand'
0.068359
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
provide the number of patients whose language is russian and diagnosis short title is atrial fibrillation.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.language = "RUSS" AND diagnoses.short_title = "Atrial fibrillation"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Atrial fibrillation" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "RUSS" = "demographic"."language"
0.224609
CREATE TABLE table_12923 ("Tournament" CLOB, "2007" CLOB, "2008" CLOB, "2009" CLOB, "2010" CLOB, "2011" CLOB, "2012" CLOB)
What is the 2009 entry for the row that has a 2007 entry of A and a tournament entry of US Open?
SELECT "2009" FROM table_12923 WHERE "2007" = 'a' AND "Tournament" = 'us open'
SELECT "2009" FROM "table_12923" WHERE "2007" = 'a' AND "Tournament" = 'us open'
0.078125
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
calculate the minimum duration of hospital stay of married patients
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.marital_status = "MARRIED"
SELECT MIN("demographic"."days_stay") FROM "demographic" WHERE "MARRIED" = "demographic"."marital_status"
0.102539
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
count the number of patients whose diagnosis short title is status autm crd dfbrltr and drug route is im.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Status autm crd dfbrltr" AND prescriptions.route = "IM"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Status autm crd dfbrltr" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "prescriptions" ON "IM" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id"
0.297852
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
what is the name of a procedure patient 73713 undergone two times since 5 months ago?
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, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-5 month') GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 = 2)
WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 73713 GROUP BY "hadm_id"), "t1" AS (SELECT "procedures_icd"."icd9_code", COUNT("procedures_icd"."charttime") AS "c1" FROM "procedures_icd" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "procedures_icd"."hadm_id" WHERE DATETIME("procedures_icd"."charttime") >= DATETIME(CURRENT_TIME(), '-5 month') AND NOT "_u_0"."" IS NULL GROUP BY "procedures_icd"."icd9_code"), "_u_1" AS (SELECT "t1"."icd9_code" FROM "t1" "t1" WHERE "t1"."c1" = 2 GROUP BY "icd9_code") SELECT "d_icd_procedures"."short_title" FROM "d_icd_procedures" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "d_icd_procedures"."icd9_code" WHERE NOT "_u_1"."" IS NULL
0.69043
CREATE TABLE table_name_83 (player VARCHAR2, chng VARCHAR2, rating VARCHAR2, prev VARCHAR2)
What player has a rating greater than 2746, with a prev less than 4, and +4 as the chng?
SELECT player FROM table_name_83 WHERE rating > 2746 AND prev < 4 AND chng = "+4"
SELECT "player" FROM "table_name_83" WHERE "+4" = "chng" AND "prev" < 4 AND "rating" > 2746
0.088867
CREATE TABLE table_62598 ("Player" CLOB, "Country" CLOB, "Year ( s ) won" CLOB, "Total" FLOAT, "To par" CLOB, "Finish" CLOB)
What is the Total for Seve Ballesteros?
SELECT SUM("Total") FROM table_62598 WHERE "Player" = 'seve ballesteros'
SELECT SUM("Total") FROM "table_62598" WHERE "Player" = 'seve ballesteros'
0.072266
CREATE TABLE table_1566848_7 (pictorials VARCHAR2, centerfold_model VARCHAR2)
Who were the pictorials when the centerfold model was Ava Fabian?
SELECT pictorials FROM table_1566848_7 WHERE centerfold_model = "Ava Fabian"
SELECT "pictorials" FROM "table_1566848_7" WHERE "Ava Fabian" = "centerfold_model"
0.080078
CREATE TABLE table_44649 ("Round" FLOAT, "Pick" FLOAT, "Overall" FLOAT, "Name" CLOB, "Position" CLOB, "College" CLOB)
what is the highest round when the overall is less than 17?
SELECT MAX("Round") FROM table_44649 WHERE "Overall" < '17'
SELECT MAX("Round") FROM "table_44649" WHERE "Overall" < '17'
0.05957
CREATE TABLE actor (actor_id NUMBER, name CLOB, musical_id NUMBER, character CLOB, duration CLOB, age NUMBER) CREATE TABLE musical (musical_id NUMBER, name CLOB, year NUMBER, award CLOB, category CLOB, nominee CLOB, result CLOB)
How many actors are there?
SELECT COUNT(*) FROM actor
SELECT COUNT(*) FROM "actor"
0.027344
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
what is the monthly minimum value of patient 004-32407's weight on the first hospital encounter?
SELECT MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-32407' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL GROUP BY STRFTIME('%y-%m', patient.unitadmittime)
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '004-32407' AND NOT "patient"."hospitaldischargetime" IS NULL GROUP BY "patienthealthsystemstayid" ORDER BY "patient"."hospitaladmittime" FETCH FIRST 1 ROWS ONLY) SELECT MIN("patient"."admissionweight") FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL AND NOT "patient"."admissionweight" IS NULL GROUP BY STRFTIME('%y-%m', "patient"."unitadmittime")
0.513672
CREATE TABLE table_66696 ("Res." CLOB, "Record" CLOB, "Opponent" CLOB, "Method" CLOB, "Event" CLOB, "Round" FLOAT, "Time" CLOB, "Location" CLOB)
In what round was the loss at ufc 118?
SELECT "Round" FROM table_66696 WHERE "Res." = 'loss' AND "Event" = 'ufc 118'
SELECT "Round" FROM "table_66696" WHERE "Event" = 'ufc 118' AND "Res." = 'loss'
0.077148
CREATE TABLE table_1057262_2 (total NUMBER, crop__kilotonnes_ VARCHAR2)
what's the minimum total with crop (kilotonnes) being s lupin
SELECT MIN(total) FROM table_1057262_2 WHERE crop__kilotonnes_ = "s Lupin"
SELECT MIN("total") FROM "table_1057262_2" WHERE "crop__kilotonnes_" = "s Lupin"
0.078125
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB) CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER) CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER) CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostTypes (Id NUMBER, Name CLOB) CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE VoteTypes (Id NUMBER, Name CLOB) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
Total Number of Answers by User.
WITH UserAnswers AS (SELECT u.Id, u.DisplayName, COUNT(*) AS TotalAnswers FROM Users AS u JOIN Posts AS p ON u.Id = p.OwnerUserId AND p.PostTypeId = 2 GROUP BY u.Id, u.DisplayName) SELECT RANK() OVER (ORDER BY TotalAnswers DESC) AS Rank, DisplayName, TotalAnswers FROM UserAnswers ORDER BY TotalAnswers DESC
WITH "UserAnswers" AS (SELECT MAX(1) AS "_" FROM "Users" "u" JOIN "Posts" "p" ON "p"."OwnerUserId" = "u"."Id" AND "p"."PostTypeId" = 2 GROUP BY "u"."Id", "u"."DisplayName") SELECT RANK() OVER (ORDER BY "TotalAnswers" DESC) AS "Rank", "DisplayName", "TotalAnswers" FROM "UserAnswers" ORDER BY "TotalAnswers" DESC
0.303711
CREATE TABLE table_name_21 (value__ VARCHAR2, team VARCHAR2, revenue__$m_ VARCHAR2, rank VARCHAR2)
Name the total number of value for revenue more than 193 and rank less than 12 for manchester united
SELECT COUNT(value__) AS $m_ FROM table_name_21 WHERE revenue__$m_ > 193 AND rank < 12 AND team = "manchester united"
SELECT COUNT("value__") AS "$m_" FROM "table_name_21" WHERE "manchester united" = "team" AND "rank" < 12 AND "revenue__$m_" > 193
0.125977
CREATE TABLE table_16799784_12 (year_named NUMBER, name VARCHAR2)
What is the highest year named for the name Tie Fluctus?
SELECT MAX(year_named) FROM table_16799784_12 WHERE name = "Tie Fluctus"
SELECT MAX("year_named") FROM "table_16799784_12" WHERE "Tie Fluctus" = "name"
0.076172
CREATE TABLE table_203_168 (id NUMBER, "team name" CLOB, "leagues" CLOB, "base" CLOB, "year started" CLOB, "year ended" CLOB, "notable riders" CLOB)
how many teams started before 1940 ?
SELECT COUNT("team name") FROM table_203_168 WHERE "year started" < 1940
SELECT COUNT("team name") FROM "table_203_168" WHERE "year started" < 1940
0.072266
CREATE TABLE table_74673 ("Institution" CLOB, "Nickname" CLOB, "Location" CLOB, "Founded" FLOAT, "Type" CLOB, "Enrollment" FLOAT)
Which of the private colleges is the oldest, and whose nickname is the Mountaineers?
SELECT MIN("Founded") FROM table_74673 WHERE "Type" = 'private' AND "Nickname" = 'mountaineers'
SELECT MIN("Founded") FROM "table_74673" WHERE "Nickname" = 'mountaineers' AND "Type" = 'private'
0.094727
CREATE TABLE table_name_23 (years VARCHAR2, area VARCHAR2)
What years does the school have that's in Makikihi?
SELECT years FROM table_name_23 WHERE area = "makikihi"
SELECT "years" FROM "table_name_23" WHERE "area" = "makikihi"
0.05957
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2) CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2) CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2) CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2) CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2) CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2) CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER) CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER) CREATE TABLE area (course_id NUMBER, area VARCHAR2) CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER) CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2) CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2) CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2) CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER) CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER) CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER) CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER) CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
For Prof. Waheed Samy 's classes , is there always an exam ?
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AND instructor.name LIKE '%Waheed Samy%'
SELECT COUNT(*) = 0 FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" 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 '%Waheed Samy%' WHERE "course"."has_exams" = 'N'
0.371094
CREATE TABLE basketball_match (Team_ID NUMBER, School_ID NUMBER, Team_Name CLOB, ACC_Regular_Season CLOB, ACC_Percent CLOB, ACC_Home CLOB, ACC_Road CLOB, All_Games CLOB, All_Games_Percent NUMBER, All_Home CLOB, All_Road CLOB, All_Neutral CLOB) CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB)
A bar chart shows the distribution of All_Games and ACC_Percent , rank by the total number in descending.
SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC
SELECT "All_Games", "ACC_Percent" FROM "basketball_match" ORDER BY "ACC_Percent" DESC
0.083008
CREATE TABLE finrev_fed_17 (state_code NUMBER, idcensus NUMBER, school_district CLOB, nces_id CLOB, yr_data NUMBER, t_fed_rev NUMBER, c14 NUMBER, c25 NUMBER) CREATE TABLE ndecoreexcel_math_grade8 (year NUMBER, state CLOB, all_students CLOB, average_scale_score NUMBER) CREATE TABLE finrev_fed_key_17 (state_code NUMBER, state CLOB)
How much funding does Colorado schools receive from Title 1 and the Child Nutrition program respectively?
SELECT SUM(T1.c14), SUM(T1.c25) FROM finrev_fed_17 AS T1 JOIN finrev_fed_key_17 AS T2 ON T1.state_code = T2.state_code WHERE T2.state = "Colorado"
SELECT SUM("T1"."c14"), SUM("T1"."c25") FROM "finrev_fed_17" "T1" JOIN "finrev_fed_key_17" "T2" ON "Colorado" = "T2"."state" AND "T1"."state_code" = "T2"."state_code"
0.162109
CREATE TABLE table_45767 ("Rank" FLOAT, "Name" CLOB, "Country" CLOB, "Wins" FLOAT, "Years" CLOB)
Which Country has Wins larger than 2, and a Rank of 2, and a Name of federico bahamontes?
SELECT "Country" FROM table_45767 WHERE "Wins" > '2' AND "Rank" = '2' AND "Name" = 'federico bahamontes'
SELECT "Country" FROM "table_45767" WHERE "Name" = 'federico bahamontes' AND "Rank" = '2' AND "Wins" > '2'
0.103516
CREATE TABLE table_name_67 (original_channel VARCHAR2, year VARCHAR2, note VARCHAR2)
what is the original channel when the year is before 2006 and the note is supporting?
SELECT original_channel FROM table_name_67 WHERE year < 2006 AND note = "supporting"
SELECT "original_channel" FROM "table_name_67" WHERE "note" = "supporting" AND "year" < 2006
0.089844
CREATE TABLE table_21505 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
Who had the high points on February 6?
SELECT "High points" FROM table_21505 WHERE "Date" = 'February 6'
SELECT "High points" FROM "table_21505" WHERE "Date" = 'February 6'
0.06543
CREATE TABLE table_30710 ("Sl. No" FLOAT, "Category wise" CLOB, "Single lane" FLOAT, "Intermediate lane" FLOAT, "Double lane" FLOAT, "Multi lane" FLOAT, "Total" FLOAT)
What is the highest value for multi lane if category wise is major district roads?
SELECT MAX("Multi lane") FROM table_30710 WHERE "Category wise" = 'Major district roads'
SELECT MAX("Multi lane") FROM "table_30710" WHERE "Category wise" = 'Major district roads'
0.087891
CREATE TABLE table_51984 ("Race Name" CLOB, "Circuit" CLOB, "Date" CLOB, "Winning driver" CLOB, "Constructor" CLOB, "Report" CLOB)
Which Constructor has the Winning Driver, Jim Clark and the Circuit, Syracuse?
SELECT "Constructor" FROM table_51984 WHERE "Winning driver" = 'jim clark' AND "Circuit" = 'syracuse'
SELECT "Constructor" FROM "table_51984" WHERE "Circuit" = 'syracuse' AND "Winning driver" = 'jim clark'
0.100586
CREATE TABLE table_71858 ("Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Loss" CLOB, "Attendance" FLOAT, "Record" CLOB)
Who was the opponent at the game that had a record of 93-54?
SELECT "Opponent" FROM table_71858 WHERE "Record" = '93-54'
SELECT "Opponent" FROM "table_71858" WHERE "Record" = '93-54'
0.05957
CREATE TABLE table_name_96 (division VARCHAR2, regular_season VARCHAR2, playoffs VARCHAR2, league VARCHAR2)
What division did the Nashville Metros play in during the year that they did not qualify for the Playoffs, where in the USL PDL League, and had the Regular Season 7th, Southeast?
SELECT division FROM table_name_96 WHERE playoffs = "did not qualify" AND league = "usl pdl" AND regular_season = "7th, southeast"
SELECT "division" FROM "table_name_96" WHERE "7th, southeast" = "regular_season" AND "did not qualify" = "playoffs" AND "league" = "usl pdl"
0.136719
CREATE TABLE table_48794 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Attendance" CLOB)
How many weeks were there games with 41,384 fans in attendance?
SELECT SUM("Week") FROM table_48794 WHERE "Attendance" = '41,384'
SELECT SUM("Week") FROM "table_48794" WHERE "Attendance" = '41,384'
0.06543
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
what is the name of the drug that was prescribed to patient 009-5001 in the same day, after having been diagnosed with lower gi bleeding this month?
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5001') AND diagnosis.diagnosisname = 'lower gi bleeding' AND DATETIME(diagnosis.diagnosistime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5001') AND DATETIME(medication.drugstarttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.drugstarttime AND DATETIME(t1.diagnosistime, 'start of day') = DATETIME(t2.drugstarttime, 'start of day')
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '009-5001' GROUP BY "patienthealthsystemstayid"), "t2" AS (SELECT "patient"."uniquepid", "medication"."drugname", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" LEFT JOIN "_u_0" "_u_1" ON "_u_1"."" = "patient"."patienthealthsystemstayid" WHERE DATETIME("medication"."drugstarttime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND NOT "_u_1"."" IS NULL) SELECT "t2"."drugname" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" JOIN "t2" "t2" ON "diagnosis"."diagnosistime" < "t2"."drugstarttime" AND "patient"."uniquepid" = "t2"."uniquepid" AND DATETIME("diagnosis"."diagnosistime", 'start of day') = DATETIME("t2"."drugstarttime", 'start of day') WHERE "diagnosis"."diagnosisname" = 'lower gi bleeding' AND DATETIME("diagnosis"."diagnosistime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND NOT "_u_0"."" IS NULL
1.164063
CREATE TABLE candidate (Candidate_ID NUMBER, People_ID NUMBER, Poll_Source CLOB, Date CLOB, Support_rate FLOAT, Consider_rate FLOAT, Oppose_rate FLOAT, Unsure_rate FLOAT) CREATE TABLE people (People_ID NUMBER, Sex CLOB, Name CLOB, Date_of_Birth CLOB, Height FLOAT, Weight FLOAT)
Return a bar chart about the distribution of Sex and the average of Weight , and group by attribute Sex, and I want to display by the y-axis from low to high please.
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight)
SELECT "Sex", AVG("Weight") FROM "people" GROUP BY "Sex" ORDER BY AVG("Weight")
0.077148
CREATE TABLE storm (Storm_ID NUMBER, Name CLOB, Dates_active CLOB, Max_speed NUMBER, Damage_millions_USD FLOAT, Number_Deaths NUMBER) CREATE TABLE affected_region (Region_id NUMBER, Storm_ID NUMBER, Number_city_affected FLOAT) CREATE TABLE region (Region_id NUMBER, Region_code CLOB, Region_name CLOB)
Return a pie chart on how many regions were affected by each storm?
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID
SELECT "Name", COUNT(*) FROM "storm" "T1" JOIN "affected_region" "T2" ON "T1"."Storm_ID" = "T2"."Storm_ID" GROUP BY "T1"."Storm_ID"
0.12793
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
what organism was found during the last stool test of patient 031-3507 since 50 months ago?
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3507')) AND microlab.culturesite = 'stool' AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-50 month') ORDER BY microlab.culturetakentime DESC LIMIT 1
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '031-3507' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT "microlab"."organism" FROM "microlab" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "microlab"."patientunitstayid" WHERE "microlab"."culturesite" = 'stool' AND DATETIME("microlab"."culturetakentime") >= DATETIME(CURRENT_TIME(), '-50 month') AND NOT "_u_1"."" IS NULL ORDER BY "microlab"."culturetakentime" DESC FETCH FIRST 1 ROWS ONLY
0.671875
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2) CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2) CREATE TABLE code_description (code VARCHAR2, description CLOB) CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER) CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER) CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER) CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB) CREATE TABLE month (month_number NUMBER, month_name CLOB) CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2) CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER) CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB) CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER) CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2) CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB) CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB) CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER) CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2) CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2) CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2) CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB) CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER) CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER) CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2) CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2) CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
i would like an early flight from LOS ANGELES to CHARLOTTE monday morning
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, date_day, days, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LOS ANGELES' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND (CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'CHARLOTTE' AND date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_2.airport_code)) AND flight.departure_time BETWEEN 0 AND 1200
SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" CROSS JOIN "airport_service" "AIRPORT_SERVICE_1" CROSS JOIN "city" "CITY_1" JOIN "date_day" ON "date_day"."day_number" = 21 AND "date_day"."month_number" = 2 AND "date_day"."year" = 1991 JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'LOS ANGELES' JOIN "days" ON "date_day"."day_name" = "days"."day_name" JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "days"."days_code" = "flight"."flight_days" AND "flight"."departure_time" <= 1200 AND "flight"."departure_time" >= 0 JOIN "airport_service" "AIRPORT_SERVICE_2" ON "AIRPORT_SERVICE_2"."airport_code" = "flight"."to_airport" JOIN "city" "CITY_2" ON "AIRPORT_SERVICE_2"."city_code" = "CITY_2"."city_code" AND "CITY_2"."city_name" = 'CHARLOTTE'
0.844727
CREATE TABLE table_71198 ("Res." CLOB, "Record" CLOB, "Opponent" CLOB, "Method" CLOB, "Event" CLOB, "Round" FLOAT, "Time" CLOB, "Location" CLOB)
Which opponent has a Time of 1:34?
SELECT "Opponent" FROM table_71198 WHERE "Time" = '1:34'
SELECT "Opponent" FROM "table_71198" WHERE "Time" = '1:34'
0.056641
CREATE TABLE table_name_62 (connection VARCHAR2, web_client_accelerator VARCHAR2)
What is the connection for the proxyconn web accelerator web client accelerator?
SELECT connection FROM table_name_62 WHERE web_client_accelerator = "proxyconn web accelerator"
SELECT "connection" FROM "table_name_62" WHERE "proxyconn web accelerator" = "web_client_accelerator"
0.098633
CREATE TABLE table_42846 ("Year" FLOAT, "Chassis" CLOB, "Engine" CLOB, "Start" FLOAT, "Finish" FLOAT, "Entrant" CLOB)
What chassis has patrick racing as an entrant, with a start greater than 6?
SELECT "Chassis" FROM table_42846 WHERE "Entrant" = 'patrick racing' AND "Start" > '6'
SELECT "Chassis" FROM "table_42846" WHERE "Entrant" = 'patrick racing' AND "Start" > '6'
0.085938
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
find the number of patients with primary disease as s/p fall and their year of death is in or before 2112.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2112.0"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2112.0" >= "demographic"."dod_year" AND "S/P FALL" = "demographic"."diagnosis"
0.150391
CREATE TABLE table_1142 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Record" CLOB, "Game Site" CLOB, "Attendance" FLOAT)
what's the date with attendance being 40657
SELECT "Date" FROM table_1142 WHERE "Attendance" = '40657'
SELECT "Date" FROM "table_1142" WHERE "Attendance" = '40657'
0.058594
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
in this year, how many patients had been diagnosed with dvt - right lower extremity?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'dvt - right lower extremity' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
WITH "_u_0" AS (SELECT "diagnosis"."patientunitstayid" FROM "diagnosis" WHERE "diagnosis"."diagnosisname" = 'dvt - right lower extremity' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY "patientunitstayid") SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL
0.427734
CREATE TABLE table_78266 ("Date" CLOB, "Visitor" CLOB, "Score" CLOB, "Home" CLOB, "Decision" CLOB, "Attendance" FLOAT, "Record" CLOB)
On January 15, what was the most in attendance?
SELECT MAX("Attendance") FROM table_78266 WHERE "Date" = 'january 15'
SELECT MAX("Attendance") FROM "table_78266" WHERE "Date" = 'january 15'
0.069336
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
Show me the number of patients who were diagnosed under diagnoses icd9 code 7742 and have their lab test result as abnormal.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "7742" AND lab.flag = "abnormal"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "7742" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "lab" ON "abnormal" = "lab"."flag" AND "demographic"."hadm_id" = "lab"."hadm_id"
0.25293
CREATE TABLE table_name_57 (high_rebounds VARCHAR2, high_assists VARCHAR2, score VARCHAR2)
Who had the high rebounds when the score was w 105 95 (ot) and Jason Kidd (8) had the high assists?
SELECT high_rebounds FROM table_name_57 WHERE high_assists = "jason kidd (8)" AND score = "w 105–95 (ot)"
SELECT "high_rebounds" FROM "table_name_57" WHERE "high_assists" = "jason kidd (8)" AND "score" = "w 105–95 (ot)"
0.110352
CREATE TABLE table_name_19 (type VARCHAR2, lt_nos VARCHAR2, bldr VARCHAR2, year VARCHAR2)
Bldr of mcw&f, and a Year smaller than 1927, and a LT Nos of 9820-9821 has what type?
SELECT type FROM table_name_19 WHERE bldr = "mcw&f" AND year < 1927 AND lt_nos = "9820-9821"
SELECT "type" FROM "table_name_19" WHERE "9820-9821" = "lt_nos" AND "bldr" = "mcw&f" AND "year" < 1927
0.099609
CREATE TABLE Customers_Cards (card_id NUMBER, customer_id NUMBER, card_type_code VARCHAR2, card_number VARCHAR2, date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR2) CREATE TABLE Accounts (account_id NUMBER, customer_id NUMBER, account_name VARCHAR2, other_account_details VARCHAR2) CREATE TABLE Financial_Transactions (transaction_id NUMBER, previous_transaction_id NUMBER, account_id NUMBER, card_id NUMBER, transaction_type VARCHAR2, transaction_date DATETIME, transaction_amount DOUBLE PRECISION, transaction_comment VARCHAR2, other_transaction_details VARCHAR2) CREATE TABLE Customers (customer_id NUMBER, customer_first_name VARCHAR2, customer_last_name VARCHAR2, customer_address VARCHAR2, customer_phone VARCHAR2, customer_email VARCHAR2, other_customer_details VARCHAR2)
Show the relationship between customer id and card number with a scatter chart.
SELECT customer_id, card_number FROM Customers_Cards
SELECT "customer_id", "card_number" FROM "Customers_Cards"
0.056641
CREATE TABLE Transactions_Lots (transaction_id NUMBER, lot_id NUMBER) CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR2, transaction_type_description VARCHAR2) CREATE TABLE Investors (investor_id NUMBER, Investor_details VARCHAR2) CREATE TABLE Lots (lot_id NUMBER, investor_id NUMBER, lot_details VARCHAR2) CREATE TABLE Purchases (purchase_transaction_id NUMBER, purchase_details VARCHAR2) CREATE TABLE Transactions (transaction_id NUMBER, investor_id NUMBER, transaction_type_code VARCHAR2, date_of_transaction DATETIME, amount_of_transaction NUMBER, share_count VARCHAR2, other_details VARCHAR2) CREATE TABLE Sales (sales_transaction_id NUMBER, sales_details VARCHAR2)
Show the id and details for the investors who have the top 3 number of transactions by a bar chart.
SELECT T1.Investor_details, T1.investor_id FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3
SELECT "T1"."Investor_details", "T1"."investor_id" FROM "Investors" "T1" JOIN "Transactions" "T2" ON "T1"."investor_id" = "T2"."investor_id" ORDER BY COUNT(*) DESC FETCH FIRST 3 ROWS ONLY
0.182617
CREATE TABLE table_66413 ("Year" FLOAT, "Finish position" CLOB, "1st day" CLOB, "2nd day" CLOB, "3rd day" CLOB, "4th Day" CLOB)
What is the finish position in the year prior to 2009?
SELECT "Finish position" FROM table_66413 WHERE "Year" < '2009'
SELECT "Finish position" FROM "table_66413" WHERE "Year" < '2009'
0.063477
CREATE TABLE table_52546 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
What was the lowest attendance at Windy Hill?
SELECT MIN("Crowd") FROM table_52546 WHERE "Venue" = 'windy hill'
SELECT MIN("Crowd") FROM "table_52546" WHERE "Venue" = 'windy hill'
0.06543
CREATE TABLE table_203_535 (id NUMBER, "rank" NUMBER, "nation" CLOB, "gold" NUMBER, "silver" NUMBER, "bronze" NUMBER, "total" NUMBER)
who has had only 7 gold medals ?
SELECT "nation" FROM table_203_535 WHERE "gold" = 7
SELECT "nation" FROM "table_203_535" WHERE "gold" = 7
0.051758
CREATE TABLE table_39043 ("Position" FLOAT, "Team" CLOB, "Played" FLOAT, "Wins" FLOAT, "Draws" FLOAT, "Losses" FLOAT, "Scored" FLOAT, "Conceded" FLOAT, "Points" FLOAT)
What's the lowest Position with a Conceded that's larger than 16, Draws of 3, and Losses that's larger than 3?
SELECT MIN("Position") FROM table_39043 WHERE "Conceded" > '16' AND "Draws" = '3' AND "Losses" > '3'
SELECT MIN("Position") FROM "table_39043" WHERE "Conceded" > '16' AND "Draws" = '3' AND "Losses" > '3'
0.099609