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_28462 ("Modern English day name" CLOB, "Old English day name" CLOB, "English day name meaning" CLOB, "Glossed from Latin day name" CLOB, "Latin day name meaning" CLOB)
| what is the meaning of the latin day name 'dies saturni'? | SELECT "Latin day name meaning" FROM table_28462 WHERE "Glossed from Latin day name" = 'Dies Saturni' | SELECT "Latin day name meaning" FROM "table_28462" WHERE "Glossed from Latin day name" = 'Dies Saturni' | 0.100586 |
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod 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 prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title 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 diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime 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 microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE 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 labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
| how many patients were diagnosed with crnry athrscl natve vssl within the same month since 5 years ago after the diagnosis of rheumatoid arthritis? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'crnry athrscl natve vssl') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t1 JOIN (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'rheumatoid arthritis') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') | WITH "t2" AS (SELECT "admissions"."subject_id", "diagnoses_icd"."charttime" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'rheumatoid arthritis' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" WHERE DATETIME("diagnoses_icd"."charttime") >= DATETIME(CURRENT_TIME(), '-5 year')) SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'crnry athrscl natve vssl' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" JOIN "t2" "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND "diagnoses_icd"."charttime" < "t2"."charttime" AND DATETIME("diagnoses_icd"."charttime", 'start of month') = DATETIME("t2"."charttime", 'start of month') WHERE DATETIME("diagnoses_icd"."charttime") >= DATETIME(CURRENT_TIME(), '-5 year') | 0.973633 |
CREATE TABLE table_name_17 (rally_name VARCHAR2, surface VARCHAR2)
| Which Rally Name has a Surface of asphalt and gravel? | SELECT rally_name FROM table_name_17 WHERE surface = "asphalt and gravel" | SELECT "rally_name" FROM "table_name_17" WHERE "asphalt and gravel" = "surface" | 0.077148 |
CREATE TABLE table_25584 ("Rank" FLOAT, "Metropolitan area" CLOB, "Principal city" CLOB, "10 , 000+ places" FLOAT, "Densest incorporated place" CLOB, "Density" CLOB)
| Name the number of rank for stone park | SELECT COUNT("Rank") FROM table_25584 WHERE "Densest incorporated place" = 'Stone Park' | SELECT COUNT("Rank") FROM "table_25584" WHERE "Densest incorporated place" = 'Stone Park' | 0.086914 |
CREATE TABLE Products (Code NUMBER, Name VARCHAR2, Price NUMBER, Manufacturer NUMBER)
CREATE TABLE Manufacturers (Code NUMBER, Name VARCHAR2, Headquarter VARCHAR2, Founder VARCHAR2, Revenue FLOAT)
| For those records from the products and each product's manufacturer, return a scatter chart about the correlation between code and price , and group by attribute founder. | SELECT T1.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | SELECT "T1"."Code", "T1"."Price" FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "Founder" | 0.131836 |
CREATE TABLE publication (abstract VARCHAR2, cid NUMBER, citation_num NUMBER, jid NUMBER, pid NUMBER, reference_num NUMBER, title VARCHAR2, year NUMBER)
CREATE TABLE domain_keyword (did NUMBER, kid NUMBER)
CREATE TABLE domain_conference (cid NUMBER, did NUMBER)
CREATE TABLE domain (did NUMBER, name VARCHAR2)
CREATE TABLE conference (cid NUMBER, homepage VARCHAR2, name VARCHAR2)
CREATE TABLE journal (homepage VARCHAR2, jid NUMBER, name VARCHAR2)
CREATE TABLE cite (cited NUMBER, citing NUMBER)
CREATE TABLE domain_publication (did NUMBER, pid NUMBER)
CREATE TABLE domain_journal (did NUMBER, jid NUMBER)
CREATE TABLE publication_keyword (kid NUMBER, pid NUMBER)
CREATE TABLE writes (aid NUMBER, pid NUMBER)
CREATE TABLE domain_author (aid NUMBER, did NUMBER)
CREATE TABLE keyword (keyword VARCHAR2, kid NUMBER)
CREATE TABLE organization (continent VARCHAR2, homepage VARCHAR2, name VARCHAR2, oid NUMBER)
CREATE TABLE author (aid NUMBER, homepage VARCHAR2, name VARCHAR2, oid NUMBER)
| return me the keyword, which have been contained by the most number of papers in PVLDB . | SELECT keyword.keyword FROM journal, keyword, publication, publication_keyword WHERE journal.name = 'PVLDB' AND publication_keyword.kid = keyword.kid AND publication.jid = journal.jid AND publication.pid = publication_keyword.pid GROUP BY keyword.keyword ORDER BY COUNT(DISTINCT (publication.title)) DESC LIMIT 1 | SELECT "keyword"."keyword" FROM "journal" JOIN "publication" ON "journal"."jid" = "publication"."jid" JOIN "publication_keyword" ON "publication"."pid" = "publication_keyword"."pid" JOIN "keyword" ON "keyword"."kid" = "publication_keyword"."kid" WHERE "journal"."name" = 'PVLDB' GROUP BY "keyword"."keyword" ORDER BY COUNT(DISTINCT "publication"."title") DESC FETCH FIRST 1 ROWS ONLY | 0.374023 |
CREATE TABLE table_72178 ("District" CLOB, "Vacator" CLOB, "Reason for change" CLOB, "Successor" CLOB, "Date successor seated" CLOB)
| What was the district when the reason for change was died January 1, 1974? | SELECT "District" FROM table_72178 WHERE "Reason for change" = 'Died January 1, 1974' | SELECT "District" FROM "table_72178" WHERE "Reason for change" = 'Died January 1, 1974' | 0.084961 |
CREATE TABLE table_name_5 (opponent VARCHAR2, surface VARCHAR2)
| Who was the Opponent on a Hard (i) Surface? | SELECT opponent FROM table_name_5 WHERE surface = "hard (i)" | SELECT "opponent" FROM "table_name_5" WHERE "hard (i)" = "surface" | 0.064453 |
CREATE TABLE table_36904 ("Name" CLOB, "GP-GS" CLOB, "Gain" FLOAT, "Loss" FLOAT, "Long" FLOAT, "Avg/G" FLOAT)
| What is the sum of Long for derrick locke? | SELECT SUM("Long") FROM table_36904 WHERE "Name" = 'derrick locke' | SELECT SUM("Long") FROM "table_36904" WHERE "Name" = 'derrick locke' | 0.066406 |
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_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE 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 diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
| heart rate for patient 25733 last measured on the current icu visit is greater than the value second to last measured on the current icu visit? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25733) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime DESC LIMIT 1) > (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25733) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') ORDER BY chartevents.charttime DESC LIMIT 1 OFFSET 1) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 25733 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE "icustays"."outtime" IS NULL AND NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'heart rate' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid"), "_u_5" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" "_u_4" ON "_u_4"."" = "icustays"."hadm_id" WHERE "icustays"."outtime" IS NULL AND NOT "_u_4"."" IS NULL GROUP BY "icustay_id") SELECT (SELECT "chartevents"."valuenum" FROM "chartevents" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL ORDER BY "chartevents"."charttime" DESC FETCH FIRST 1 ROWS ONLY) > (SELECT "chartevents"."valuenum" FROM "chartevents" LEFT JOIN "_u_5" "_u_5" ON "_u_5"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" "_u_6" ON "_u_6"."" = "chartevents"."itemid" WHERE NOT "_u_5"."" IS NULL AND NOT "_u_6"."" IS NULL ORDER BY "chartevents"."charttime" DESC OFFSET 1 ROWS FETCH FIRST 1 ROWS ONLY) | 1.270508 |
CREATE TABLE table_50370 ("Start Date/Time" CLOB, "Duration" CLOB, "End Time" CLOB, "Spacecraft" CLOB, "Crew" CLOB)
| What crew's EVA started on 20 February 20:09? | SELECT "Crew" FROM table_50370 WHERE "Start Date/Time" = '20 february 20:09' | SELECT "Crew" FROM "table_50370" WHERE "Start Date/Time" = '20 february 20:09' | 0.076172 |
CREATE TABLE table_15487 ("Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Loss" CLOB, "Record" CLOB)
| Name the loss for june 22 | SELECT "Loss" FROM table_15487 WHERE "Date" = 'june 22' | SELECT "Loss" FROM "table_15487" WHERE "Date" = 'june 22' | 0.055664 |
CREATE TABLE table_60246 ("Season" CLOB, "Premier Division" CLOB, "Division One" CLOB, "Division Two" CLOB, "Division Three" CLOB)
| Which Division Two team were champions as the same time the Premier Division Leominster town team were champs? | SELECT "Division Two" FROM table_60246 WHERE "Premier Division" = 'leominster town' | SELECT "Division Two" FROM "table_60246" WHERE "Premier Division" = 'leominster town' | 0.083008 |
CREATE TABLE table_204_579 (id NUMBER, "code" CLOB, "district" CLOB, "headquarters" CLOB, "population ( as of 2011 ) " NUMBER, "area ( km2 ) " NUMBER, "density ( /km2 ) " NUMBER)
| which code is above cl | SELECT "code" FROM table_204_579 WHERE id = (SELECT id FROM table_204_579 WHERE "code" = 'cl') - 1 | SELECT "code" FROM "table_204_579" WHERE "id" = (SELECT "id" FROM "table_204_579" WHERE "code" = 'cl') - 1 | 0.103516 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
| give me the number of patients whose primary disease is morbid obesity/sda and admission year is less than 2184? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND demographic.admityear < "2184" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2184" > "demographic"."admityear" AND "MORBID OBESITY/SDA" = "demographic"."diagnosis" | 0.158203 |
CREATE TABLE table_name_24 (record VARCHAR2, event VARCHAR2, opponent VARCHAR2)
| what is the record when the event is shido usa mma and the opponent is raphael assun o? | SELECT record FROM table_name_24 WHERE event = "shido usa mma" AND opponent = "raphael assunção" | SELECT "record" FROM "table_name_24" WHERE "event" = "shido usa mma" AND "opponent" = "raphael assunção" | 0.101563 |
CREATE TABLE table_45015 ("Event" CLOB, "Score" FLOAT, "Name" CLOB, "Nation" CLOB, "Games" CLOB, "Date" CLOB)
| For the 27 arrow match event, what's the sum of all scores for that event? | SELECT SUM("Score") FROM table_45015 WHERE "Event" = '27 arrow match' | SELECT SUM("Score") FROM "table_45015" WHERE "Event" = '27 arrow match' | 0.069336 |
CREATE TABLE table_name_61 (scorers VARCHAR2, group_position VARCHAR2, opponents VARCHAR2)
| Who were the 2nd group scorers that were opponents of olympiacos? | SELECT scorers FROM table_name_61 WHERE group_position = "2nd" AND opponents = "olympiacos" | SELECT "scorers" FROM "table_name_61" WHERE "2nd" = "group_position" AND "olympiacos" = "opponents" | 0.09668 |
CREATE TABLE table_203_818 (id NUMBER, "kategori" CLOB, "1995" CLOB, "2004" CLOB, "2005" CLOB, "2006" CLOB, "2007" CLOB)
| how many awards were handed out in 2004 ? | SELECT COUNT("2004") FROM table_203_818 | SELECT COUNT("2004") FROM "table_203_818" | 0.040039 |
CREATE TABLE table_13183076_3 (us_viewers__million_ VARCHAR2, production_code VARCHAR2)
| How many U.S. viewers (million) are there for the episode whose Production code is 3T7051? | SELECT us_viewers__million_ FROM table_13183076_3 WHERE production_code = "3T7051" | SELECT "us_viewers__million_" FROM "table_13183076_3" WHERE "3T7051" = "production_code" | 0.085938 |
CREATE TABLE table_train_221 ("id" NUMBER, "gender" CLOB, "body_mass_index_bmi" FLOAT, "age" FLOAT, "NOUSE" FLOAT)
| male and female subjects 7 _ 14 years of age | SELECT * FROM table_train_221 WHERE (gender = 'male' OR gender = 'female') AND (age >= 7 AND age <= 14) | SELECT * FROM "table_train_221" WHERE "age" <= 14 AND "age" >= 7 AND ("gender" = 'female' OR "gender" = 'male') | 0.108398 |
CREATE TABLE table_name_72 (club_team VARCHAR2, nationality VARCHAR2, overall VARCHAR2)
| Name the club team for overall of 188 for canada | SELECT club_team FROM table_name_72 WHERE nationality = "canada" AND overall = 188 | SELECT "club_team" FROM "table_name_72" WHERE "canada" = "nationality" AND "overall" = 188 | 0.087891 |
CREATE TABLE table_203_778 (id NUMBER, "representative" CLOB, "title" CLOB, "presentation\ of credentials" CLOB, "termination\ of mission" CLOB, "appointed by" CLOB)
| is solon borland a representative ? | SELECT (SELECT COUNT(*) FROM table_203_778 WHERE "representative" = 'solon borland') > 0 | WITH "_u_0" AS (SELECT COUNT(*), 'solon borland' AS "_u_1" FROM "table_203_778" GROUP BY 'solon borland') SELECT COALESCE("_u_0"."", *) > 0 LEFT JOIN "_u_0" "_u_0" ON "_u_0"."_u_1" = "representative" | 0.194336 |
CREATE TABLE table_name_90 (week_2 VARCHAR2, week_4 VARCHAR2)
| When Diane Deluna was the cyber girl in week 4 who was the cyber girl in week 2? | SELECT week_2 FROM table_name_90 WHERE week_4 = "diane deluna" | SELECT "week_2" FROM "table_name_90" WHERE "diane deluna" = "week_4" | 0.066406 |
CREATE TABLE table_name_4 (to_par VARCHAR2, year_s__won VARCHAR2)
| What was the winning to par score of the 1993 PGA Championship? | SELECT to_par FROM table_name_4 WHERE year_s__won = "1993" | SELECT "to_par" FROM "table_name_4" WHERE "1993" = "year_s__won" | 0.0625 |
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| what is the number of patients whose admission year is less than 2120 and lab test name is albumin, urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2120" AND lab.label = "Albumin, Urine" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Albumin, Urine" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "2120" > "demographic"."admityear" | 0.197266 |
CREATE TABLE table_67007 ("Country" CLOB, "Film title used in nomination" CLOB, "Language" CLOB, "Original title" CLOB, "Director" CLOB)
| What director is from Poland? | SELECT "Director" FROM table_67007 WHERE "Country" = 'poland' | SELECT "Director" FROM "table_67007" WHERE "Country" = 'poland' | 0.061523 |
CREATE TABLE accounts (custid NUMBER, name CLOB)
CREATE TABLE checking (custid NUMBER, balance NUMBER)
CREATE TABLE savings (custid NUMBER, balance NUMBER)
| Find the total balance across checking accounts. | SELECT SUM(balance) FROM checking | SELECT SUM("balance") FROM "checking" | 0.036133 |
CREATE TABLE table_204_969 (id NUMBER, "composer" CLOB, "title" CLOB, "genre" CLOB, "date" NUMBER, "notes" CLOB)
| why type of genre was peter maxwell davies ' work that was the same as emil petrovics | SELECT "genre" FROM table_204_969 WHERE "composer" = 'peter maxwell davies' | SELECT "genre" FROM "table_204_969" WHERE "composer" = 'peter maxwell davies' | 0.075195 |
CREATE TABLE table_64188 ("2005/ 06" CLOB, "2006/ 07" CLOB, "2007/ 08" CLOB, "2009/ 10" CLOB, "2010/ 11" CLOB, "2011/ 12" CLOB, "2012/ 13" CLOB)
| Which 2005/ 06 has a 2006/ 07 of ur? | SELECT "2005/ 06" FROM table_64188 WHERE "2006/ 07" = 'ur' | SELECT "2005/ 06" FROM "table_64188" WHERE "2006/ 07" = 'ur' | 0.058594 |
CREATE TABLE table_29717 ("Team" CLOB, "Outgoing manager" CLOB, "Manner of departure" CLOB, "Date of vacancy" CLOB, "Table" CLOB, "Incoming manager" CLOB, "Date of appointment" CLOB)
| What is the outgoing manager when the date of vacancy is 10 october 2010? | SELECT "Outgoing manager" FROM table_29717 WHERE "Date of vacancy" = '10 October 2010' | SELECT "Outgoing manager" FROM "table_29717" WHERE "Date of vacancy" = '10 October 2010' | 0.085938 |
CREATE TABLE event (ID NUMBER, Name CLOB, Stadium_ID NUMBER, Year CLOB)
CREATE TABLE record (ID NUMBER, Result CLOB, Swimmer_ID NUMBER, Event_ID NUMBER)
CREATE TABLE swimmer (ID NUMBER, name CLOB, Nationality CLOB, meter_100 FLOAT, meter_200 CLOB, meter_300 CLOB, meter_400 CLOB, meter_500 CLOB, meter_600 CLOB, meter_700 CLOB, Time CLOB)
CREATE TABLE stadium (ID NUMBER, name CLOB, Capacity NUMBER, City CLOB, Country CLOB, Opening_year NUMBER)
| Show me a scatter plot of id and meter_100 for . | SELECT ID, meter_100 FROM swimmer | SELECT "ID", "meter_100" FROM "swimmer" | 0.038086 |
CREATE TABLE table_77349 ("Name" CLOB, "GP-GS" CLOB, "Effic" FLOAT, "Cmp-Att-Int" CLOB, "Avg/G" FLOAT)
| What is the total avg/g of McCrary, Greg? | SELECT COUNT("Avg/G") FROM table_77349 WHERE "Name" = 'mccrary, greg' | SELECT COUNT("Avg/G") FROM "table_77349" WHERE "Name" = 'mccrary, greg' | 0.069336 |
CREATE TABLE table_name_26 (leading_scorer VARCHAR2, score VARCHAR2)
| Who was the leading scorer of the game that had a score of 107 97? | SELECT leading_scorer FROM table_name_26 WHERE score = "107–97" | SELECT "leading_scorer" FROM "table_name_26" WHERE "107–97" = "score" | 0.067383 |
CREATE TABLE table_31638 ("Aircraft" CLOB, "Origin" CLOB, "Type" CLOB, "Versions" CLOB, "In service" CLOB)
| How many T-260 EU aircrafts are currently in service? | SELECT "In service" FROM table_31638 WHERE "Versions" = 't-260 eu' | SELECT "In service" FROM "table_31638" WHERE "Versions" = 't-260 eu' | 0.066406 |
CREATE TABLE table_name_81 (airport VARCHAR2, icao VARCHAR2)
| Which airport has an ICAO of RCKH? | SELECT airport FROM table_name_81 WHERE icao = "rckh" | SELECT "airport" FROM "table_name_81" WHERE "icao" = "rckh" | 0.057617 |
CREATE TABLE table_4151 ("Episode #" FLOAT, "Series #" FLOAT, "Episode Title" CLOB, "Original air date" CLOB, "Production Code" FLOAT)
| when 68 is the episode number what is the series number? | SELECT "Series #" FROM table_4151 WHERE "Episode #" = '68' | SELECT "Series #" FROM "table_4151" WHERE "Episode #" = '68' | 0.058594 |
CREATE TABLE table_name_13 (country VARCHAR2, score VARCHAR2)
| What is Country, when Score is 71-74-70=215? | SELECT country FROM table_name_13 WHERE score = 71 - 74 - 70 = 215 | SELECT "country" FROM "table_name_13" WHERE "score" = FALSE | 0.057617 |
CREATE TABLE table_name_71 (grid NUMBER, time_retired VARCHAR2, laps VARCHAR2, manufacturer VARCHAR2)
| Which Grid has Laps of 25, and a Manufacturer of honda, and a Time/Retired of +1:47.797? | SELECT MIN(grid) FROM table_name_71 WHERE laps = 25 AND manufacturer = "honda" AND time_retired = "+1:47.797" | SELECT MIN("grid") FROM "table_name_71" WHERE "+1:47.797" = "time_retired" AND "honda" = "manufacturer" AND "laps" = 25 | 0.116211 |
CREATE TABLE table_name_77 (date VARCHAR2, game_site VARCHAR2)
| What date has a Game site of bye? | SELECT date FROM table_name_77 WHERE game_site = "bye" | SELECT "date" FROM "table_name_77" WHERE "bye" = "game_site" | 0.058594 |
CREATE TABLE table_64861 ("Player" CLOB, "Country" CLOB, "Year won" FLOAT, "Total" FLOAT, "To par" FLOAT)
| What is the Year won of Davis Love III with a Total of less than 149? | SELECT COUNT("Year won") FROM table_64861 WHERE "Player" = 'davis love iii' AND "Total" < '149' | SELECT COUNT("Year won") FROM "table_64861" WHERE "Player" = 'davis love iii' AND "Total" < '149' | 0.094727 |
CREATE TABLE table_70784 ("Lithium" CLOB, "Sodium" CLOB, "Potassium" CLOB, "Rubidium" CLOB, "Caesium" CLOB)
| what is the properties of sodium when rubidium is nacl (2.1)? | SELECT "Sodium" FROM table_70784 WHERE "Rubidium" = 'nacl (2.1)' | SELECT "Sodium" FROM "table_70784" WHERE "Rubidium" = 'nacl (2.1)' | 0.064453 |
CREATE TABLE table_name_6 (winner VARCHAR2, date VARCHAR2)
| Who was the winner on 15 December 1957? | SELECT winner FROM table_name_6 WHERE date = "15 december 1957" | SELECT "winner" FROM "table_name_6" WHERE "15 december 1957" = "date" | 0.067383 |
CREATE TABLE table_65139 ("Title" CLOB, "Series" CLOB, "Director" CLOB, "Production Number" FLOAT, "Release date" CLOB)
| What is the production number directed by Robert McKimson in series mm titled People Are Bunny? | SELECT SUM("Production Number") FROM table_65139 WHERE "Director" = 'robert mckimson' AND "Series" = 'mm' AND "Title" = 'people are bunny' | SELECT SUM("Production Number") FROM "table_65139" WHERE "Director" = 'robert mckimson' AND "Series" = 'mm' AND "Title" = 'people are bunny' | 0.136719 |
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| what is date of birth and lab test fluid of subject name jerry deberry? | SELECT demographic.dob, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry" | SELECT "demographic"."dob", "lab"."fluid" FROM "demographic" JOIN "lab" ON "demographic"."hadm_id" = "lab"."hadm_id" WHERE "Jerry Deberry" = "demographic"."name" | 0.157227 |
CREATE TABLE table_60080 ("Place" CLOB, "Player" CLOB, "Country" CLOB, "Score" CLOB, "To par" CLOB)
| What is Country, when Score is '69-69=138', and when Player is 'Ian Poulter'? | SELECT "Country" FROM table_60080 WHERE "Score" = '69-69=138' AND "Player" = 'ian poulter' | SELECT "Country" FROM "table_60080" WHERE "Player" = 'ian poulter' AND "Score" = '69-69=138' | 0.089844 |
CREATE TABLE Appointment (AppointmentID NUMBER, Patient NUMBER, PrepNurse NUMBER, Physician NUMBER, Start DATETIME, End DATETIME, ExaminationRoom CLOB)
CREATE TABLE Prescribes (Physician NUMBER, Patient NUMBER, Medication NUMBER, Date DATETIME, Appointment NUMBER, Dose VARCHAR2)
CREATE TABLE Patient (SSN NUMBER, Name VARCHAR2, Address VARCHAR2, Phone VARCHAR2, InsuranceID NUMBER, PCP NUMBER)
CREATE TABLE On_Call (Nurse NUMBER, BlockFloor NUMBER, BlockCode NUMBER, OnCallStart DATETIME, OnCallEnd DATETIME)
CREATE TABLE Department (DepartmentID NUMBER, Name VARCHAR2, Head NUMBER)
CREATE TABLE Procedures (Code NUMBER, Name VARCHAR2, Cost FLOAT)
CREATE TABLE Medication (Code NUMBER, Name VARCHAR2, Brand VARCHAR2, Description VARCHAR2)
CREATE TABLE Physician (EmployeeID NUMBER, Name VARCHAR2, Position VARCHAR2, SSN NUMBER)
CREATE TABLE Stay (StayID NUMBER, Patient NUMBER, Room NUMBER, StayStart DATETIME, StayEnd DATETIME)
CREATE TABLE Undergoes (Patient NUMBER, Procedures NUMBER, Stay NUMBER, DateUndergoes DATETIME, Physician NUMBER, AssistingNurse NUMBER)
CREATE TABLE Room (RoomNumber NUMBER, RoomType VARCHAR2, BlockFloor NUMBER, BlockCode NUMBER, Unavailable BOOLEAN)
CREATE TABLE Affiliated_With (Physician NUMBER, Department NUMBER, PrimaryAffiliation BOOLEAN)
CREATE TABLE Trained_In (Physician NUMBER, Treatment NUMBER, CertificationDate DATETIME, CertificationExpires DATETIME)
CREATE TABLE Nurse (EmployeeID NUMBER, Name VARCHAR2, Position VARCHAR2, Registered BOOLEAN, SSN NUMBER)
CREATE TABLE Block (BlockFloor NUMBER, BlockCode NUMBER)
| List the name and cost of all procedures sorted by the cost from the highest to the lowest by a bar chart. | SELECT Name, Cost FROM Procedures ORDER BY Cost DESC | SELECT "Name", "Cost" FROM "Procedures" ORDER BY "Cost" DESC | 0.058594 |
CREATE TABLE table_64822 ("Name ( pinyin ) " CLOB, "Name ( Wade Giles ) " CLOB, "Characters" CLOB, "Type" CLOB, "Construction" CLOB)
| Who has a Construction of 1873, foochow navy yard? | SELECT "Characters" FROM table_64822 WHERE "Construction" = '1873, foochow navy yard' | SELECT "Characters" FROM "table_64822" WHERE "Construction" = '1873, foochow navy yard' | 0.084961 |
CREATE TABLE table_35966 ("Song title" CLOB, "Artist" CLOB, "Decade" CLOB, "Genre" CLOB, "Family Friendly" CLOB)
| What is the family friendly status of the punk genre song from the 1970s? | SELECT "Family Friendly" FROM table_35966 WHERE "Decade" = '1970s' AND "Genre" = 'punk' | SELECT "Family Friendly" FROM "table_35966" WHERE "Decade" = '1970s' AND "Genre" = 'punk' | 0.086914 |
CREATE TABLE table_204_974 (id NUMBER, "season" NUMBER, "level" CLOB, "division" CLOB, "section" CLOB, "administration" CLOB, "position" CLOB, "movements" CLOB)
| what position did this team get after getting 9th place in 1999 ? | SELECT "position" FROM table_204_974 WHERE "season" > 1999 ORDER BY "season" LIMIT 1 | SELECT "position" FROM "table_204_974" WHERE "season" > 1999 ORDER BY "season" FETCH FIRST 1 ROWS ONLY | 0.099609 |
CREATE TABLE table_608 ("Word number" CLOB, "The Basque of the glossary" CLOB, "Modern Basque" CLOB, "The Icelandic of the glossary" CLOB, "English translation" CLOB)
| Name the incelandic of the glossary for 218 | SELECT "The Icelandic of the glossary" FROM table_608 WHERE "Word number" = '218' | SELECT "The Icelandic of the glossary" FROM "table_608" WHERE "Word number" = '218' | 0.081055 |
CREATE TABLE table_27937 ("meas. num." FLOAT, "passed" CLOB, "YES votes" FLOAT, "NO votes" FLOAT, "% YES" CLOB, "Const. Amd.?" CLOB, "type" CLOB, "description" CLOB)
| What vote passed for the measure with the description, authorizing state acceptance of certain gifts? | SELECT "passed" FROM table_27937 WHERE "description" = 'Authorizing State Acceptance of Certain Gifts' | SELECT "passed" FROM "table_27937" WHERE "description" = 'Authorizing State Acceptance of Certain Gifts' | 0.101563 |
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 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)
| get me the number of emergency hospital admission patients who have lab test item id 50801. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.itemid = "50801" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "50801" = "lab"."itemid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "EMERGENCY" = "demographic"."admission_type" | 0.199219 |
CREATE TABLE table_name_78 (award VARCHAR2, year VARCHAR2, representative_work VARCHAR2)
| What is the award for 1998 with Representative Work of city beat? | SELECT award FROM table_name_78 WHERE year = 1998 AND representative_work = "city beat" | SELECT "award" FROM "table_name_78" WHERE "city beat" = "representative_work" AND "year" = 1998 | 0.092773 |
CREATE TABLE table_24535095_2 (_number NUMBER, listed_owner_s_ VARCHAR2)
| Name the least listed owner for pete raymer | SELECT MIN(_number) FROM table_24535095_2 WHERE listed_owner_s_ = "Pete Raymer" | SELECT MIN("_number") FROM "table_24535095_2" WHERE "Pete Raymer" = "listed_owner_s_" | 0.083008 |
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE 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 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 diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
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)
| retrieve the patient identifications who have been diagnosed with pituitary cushing syndrome until 1 year ago. | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'pituitary cushing syndrome' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')) | WITH "_u_0" AS (SELECT "diagnosis"."patientunitstayid" FROM "diagnosis" WHERE "diagnosis"."diagnosisname" = 'pituitary cushing syndrome' AND DATETIME("diagnosis"."diagnosistime") <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY "patientunitstayid") SELECT "patient"."uniquepid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL | 0.378906 |
CREATE TABLE table_32030 ("Rank" FLOAT, "Heat & Lane" CLOB, "Name" CLOB, "Nationality" CLOB, "Time" CLOB)
| What Heat & Lane is the person who has a time of 1:01.12? | SELECT "Heat & Lane" FROM table_32030 WHERE "Time" = '1:01.12' | SELECT "Heat & Lane" FROM "table_32030" WHERE "Time" = '1:01.12' | 0.0625 |
CREATE TABLE table_2479 ("Period" CLOB, "Civilians" FLOAT, "Security forces" FLOAT, "Insurgents" FLOAT, "Total per period" FLOAT)
| How many insurgents have 2003 as a period? | SELECT COUNT("Insurgents") FROM table_2479 WHERE "Period" = '2003' | SELECT COUNT("Insurgents") FROM "table_2479" WHERE "Period" = '2003' | 0.066406 |
CREATE TABLE table_15898 ("Name" CLOB, "Canton" CLOB, "Height ( meters ) " FLOAT, "Crest length ( meters ) " FLOAT, "Type" CLOB, "Year of construction" FLOAT, "Name of the Lake" CLOB)
| What is the name where lago di luzzone is? | SELECT "Name" FROM table_15898 WHERE "Name of the Lake" = 'Lago di Luzzone' | SELECT "Name" FROM "table_15898" WHERE "Name of the Lake" = 'Lago di Luzzone' | 0.075195 |
CREATE TABLE table_name_23 (money___ NUMBER, country VARCHAR2, place VARCHAR2)
| Which money has a Country of united states, and a Place of t6? | SELECT AVG(money___) AS $__ FROM table_name_23 WHERE country = "united states" AND place = "t6" | SELECT AVG("money___") AS "$__" FROM "table_name_23" WHERE "country" = "united states" AND "place" = "t6" | 0.102539 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE 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 days of hospital stay is greater than 1 and procedure long title is closed [endoscopic] biopsy of bronchus? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "1" AND procedures.long_title = "Closed [endoscopic] biopsy of bronchus" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Closed [endoscopic] biopsy of bronchus" = "procedures"."long_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "1" < "demographic"."days_stay" | 0.243164 |
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
CREATE TABLE 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 days (days_code VARCHAR2, 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 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 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 flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
| what are the fares for flights between ATLANTA and DFW | SELECT DISTINCT fare.fare_id FROM airport, airport_service, city, fare, flight, flight_fare WHERE airport.airport_code = 'DFW' AND city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code | SELECT DISTINCT "fare"."fare_id" FROM "airport" JOIN "flight" ON "airport"."airport_code" = "flight"."to_airport" JOIN "airport_service" ON "airport_service"."airport_code" = "flight"."from_airport" JOIN "flight_fare" ON "flight"."flight_id" = "flight_fare"."flight_id" JOIN "city" ON "airport_service"."city_code" = "city"."city_code" AND "city"."city_name" = 'ATLANTA' JOIN "fare" ON "fare"."fare_id" = "flight_fare"."fare_id" WHERE "airport"."airport_code" = 'DFW' | 0.456055 |
CREATE TABLE table_203_281 (id NUMBER, "season" NUMBER, "pitcher" CLOB, "decision" CLOB, "final\ score" CLOB, "opponent" CLOB, "location" CLOB)
| which game had the greatest score difference ? | SELECT "season" FROM table_203_281 ORDER BY ABS("final\nscore" - "final\nscore") DESC LIMIT 1 | SELECT "season" FROM "table_203_281" ORDER BY ABS("final\nscore" - "final\nscore") DESC FETCH FIRST 1 ROWS ONLY | 0.108398 |
CREATE TABLE table_49521 ("Date" CLOB, "Visitor" CLOB, "Score" CLOB, "Home" CLOB, "Record" CLOB)
| What is the Visitor on March 31? | SELECT "Visitor" FROM table_49521 WHERE "Date" = 'march 31' | SELECT "Visitor" FROM "table_49521" WHERE "Date" = 'march 31' | 0.05957 |
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 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 allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
| during their current hospital visit how many days has gone since patient 030-42006 was last diagnosed with seizures - generalized tonic -clonic? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006' AND patient.hospitaldischargetime IS NULL)) AND diagnosis.diagnosisname = 'seizures - generalized tonic -clonic' ORDER BY diagnosis.diagnosistime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."hospitaldischargetime" IS NULL AND "patient"."uniquepid" = '030-42006' 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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "diagnosis"."diagnosistime")) FROM "diagnosis" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "diagnosis"."patientunitstayid" WHERE "diagnosis"."diagnosisname" = 'seizures - generalized tonic -clonic' AND NOT "_u_1"."" IS NULL ORDER BY "diagnosis"."diagnosistime" DESC FETCH FIRST 1 ROWS ONLY | 0.727539 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
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)
| count the number of patients whose marital status is married and diagnoses icd9 code is v3000? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.icd9_code = "V3000" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "V3000" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "MARRIED" = "demographic"."marital_status" | 0.217773 |
CREATE TABLE table_16508 ("Hand" CLOB, "1 credit" FLOAT, "2 credits" FLOAT, "3 credits" FLOAT, "4 credits" FLOAT, "5 credits" CLOB)
| What is the hand for 4 credits is 1600? | SELECT "Hand" FROM table_16508 WHERE "4 credits" = '1600' | SELECT "Hand" FROM "table_16508" WHERE "4 credits" = '1600' | 0.057617 |
CREATE TABLE track (trackid NUMBER, name CLOB, albumid NUMBER, mediatypeid NUMBER, genreid NUMBER, composer CLOB, milliseconds NUMBER, bytes NUMBER, unitprice NUMBER)
CREATE TABLE invoice (invoiceid NUMBER, customerid NUMBER, invoicedate TIME, billingaddress CLOB, billingcity CLOB, billingstate CLOB, billingcountry CLOB, billingpostalcode CLOB, total NUMBER)
CREATE TABLE playlisttrack (playlistid NUMBER, trackid NUMBER)
CREATE TABLE employee (employeeid NUMBER, lastname CLOB, firstname CLOB, title CLOB, reportsto NUMBER, birthdate TIME, hiredate TIME, address CLOB, city CLOB, state CLOB, country CLOB, postalcode CLOB, phone CLOB, fax CLOB, email CLOB)
CREATE TABLE mediatype (mediatypeid NUMBER, name CLOB)
CREATE TABLE customer (customerid NUMBER, firstname CLOB, lastname CLOB, company CLOB, address CLOB, city CLOB, state CLOB, country CLOB, postalcode CLOB, phone CLOB, fax CLOB, email CLOB, supportrepid NUMBER)
CREATE TABLE artist (artistid NUMBER, name CLOB)
CREATE TABLE invoiceline (invoicelineid NUMBER, invoiceid NUMBER, trackid NUMBER, unitprice NUMBER, quantity NUMBER)
CREATE TABLE album (albumid NUMBER, title CLOB, artistid NUMBER)
CREATE TABLE genre (genreid NUMBER, name CLOB)
CREATE TABLE playlist (playlistid NUMBER, name CLOB)
| Find the distinct unit prices for tracks. | SELECT DISTINCT (unitprice) FROM track | SELECT DISTINCT "unitprice" FROM "track" | 0.039063 |
CREATE TABLE table_24486462_1 (disposable_usd_growth VARCHAR2, rank VARCHAR2)
| If the rank is 26, what is the disposable USD growth? | SELECT disposable_usd_growth FROM table_24486462_1 WHERE rank = 26 | SELECT "disposable_usd_growth" FROM "table_24486462_1" WHERE "rank" = 26 | 0.070313 |
CREATE TABLE table_650 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "U.S. viewers ( millions ) " CLOB)
| How many of the episodes were titled 'Guerillas in the Mist'? | SELECT COUNT("No. in series") FROM table_650 WHERE "Title" = 'Guerillas in the Mist' | SELECT COUNT("No. in series") FROM "table_650" WHERE "Title" = 'Guerillas in the Mist' | 0.083984 |
CREATE TABLE table_name_1 (dutch VARCHAR2, greek VARCHAR2)
| What Dutch word has the same meaning as the Greek word (pl )? | SELECT dutch FROM table_name_1 WHERE greek = "πλέω (pléō)" | SELECT "dutch" FROM "table_name_1" WHERE "greek" = "πλέω (pléō)" | 0.0625 |
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_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 outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE procedures_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 labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE 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 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)
| how much is the minimum total hospital cost that includes prsnl hst oth nfct parst since 2105? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'prsnl hst oth nfct parst')) AND STRFTIME('%y', cost.chargetime) >= '2105' GROUP BY cost.hadm_id) AS t1 | WITH "_u_1" AS (SELECT "diagnoses_icd"."hadm_id" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'prsnl hst oth nfct parst' GROUP BY "hadm_id"), "t1" AS (SELECT SUM("cost"."cost") AS "c1" FROM "cost" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "cost"."hadm_id" WHERE NOT "_u_1"."" IS NULL AND STRFTIME('%y', "cost"."chargetime") >= '2105' GROUP BY "cost"."hadm_id") SELECT MIN("t1"."c1") FROM "t1" "t1" | 0.482422 |
CREATE TABLE endowment (school_name VARCHAR2, school_id VARCHAR2)
CREATE TABLE school (school_name VARCHAR2, school_id VARCHAR2)
| List the names of the schools without any endowment. | SELECT school_name FROM school WHERE NOT school_id IN (SELECT school_id FROM endowment) | SELECT "school_name" FROM "school" WHERE NOT "school_id" IN (SELECT "school_id" FROM "endowment") | 0.094727 |
CREATE TABLE head (head_ID NUMBER, name CLOB, born_state CLOB, age FLOAT)
CREATE TABLE management (department_ID NUMBER, head_ID NUMBER, temporary_acting CLOB)
CREATE TABLE department (Department_ID NUMBER, Name CLOB, Creation CLOB, Ranking NUMBER, Budget_in_Billions FLOAT, Num_Employees FLOAT)
| Show the average age of heads of departments born in each state with a bar chart, and could you display y-axis in descending order? | SELECT born_state, AVG(age) FROM head GROUP BY born_state ORDER BY AVG(age) DESC | SELECT "born_state", AVG("age") FROM "head" GROUP BY "born_state" ORDER BY AVG("age") DESC | 0.087891 |
CREATE TABLE table_73417 ("Season no." FLOAT, "Series no." FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "Production code" FLOAT, "U.S. Viewers ( millions ) " CLOB)
| what is the name of the episode whose writer is Timothy J. Lea and the director is Norberto Barba? | SELECT "Title" FROM table_73417 WHERE "Written by" = 'Timothy J. Lea' AND "Directed by" = 'Norberto Barba' | SELECT "Title" FROM "table_73417" WHERE "Directed by" = 'Norberto Barba' AND "Written by" = 'Timothy J. Lea' | 0.105469 |
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
| what is the days of hospital stay and admission time of subject id 14755? | SELECT demographic.days_stay, demographic.admittime FROM demographic WHERE demographic.subject_id = "14755" | SELECT "demographic"."days_stay", "demographic"."admittime" FROM "demographic" WHERE "14755" = "demographic"."subject_id" | 0.118164 |
CREATE TABLE table_28321 ("Season" FLOAT, "Player" CLOB, "Position" CLOB, "Nationality" CLOB, "Team" CLOB, "Previous college/Team" CLOB)
| Which player for Project-40 in his college team? | SELECT "Player" FROM table_28321 WHERE "Previous college/Team" = 'Project-40' | SELECT "Player" FROM "table_28321" WHERE "Previous college/Team" = 'Project-40' | 0.077148 |
CREATE TABLE review (rid NUMBER, business_id VARCHAR2, user_id VARCHAR2, rating FLOAT, text TEXT, year NUMBER, month 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 user (uid NUMBER, user_id VARCHAR2, name VARCHAR2)
CREATE TABLE category (id NUMBER, business_id VARCHAR2, category_name VARCHAR2)
CREATE TABLE checkin (cid NUMBER, business_id VARCHAR2, count NUMBER, day VARCHAR2)
CREATE TABLE neighborhood (id NUMBER, business_id VARCHAR2, neighborhood_name VARCHAR2)
CREATE TABLE tip (tip_id NUMBER, business_id VARCHAR2, text TEXT, user_id VARCHAR2, likes NUMBER, year NUMBER, month VARCHAR2)
| How many people reviewed restaurant ' Vintner Grill ' in 2010 ? | SELECT COUNT(DISTINCT (user.name)) FROM business, review, user WHERE business.name = 'Vintner Grill' AND review.business_id = business.business_id AND review.year = 2010 AND user.user_id = review.user_id | SELECT COUNT(DISTINCT "user"."name") FROM "business" JOIN "review" ON "business"."business_id" = "review"."business_id" AND "review"."year" = 2010 JOIN "user" ON "review"."user_id" = "user"."user_id" WHERE "business"."name" = 'Vintner Grill' | 0.235352 |
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
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 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 compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id 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 class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code 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 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)
| i'm in MIAMI and i'd like to travel to LAS VEGAS on sunday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MIAMI' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "date_day" ON "date_day"."day_number" = 27 AND "date_day"."month_number" = 8 AND "date_day"."year" = 1991 JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'MIAMI' JOIN "days" ON "date_day"."day_name" = "days"."day_name" JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "days"."days_code" = "flight"."flight_days" JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'LAS VEGAS' | 0.693359 |
CREATE TABLE table_24491017_1 (team VARCHAR2, position VARCHAR2)
| What team was he on when he finished in 11th position? | SELECT team FROM table_24491017_1 WHERE position = "11th" | SELECT "team" FROM "table_24491017_1" WHERE "11th" = "position" | 0.061523 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
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)
| provide the number of patients whose death status is 0 and procedure icd9 code is 3897? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3897" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "3897" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "0" = "demographic"."expire_flag" | 0.210938 |
CREATE TABLE table_train_171 ("id" NUMBER, "systolic_blood_pressure_sbp" NUMBER, "hiv_infection" BOOLEAN, "hemoglobin_a1c_hba1c" FLOAT, "hepatitis_c" BOOLEAN, "diastolic_blood_pressure_dbp" NUMBER, "body_mass_index_bmi" FLOAT, "triglyceride_tg" FLOAT, "NOUSE" FLOAT)
| hiv or hepatitis c positive status; | SELECT * FROM table_train_171 WHERE hiv_infection = 1 OR hepatitis_c = 1 | SELECT * FROM "table_train_171" WHERE "hepatitis_c" = 1 OR "hiv_infection" = 1 | 0.076172 |
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)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| give the number of patients whose death status is 0 and diagnosis short title is ac diastolic heart failure. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.short_title = "Ac diastolic hrt failure" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Ac diastolic hrt failure" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "0" = "demographic"."expire_flag" | 0.229492 |
CREATE TABLE Products (Code NUMBER, Name VARCHAR2, Price NUMBER, Manufacturer NUMBER)
CREATE TABLE Manufacturers (Code NUMBER, Name VARCHAR2, Headquarter VARCHAR2, Founder VARCHAR2, Revenue FLOAT)
| For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, could you order by the X-axis in ascending please? | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name | SELECT "T1"."Name", "T1"."Manufacturer" FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "T1"."Name" ORDER BY "T1"."Name" | 0.161133 |
CREATE TABLE table_name_71 (week NUMBER, date VARCHAR2)
| Which week was the 1995-10-01 game on? | SELECT MAX(week) FROM table_name_71 WHERE date = "1995-10-01" | SELECT MAX("week") FROM "table_name_71" WHERE "1995-10-01" = "date" | 0.06543 |
CREATE TABLE table_24850630_4 (weight VARCHAR2, venue VARCHAR2)
| What was the weight of the jockey at Sandown Park? | SELECT weight FROM table_24850630_4 WHERE venue = "Sandown Park" | SELECT "weight" FROM "table_24850630_4" WHERE "Sandown Park" = "venue" | 0.068359 |
CREATE TABLE table_204_354 (id NUMBER, "opus" CLOB, "title" CLOB, "genre" CLOB, "sub\\u00addivisions" CLOB, "libretto" CLOB, "composition" CLOB, "premiere date" CLOB, "place , theatre" CLOB)
| how many total operas were performed at the dresden ? | SELECT COUNT("title") FROM table_204_354 WHERE "place, theatre" = 'dresden' | SELECT COUNT("title") FROM "table_204_354" WHERE "place, theatre" = 'dresden' | 0.075195 |
CREATE TABLE table_24231638_3 (manner_of_departure VARCHAR2, team VARCHAR2)
| What is the manner of departure for the team racing santander? | SELECT manner_of_departure FROM table_24231638_3 WHERE team = "Racing Santander" | SELECT "manner_of_departure" FROM "table_24231638_3" WHERE "Racing Santander" = "team" | 0.083984 |
CREATE TABLE table_68350 ("Name" CLOB, "Park" CLOB, "Country" CLOB, "Inversions" FLOAT, "Opened" CLOB, "Status" CLOB)
| Name the sum of inversions for opened of april 20, 2002 | SELECT SUM("Inversions") FROM table_68350 WHERE "Opened" = 'april 20, 2002' | SELECT SUM("Inversions") FROM "table_68350" WHERE "Opened" = 'april 20, 2002' | 0.075195 |
CREATE TABLE Player (pID NUMBER, pName VARCHAR2, yCard VARCHAR2, HS NUMBER)
CREATE TABLE College (cName VARCHAR2, state VARCHAR2, enr NUMBER)
CREATE TABLE Tryout (pID NUMBER, cName VARCHAR2, pPos VARCHAR2, decision VARCHAR2)
| Display a bar chart for how many students participated in tryouts for each college by descennding count? | SELECT cName, COUNT(*) FROM Tryout GROUP BY cName ORDER BY COUNT(*) DESC | SELECT "cName", COUNT(*) FROM "Tryout" GROUP BY "cName" ORDER BY COUNT(*) DESC | 0.076172 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
| what is the number of patients whose primary disease is squamous cell carcinoma oral tongue/sda and admission year is less than 2173? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" AND demographic.admityear < "2173" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2173" > "demographic"."admityear" AND "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" = "demographic"."diagnosis" | 0.178711 |
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)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| count the number of patients whose religion is episcopalian and diagnoses long title is personal history of malignant neoplasm of large intestine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.religion = "EPISCOPALIAN" AND diagnoses.long_title = "Personal history of malignant neoplasm of large intestine" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Personal history of malignant neoplasm of large intestine" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "EPISCOPALIAN" = "demographic"."religion" | 0.268555 |
CREATE TABLE table_name_92 (venue VARCHAR2, away_team VARCHAR2)
| At what venue did the Essendon team play as an away team? | SELECT venue FROM table_name_92 WHERE away_team = "essendon" | SELECT "venue" FROM "table_name_92" WHERE "away_team" = "essendon" | 0.064453 |
CREATE TABLE club (Club_ID NUMBER, name CLOB, Region CLOB, Start_year CLOB)
CREATE TABLE player (Player_ID NUMBER, name CLOB, Position CLOB, Club_ID NUMBER, Apps FLOAT, Tries FLOAT, Goals CLOB, Points FLOAT)
CREATE TABLE competition (Competition_ID NUMBER, Year FLOAT, Competition_type CLOB, Country CLOB)
CREATE TABLE competition_result (Competition_ID NUMBER, Club_ID_1 NUMBER, Club_ID_2 NUMBER, Score CLOB)
CREATE TABLE club_rank (Rank FLOAT, Club_ID NUMBER, Gold FLOAT, Silver FLOAT, Bronze FLOAT, Total FLOAT)
| A stacked bar chart about the total number in each competition type, and then split by country. | SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country | SELECT "Country", COUNT("Country") FROM "competition" GROUP BY "Competition_type", "Country" | 0.089844 |
CREATE TABLE table_61325 ("Episode" CLOB, "18-49" CLOB, "Viewers ( m ) " FLOAT, "Rating" CLOB, "Share" CLOB)
| What Rating has Viewers (m) of 2.73? | SELECT "Rating" FROM table_61325 WHERE "Viewers (m)" = '2.73' | SELECT "Rating" FROM "table_61325" WHERE "Viewers (m)" = '2.73' | 0.061523 |
CREATE TABLE table_18910 ("Cost" CLOB, "2400 kWh/kWp\\u2022y" CLOB, "2200 kWh/kWp\\u2022y" CLOB, "2000 kWh/kWp\\u2022y" CLOB, "1800 kWh/kWp\\u2022y" CLOB, "1600 kWh/kWp\\u2022y" CLOB, "1400 kWh/kWp\\u2022y" CLOB, "1200 kWh/kWp\\u2022y" CLOB, "1000 kWh/kWp\\u2022y" CLOB, "800 kWh/kWp\\u2022y" CLOB)
| At the rate where 1600kwh/kwp y is 26.3, what is the value of 2200 kwh/kwp y? | SELECT "2200 kWh/kWp\u2022y" FROM table_18910 WHERE "1600 kWh/kWp\u2022y" = '26.3' | SELECT "2200 kWh/kWp\u2022y" FROM "table_18910" WHERE "1600 kWh/kWp\u2022y" = '26.3' | 0.082031 |
CREATE TABLE table_name_28 (yacht_name VARCHAR2, overall_place VARCHAR2)
| What is the name of the yacht where 12 is the overall place? | SELECT yacht_name FROM table_name_28 WHERE overall_place = "12" | SELECT "yacht_name" FROM "table_name_28" WHERE "12" = "overall_place" | 0.067383 |
CREATE TABLE table_name_60 (long VARCHAR2, car VARCHAR2)
| What is the long for the player with 26 carries? | SELECT long FROM table_name_60 WHERE car = 26 | SELECT "long" FROM "table_name_60" WHERE "car" = 26 | 0.049805 |
CREATE TABLE table_5211 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Record" CLOB, "Venue" CLOB, "Attendance" CLOB)
| Result of l 10-23 occurred in what week? | SELECT "Week" FROM table_5211 WHERE "Result" = 'l 10-23' | SELECT "Week" FROM "table_5211" WHERE "Result" = 'l 10-23' | 0.056641 |
CREATE TABLE table_70394 ("Overall place" CLOB, "Yacht name" CLOB, "Skipper" CLOB, "Points" CLOB, "Combined elapsed time" CLOB)
| Which Combined elapsed time has a Skipper of stephen wilkins? | SELECT "Combined elapsed time" FROM table_70394 WHERE "Skipper" = 'stephen wilkins' | SELECT "Combined elapsed time" FROM "table_70394" WHERE "Skipper" = 'stephen wilkins' | 0.083008 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.