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 microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE 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 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_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
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 chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE 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 d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
| how many patients received umbilical vein cath after the first cont inv mec ven <96 hrs procedure within 2 months since 2102? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cont inv mec ven <96 hrs') AND STRFTIME('%y', procedures_icd.charttime) >= '2102') AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'umbilical vein cath') AND STRFTIME('%y', procedures_icd.charttime) >= '2102') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t2.charttime) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month') | WITH "t2" AS (SELECT "admissions"."subject_id", "procedures_icd"."charttime" FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'umbilical vein cath' JOIN "admissions" ON "admissions"."hadm_id" = "procedures_icd"."hadm_id" WHERE STRFTIME('%y', "procedures_icd"."charttime") >= '2102') SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'cont inv mec ven <96 hrs' JOIN "admissions" ON "admissions"."hadm_id" = "procedures_icd"."hadm_id" JOIN "t2" "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND "procedures_icd"."charttime" < "t2"."charttime" AND DATETIME("procedures_icd"."charttime") <= DATETIME("t2"."charttime") AND DATETIME("procedures_icd"."charttime", '+2 month') >= DATETIME("t2"."charttime") WHERE STRFTIME('%y', "procedures_icd"."charttime") >= '2102' | 0.993164 |
CREATE TABLE table_204_795 (id NUMBER, "date" CLOB, "opponent" CLOB, "score" CLOB, "result" CLOB, "location" CLOB, "attendance" NUMBER)
| which team did this team face against next after beating minnesota on january 29 of this season ? | SELECT "opponent" FROM table_204_795 WHERE "date" > (SELECT "date" FROM table_204_795 WHERE "date" = 'january 29, 1949') ORDER BY "date" LIMIT 1 | SELECT "opponent" FROM "table_204_795" WHERE "date" > (SELECT "date" FROM "table_204_795" WHERE "date" = 'january 29, 1949') ORDER BY "date" FETCH FIRST 1 ROWS ONLY | 0.160156 |
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)
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)
| count the number of patients whose days of hospital stay is greater than 2 and drug type is base? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "2" AND prescriptions.drug_type = "BASE" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "BASE" = "prescriptions"."drug_type" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "2" < "demographic"."days_stay" | 0.217773 |
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)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| provide the number of patients whose diagnoses icd9 code is 3051 and lab test abnormal status is 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 = "3051" AND lab.flag = "abnormal" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "3051" = "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_72238 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
| What is the team located at philips arena 18,227? | SELECT "Team" FROM table_72238 WHERE "Location Attendance" = 'Philips Arena 18,227' | SELECT "Team" FROM "table_72238" WHERE "Location Attendance" = 'Philips Arena 18,227' | 0.083008 |
CREATE TABLE table_31939 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Attendance" FLOAT)
| Who is the opponent for week 10? | SELECT "Opponent" FROM table_31939 WHERE "Week" = '10' | SELECT "Opponent" FROM "table_31939" WHERE "Week" = '10' | 0.054688 |
CREATE TABLE table_name_52 (wheel_arrangement VARCHAR2, manufacturer VARCHAR2, quantity_made VARCHAR2)
| What is Wheel Arrangement, when Manufacturer is 'Baldwin', and when Quantity Made is 12? | SELECT wheel_arrangement FROM table_name_52 WHERE manufacturer = "baldwin" AND quantity_made = "12" | SELECT "wheel_arrangement" FROM "table_name_52" WHERE "12" = "quantity_made" AND "baldwin" = "manufacturer" | 0.104492 |
CREATE TABLE table_204_301 (id NUMBER, "nationality" CLOB, "name" CLOB, "term as a deputy judge" CLOB, "reason for termination" CLOB)
| how long are the terms for those deputy judges that are not re elected ? | SELECT "term as a deputy judge" - "term as a deputy judge" FROM table_204_301 WHERE "reason for termination" = 'not re-elected' | SELECT "term as a deputy judge" - "term as a deputy judge" FROM "table_204_301" WHERE "reason for termination" = 'not re-elected' | 0.125977 |
CREATE TABLE table_19136 ("School" CLOB, "Mascot" CLOB, "Conference" CLOB, "National Titles" FLOAT, "Founded" FLOAT)
| which school has 14 large championships | SELECT "School" FROM table_19136 WHERE "National Titles" = '14' | SELECT "School" FROM "table_19136" WHERE "National Titles" = '14' | 0.063477 |
CREATE TABLE table_64163 ("County" CLOB, "Per capita income" CLOB, "Median household income" CLOB, "Median family income" CLOB, "Population" FLOAT, "Number of households" FLOAT)
| What's the population that has a median family income of $50,553? | SELECT COUNT("Population") FROM table_64163 WHERE "Median family income" = '$50,553' | SELECT COUNT("Population") FROM "table_64163" WHERE "Median family income" = '$50,553' | 0.083984 |
CREATE TABLE table_name_1 (player VARCHAR2, school_club_team_country VARCHAR2)
| Which player plays for Illinois? | SELECT player FROM table_name_1 WHERE school_club_team_country = "illinois" | SELECT "player" FROM "table_name_1" WHERE "illinois" = "school_club_team_country" | 0.079102 |
CREATE TABLE table_63947 ("Ship" CLOB, "Built" FLOAT, "In service for NAL" CLOB, "Type" CLOB, "Tonnage" CLOB)
| The ship SSBergensfjord built before 1973 has what tonnage? | SELECT "Tonnage" FROM table_63947 WHERE "Built" < '1973' AND "Ship" = 'ssbergensfjord' | SELECT "Tonnage" FROM "table_63947" WHERE "Built" < '1973' AND "Ship" = 'ssbergensfjord' | 0.085938 |
CREATE TABLE table_4221 ("Seed" FLOAT, "Rank" FLOAT, "Player" CLOB, "Points" FLOAT, "Points defending" FLOAT, "Points won" FLOAT, "New points" FLOAT, "Status" CLOB)
| which player had the status to the fourth round lost to tsvetana pironkova [32] Answers: | SELECT "Player" FROM table_4221 WHERE "Status" = 'Fourth round lost to Tsvetana Pironkova [32]' | SELECT "Player" FROM "table_4221" WHERE "Status" = 'Fourth round lost to Tsvetana Pironkova [32]' | 0.094727 |
CREATE TABLE table_name_42 (position VARCHAR2, pick VARCHAR2)
| Which Position has a Pick of 74? | SELECT position FROM table_name_42 WHERE pick = 74 | SELECT "position" FROM "table_name_42" WHERE "pick" = 74 | 0.054688 |
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name 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 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 cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
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_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 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 patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_icd_diagnoses (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 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_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
| for patients who were prescribed with budesonide, what is the three most commonly prescribed drugs at the same time during this year? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'budesonide' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 3 | WITH "t2" AS (SELECT "admissions"."subject_id", "prescriptions"."drug", "prescriptions"."startdate" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" WHERE DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')), "t3" AS (SELECT "t2"."drug", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" JOIN "t2" "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND DATETIME("prescriptions"."startdate") = DATETIME("t2"."startdate") WHERE "prescriptions"."drug" = 'budesonide' AND DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY "t2"."drug") SELECT "t3"."drug" FROM "t3" "t3" WHERE "t3"."c1" <= 3 | 0.833008 |
CREATE TABLE table_11734041_20 (years_for_rockets VARCHAR2, school_club_team_country VARCHAR2)
| what is the total number of years for rockets where school/club team/country is baylor | SELECT COUNT(years_for_rockets) FROM table_11734041_20 WHERE school_club_team_country = "Baylor" | SELECT COUNT("years_for_rockets") FROM "table_11734041_20" WHERE "Baylor" = "school_club_team_country" | 0.099609 |
CREATE TABLE table_13681_2 (currency_name VARCHAR2, highest_monthly_inflation_rate VARCHAR2)
| what's the currency name with highest monthly inflation rate being 29,500% | SELECT currency_name FROM table_13681_2 WHERE highest_monthly_inflation_rate = "29,500%" | SELECT "currency_name" FROM "table_13681_2" WHERE "29,500%" = "highest_monthly_inflation_rate" | 0.091797 |
CREATE TABLE person (name CLOB, age NUMBER, city CLOB, gender CLOB, job CLOB)
CREATE TABLE personfriend (name CLOB, friend CLOB, year NUMBER)
| What is the age of the doctor named Zach? | SELECT age FROM person WHERE job = 'doctor' AND name = 'Zach' | SELECT "age" FROM "person" WHERE "job" = 'doctor' AND "name" = 'Zach' | 0.067383 |
CREATE TABLE table_name_52 (manufacturer VARCHAR2, year_withdrawn VARCHAR2)
| Who manufactured the vehicle that was withdrawn in 1927? | SELECT manufacturer FROM table_name_52 WHERE year_withdrawn = 1927 | SELECT "manufacturer" FROM "table_name_52" WHERE "year_withdrawn" = 1927 | 0.070313 |
CREATE TABLE table_15532 ("Year" FLOAT, "English title" CLOB, "Original title" CLOB, "Country" CLOB, "Director" CLOB)
| What is the Country of origin for the film directed by George Miller? | SELECT "Country" FROM table_15532 WHERE "Director" = 'george miller' | SELECT "Country" FROM "table_15532" WHERE "Director" = 'george miller' | 0.068359 |
CREATE TABLE book_club (Id VARCHAR2)
| How many book clubs are there? | SELECT COUNT(*) FROM book_club | SELECT COUNT(*) FROM "book_club" | 0.03125 |
CREATE TABLE table_21457 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
| At what location and what was the attendance when Rafer Alston (10) achieved high assists? | SELECT "Location Attendance" FROM table_21457 WHERE "High assists" = 'Rafer Alston (10)' | SELECT "Location Attendance" FROM "table_21457" WHERE "High assists" = 'Rafer Alston (10)' | 0.087891 |
CREATE TABLE table_31965 ("Calls" CLOB, "Frequency" CLOB, "Branding" CLOB, "Format" CLOB, "Timeslot" CLOB, "Group owner" CLOB)
| Tell me the calls for frequency of 1290 khz | SELECT "Calls" FROM table_31965 WHERE "Frequency" = '1290 khz' | SELECT "Calls" FROM "table_31965" WHERE "Frequency" = '1290 khz' | 0.0625 |
CREATE TABLE table_203_356 (id NUMBER, "type" CLOB, "diagonal ( mm ) " CLOB, "width ( mm ) " CLOB, "height ( mm ) " CLOB, "area ( mm2 ) " CLOB, "stops ( area ) " NUMBER, "crop factor" CLOB)
| which is wider ; the blackmagic pocket cinema camera or the 1/2 .7 ? | SELECT "type" FROM table_203_356 WHERE "type" IN ('blackmagic pocket cinema camera', '1/2.7"') ORDER BY "width (mm)" DESC LIMIT 1 | SELECT "type" FROM "table_203_356" WHERE "type" IN ('blackmagic pocket cinema camera', '1/2.7"') ORDER BY "width (mm)" DESC FETCH FIRST 1 ROWS ONLY | 0.143555 |
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 Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE 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)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
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 VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description 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 FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE 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 ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE ReviewTaskResultTypes (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)
| Number of closed duplicate questions. | SELECT COUNT(DISTINCT d.Id) FROM Posts AS d LEFT JOIN PostHistory AS ph ON ph.PostId = d.Id LEFT JOIN PostLinks AS pl ON pl.PostId = d.Id LEFT JOIN Posts AS o ON o.Id = pl.RelatedPostId WHERE d.PostTypeId = 1 AND pl.LinkTypeId = 3 AND ph.PostHistoryTypeId = 10 | SELECT COUNT(DISTINCT "d"."Id") FROM "Posts" "d" LEFT JOIN "PostHistory" "ph" ON "d"."Id" = "ph"."PostId" LEFT JOIN "PostLinks" "pl" ON "d"."Id" = "pl"."PostId" LEFT JOIN "Posts" "o" ON "o"."Id" = "pl"."RelatedPostId" WHERE "d"."PostTypeId" = 1 AND "ph"."PostHistoryTypeId" = 10 AND "pl"."LinkTypeId" = 3 | 0.296875 |
CREATE TABLE table_name_83 (score VARCHAR2, home VARCHAR2, date VARCHAR2)
| Which Score has a Home of quebec nordiques on april 16? | SELECT score FROM table_name_83 WHERE home = "quebec nordiques" AND date = "april 16" | SELECT "score" FROM "table_name_83" WHERE "april 16" = "date" AND "home" = "quebec nordiques" | 0.09082 |
CREATE TABLE table_66899 ("Year" CLOB, "Superintendent" CLOB, "Glendale Principal" CLOB, "H.H. Principal" CLOB, "Maplemere Principal" CLOB, "W.R. Principal" CLOB, "M.S. Principal" CLOB, "H.S. Principal" CLOB, "H. S. Asst. Principal" CLOB)
| Who is the h.s. principal during 1973-1974? | SELECT "H.S. Principal" FROM table_66899 WHERE "Year" = '1973-1974' | SELECT "H.S. Principal" FROM "table_66899" WHERE "Year" = '1973-1974' | 0.067383 |
CREATE TABLE table_204_401 (id NUMBER, "rank" NUMBER, "lane" NUMBER, "name" CLOB, "nationality" CLOB, "react" NUMBER, "time" NUMBER, "notes" CLOB)
| how long did it take elin backman to finish the race ? | SELECT "time" FROM table_204_401 WHERE "name" = 'elin backman' | SELECT "time" FROM "table_204_401" WHERE "name" = 'elin backman' | 0.0625 |
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 about what are the different affiliations, and what is the total enrollment of schools founded after 1850 for each enrollment type? | SELECT Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation | SELECT "Affiliation", SUM("Enrollment") FROM "university" WHERE "Founded" > 1850 GROUP BY "Affiliation" | 0.100586 |
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)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| what is the diagnoses and diagnosis detail of the patient id 4342? | SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "4342" | SELECT "diagnoses"."short_title", "diagnoses"."long_title" FROM "diagnoses" WHERE "4342" = "diagnoses"."subject_id" | 0.112305 |
CREATE TABLE table_29904 ("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 most assists and how many did they have in game 35? | SELECT "High assists" FROM table_29904 WHERE "Game" = '35' | SELECT "High assists" FROM "table_29904" WHERE "Game" = '35' | 0.058594 |
CREATE TABLE table_26328 ("Sector" CLOB, "Establishments" FLOAT, "Sales , receipts , or shipments ( $1 , 000 ) " FLOAT, "Annual payroll ( $1 , 000 ) " FLOAT, "Paid employees" FLOAT)
| If the establishment is 49319, what is the sales, receipts or shipments maximum amount? | SELECT MAX("Sales, receipts, or shipments ($1,000)") FROM table_26328 WHERE "Establishments" = '49319' | SELECT MAX("Sales, receipts, or shipments ($1,000)") FROM "table_26328" WHERE "Establishments" = '49319' | 0.101563 |
CREATE TABLE table_73561 ("Seed" FLOAT, "Rank" FLOAT, "Player" CLOB, "Points" FLOAT, "Points defending" CLOB, "Points won" FLOAT, "New points" FLOAT, "Status" CLOB)
| Name the status for points 3185 | SELECT "Status" FROM table_73561 WHERE "Points" = '3185' | SELECT "Status" FROM "table_73561" WHERE "Points" = '3185' | 0.056641 |
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 revenue , and group by attribute name, rank total number in asc order. | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T2.Revenue | SELECT "T1"."Name", "T2"."Revenue" FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "T1"."Name" ORDER BY "T2"."Revenue" | 0.15918 |
CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB)
CREATE TABLE basketball_match (Team_ID NUMBER, School_ID NUMBER, Team_Name CLOB, ACC_Regular_Season CLOB, ACC_Percent CLOB, ACC_Home CLOB, ACC_Road CLOB, All_Games CLOB, All_Games_Percent NUMBER, All_Home CLOB, All_Road CLOB, All_Neutral CLOB)
| A scatter chart shows the correlation between Team_ID and School_ID . | SELECT Team_ID, School_ID FROM basketball_match | SELECT "Team_ID", "School_ID" FROM "basketball_match" | 0.051758 |
CREATE TABLE table_16461 ("No. in season" FLOAT, "No. in series" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "U.S. viewers ( million ) " CLOB)
| Who directed episodes that had 2.61 million U.S. viewers? | SELECT "Directed by" FROM table_16461 WHERE "U.S. viewers (million)" = '2.61' | SELECT "Directed by" FROM "table_16461" WHERE "U.S. viewers (million)" = '2.61' | 0.077148 |
CREATE TABLE takes (ID VARCHAR2, course_id VARCHAR2, sec_id VARCHAR2, semester VARCHAR2, year NUMBER, grade VARCHAR2)
CREATE TABLE classroom (building VARCHAR2, room_number VARCHAR2, capacity NUMBER)
CREATE TABLE advisor (s_ID VARCHAR2, i_ID VARCHAR2)
CREATE TABLE teaches (ID VARCHAR2, course_id VARCHAR2, sec_id VARCHAR2, semester VARCHAR2, year NUMBER)
CREATE TABLE course (course_id VARCHAR2, title VARCHAR2, dept_name VARCHAR2, credits NUMBER)
CREATE TABLE prereq (course_id VARCHAR2, prereq_id VARCHAR2)
CREATE TABLE department (dept_name VARCHAR2, building VARCHAR2, budget NUMBER)
CREATE TABLE instructor (ID VARCHAR2, name VARCHAR2, dept_name VARCHAR2, salary NUMBER)
CREATE TABLE student (ID VARCHAR2, name VARCHAR2, dept_name VARCHAR2, tot_cred NUMBER)
CREATE TABLE time_slot (time_slot_id VARCHAR2, day VARCHAR2, start_hr NUMBER, start_min NUMBER, end_hr NUMBER, end_min NUMBER)
CREATE TABLE section (course_id VARCHAR2, sec_id VARCHAR2, semester VARCHAR2, year NUMBER, building VARCHAR2, room_number VARCHAR2, time_slot_id VARCHAR2)
| Bar chart of total number of credits from each dept name | SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name | SELECT "dept_name", SUM("credits") FROM "course" GROUP BY "dept_name" | 0.067383 |
CREATE TABLE PROFESSOR (EMP_NUM NUMBER, DEPT_CODE VARCHAR2, PROF_OFFICE VARCHAR2, PROF_EXTENSION VARCHAR2, PROF_HIGH_DEGREE VARCHAR2)
CREATE TABLE STUDENT (STU_NUM NUMBER, STU_LNAME VARCHAR2, STU_FNAME VARCHAR2, STU_INIT VARCHAR2, STU_DOB DATETIME, STU_HRS NUMBER, STU_CLASS VARCHAR2, STU_GPA FLOAT, STU_TRANSFER NUMBER, DEPT_CODE VARCHAR2, STU_PHONE VARCHAR2, PROF_NUM NUMBER)
CREATE TABLE ENROLL (CLASS_CODE VARCHAR2, STU_NUM NUMBER, ENROLL_GRADE VARCHAR2)
CREATE TABLE COURSE (CRS_CODE VARCHAR2, DEPT_CODE VARCHAR2, CRS_DESCRIPTION VARCHAR2, CRS_CREDIT FLOAT)
CREATE TABLE DEPARTMENT (DEPT_CODE VARCHAR2, DEPT_NAME VARCHAR2, SCHOOL_CODE VARCHAR2, EMP_NUM NUMBER, DEPT_ADDRESS VARCHAR2, DEPT_EXTENSION VARCHAR2)
CREATE TABLE EMPLOYEE (EMP_NUM NUMBER, EMP_LNAME VARCHAR2, EMP_FNAME VARCHAR2, EMP_INITIAL VARCHAR2, EMP_JOBCODE VARCHAR2, EMP_HIREDATE DATETIME, EMP_DOB DATETIME)
CREATE TABLE CLASS (CLASS_CODE VARCHAR2, CRS_CODE VARCHAR2, CLASS_SECTION VARCHAR2, CLASS_TIME VARCHAR2, CLASS_ROOM VARCHAR2, PROF_NUM NUMBER)
| A bar chart about how many classes are held in each department?, and show by the bars in asc please. | SELECT DEPT_CODE, COUNT(*) FROM CLASS AS T1 JOIN COURSE AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY DEPT_CODE ORDER BY DEPT_CODE | SELECT "DEPT_CODE", COUNT(*) FROM "CLASS" "T1" JOIN "COURSE" "T2" ON "T1"."CRS_CODE" = "T2"."CRS_CODE" GROUP BY "DEPT_CODE" ORDER BY "DEPT_CODE" | 0.140625 |
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
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 comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
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 area (course_id NUMBER, area 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)
| What individuals have never taught HISTORY 470 ? | SELECT DISTINCT name FROM instructor WHERE NOT name IN (SELECT INSTRUCTORalias1.name FROM course AS COURSEalias0 INNER JOIN course_offering AS COURSE_OFFERINGalias0 ON COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id INNER JOIN offering_instructor AS OFFERING_INSTRUCTOR ON OFFERING_OFFERING_ID = COURSE_OFFERINGalias0.offering_id INNER JOIN instructor AS INSTRUCTORalias1 ON offering_instructor_id = INSTRUCTORalias1.instructor_id WHERE COURSEalias0.department = 'HISTORY' AND COURSEalias0.number = 470) | SELECT DISTINCT "name" FROM "instructor" WHERE NOT "name" IN (SELECT "INSTRUCTORalias1"."name" FROM "course" "COURSEalias0" JOIN "instructor" "INSTRUCTORalias1" ON "INSTRUCTORalias1"."instructor_id" = "offering_instructor_id" JOIN "course_offering" "COURSE_OFFERINGalias0" ON "COURSE_OFFERINGalias0"."course_id" = "COURSEalias0"."course_id" JOIN "offering_instructor" "OFFERING_INSTRUCTOR" ON "COURSE_OFFERINGalias0"."offering_id" = "OFFERING_OFFERING_ID" WHERE "COURSEalias0"."department" = 'HISTORY' AND "COURSEalias0"."number" = 470) | 0.523438 |
CREATE TABLE player (Player_ID NUMBER, name CLOB, Position CLOB, Club_ID NUMBER, Apps FLOAT, Tries FLOAT, Goals CLOB, Points FLOAT)
CREATE TABLE competition_result (Competition_ID NUMBER, Club_ID_1 NUMBER, Club_ID_2 NUMBER, Score 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 club (Club_ID NUMBER, name CLOB, Region CLOB, Start_year CLOB)
| Give me a histogram for what is the number of players who have points less than 30 for each position?, and show X from low to high order. | SELECT Position, COUNT(*) FROM player WHERE Points < 30 GROUP BY Position ORDER BY Position | SELECT "Position", COUNT(*) FROM "player" WHERE "Points" < 30 GROUP BY "Position" ORDER BY "Position" | 0.098633 |
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 employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
| For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the average of manager_id bin hire_date by time in a bar chart. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' | SELECT "HIRE_DATE", AVG("MANAGER_ID") FROM "employees" WHERE "HIRE_DATE" < '2002-06-21' | 0.084961 |
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)
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)
| report the number of patients admitted before 2177 who had left internal jugular vein thrombosis; left arm edema primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" AND demographic.admityear < "2177" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2177" > "demographic"."admityear" AND "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" = "demographic"."diagnosis" | 0.191406 |
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 CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment 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 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 PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE 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 PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
| WIP: Same as before but with answers. | SELECT Id AS "post_link", CreationDate AS Date, AnswerCount FROM Posts WHERE CreationDate < '2011-12-31' AND PostTypeId = 1 AND ClosedDate IS NULL AND AnswerCount = 0 AND CommunityOwnedDate IS NULL ORDER BY CreationDate | SELECT "Id" AS "post_link", "CreationDate" AS "Date", "AnswerCount" FROM "Posts" WHERE "AnswerCount" = 0 AND "ClosedDate" IS NULL AND "CommunityOwnedDate" IS NULL AND "CreationDate" < '2011-12-31' AND "PostTypeId" = 1 ORDER BY "CreationDate" | 0.235352 |
CREATE TABLE member_of (facid NUMBER, dno NUMBER, appt_type CLOB)
CREATE TABLE department (dno NUMBER, division CLOB, dname CLOB, room CLOB, building CLOB, dphone NUMBER)
CREATE TABLE enrolled_in (stuid NUMBER, cid CLOB, grade CLOB)
CREATE TABLE student (stuid NUMBER, lname CLOB, fname CLOB, age NUMBER, sex CLOB, major NUMBER, advisor NUMBER, city_code CLOB)
CREATE TABLE course (cid CLOB, cname CLOB, credits NUMBER, instructor NUMBER, days CLOB, hours CLOB, dno NUMBER)
CREATE TABLE faculty (facid NUMBER, lname CLOB, fname CLOB, rank CLOB, sex CLOB, phone NUMBER, room CLOB, building CLOB)
CREATE TABLE minor_in (stuid NUMBER, dno NUMBER)
CREATE TABLE gradeconversion (lettergrade CLOB, gradepoint NUMBER)
| Find the first names of faculties of rank Professor in alphabetic order. | SELECT fname FROM faculty WHERE rank = "Professor" ORDER BY fname | SELECT "fname" FROM "faculty" WHERE "Professor" = "rank" ORDER BY "fname" | 0.071289 |
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)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| count the number of patients whose procedure icd9 code is 4610. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "4610" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "4610" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" | 0.171875 |
CREATE TABLE table_27383 ("Language" CLOB, "Punata Municipality" FLOAT, "Villa Rivero Municipality" FLOAT, "San Benito Municipality" FLOAT, "Tacachi Municipality" FLOAT, "Cuchumuela Municipality" FLOAT)
| What is the language total number if the Tacachi Municipality is 3? | SELECT COUNT("Language") FROM table_27383 WHERE "Tacachi Municipality" = '3' | SELECT COUNT("Language") FROM "table_27383" WHERE "Tacachi Municipality" = '3' | 0.076172 |
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 d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod 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 diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE 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 labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE procedures_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)
| what is the top four most frequent diagnoses given to patients after packed cell transfusion within the same hospital visit in 2104? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'packed cell transfusion') AND STRFTIME('%y', procedures_icd.charttime) = '2104') AS t1 JOIN (SELECT admissions.subject_id, diagnoses_icd.icd9_code, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', diagnoses_icd.charttime) = '2104') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 4) | WITH "t2" AS (SELECT "admissions"."subject_id", "diagnoses_icd"."icd9_code", "diagnoses_icd"."charttime", "admissions"."hadm_id" FROM "diagnoses_icd" JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" WHERE STRFTIME('%y', "diagnoses_icd"."charttime") = '2104'), "t3" AS (SELECT "t2"."icd9_code", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'packed cell transfusion' JOIN "admissions" ON "admissions"."hadm_id" = "procedures_icd"."hadm_id" JOIN "t2" "t2" ON "admissions"."hadm_id" = "t2"."hadm_id" AND "admissions"."subject_id" = "t2"."subject_id" AND "procedures_icd"."charttime" < "t2"."charttime" WHERE STRFTIME('%y', "procedures_icd"."charttime") = '2104' GROUP BY "t2"."icd9_code"), "_u_1" AS (SELECT "t3"."icd9_code" FROM "t3" "t3" WHERE "t3"."c1" <= 4 GROUP BY "icd9_code") SELECT "d_icd_diagnoses"."short_title" FROM "d_icd_diagnoses" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "d_icd_diagnoses"."icd9_code" WHERE NOT "_u_1"."" IS NULL | 1.089844 |
CREATE TABLE table_19250 ("Year" FLOAT, "Boys singles" CLOB, "Girls singles" CLOB, "Boys doubles" CLOB, "Girls doubles" CLOB, "Mixed doubles" CLOB)
| When mixed doubles is danny bawa chrisnanta debby susanto what is the boys singles? | SELECT "Boys singles" FROM table_19250 WHERE "Mixed doubles" = 'Danny Bawa Chrisnanta Debby Susanto' | SELECT "Boys singles" FROM "table_19250" WHERE "Mixed doubles" = 'Danny Bawa Chrisnanta Debby Susanto' | 0.099609 |
CREATE TABLE table_train_9 ("id" NUMBER, "pregnancy_or_lactation" BOOLEAN, "intention_to_arterial_catheter" BOOLEAN, "intention_to_central_venous_catheter" BOOLEAN, "surgery" BOOLEAN, "hypotension" BOOLEAN, "chest_trauma" BOOLEAN, "burn_injury" NUMBER, "impossible_transthoracic_echocardiogram_tte" BOOLEAN, "NOUSE" FLOAT)
| requirement for immediate surgery | SELECT * FROM table_train_9 WHERE surgery = 1 | SELECT * FROM "table_train_9" WHERE "surgery" = 1 | 0.047852 |
CREATE TABLE table_14875671_1 (game_site VARCHAR2, opponent VARCHAR2)
| What was the site of the game against Buffalo Bills ? | SELECT game_site FROM table_14875671_1 WHERE opponent = "Buffalo Bills" | SELECT "game_site" FROM "table_14875671_1" WHERE "Buffalo Bills" = "opponent" | 0.075195 |
CREATE TABLE table_14942 ("Name" CLOB, "Years" CLOB, "Gender" CLOB, "Area" CLOB, "Authority" CLOB, "Decile" FLOAT, "Roll" FLOAT)
| What gender is allowed to attend the school that has a decile of 6 and a roll that is less than 179? | SELECT "Gender" FROM table_14942 WHERE "Decile" = '6' AND "Roll" < '179' | SELECT "Gender" FROM "table_14942" WHERE "Decile" = '6' AND "Roll" < '179' | 0.072266 |
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)
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)
| count the number of patients whose diagnoses long title is perforation of intestine and lab test abnormal status is 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.long_title = "Perforation of intestine" AND lab.flag = "abnormal" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Perforation of intestine" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "lab" ON "abnormal" = "lab"."flag" AND "demographic"."hadm_id" = "lab"."hadm_id" | 0.273438 |
CREATE TABLE table_30901 ("Episode" FLOAT, "First Air Date" CLOB, "Rating ( 18\\u201349 ) " CLOB, "Share ( 18\\u201349 ) " FLOAT, "Viewers ( millions ) " CLOB, "Rank ( timeslot ) " CLOB)
| When there are 10.02 million viewers what is the rating (18-49)? | SELECT "Rating (18\u201349)" FROM table_30901 WHERE "Viewers (millions)" = '10.02' | SELECT "Rating (18\u201349)" FROM "table_30901" WHERE "Viewers (millions)" = '10.02' | 0.082031 |
CREATE TABLE voting_record (stuid NUMBER, registration_date CLOB, election_cycle CLOB, president_vote NUMBER, vice_president_vote NUMBER, secretary_vote NUMBER, treasurer_vote NUMBER, class_president_vote NUMBER, class_senator_vote NUMBER)
CREATE TABLE student (stuid NUMBER, lname CLOB, fname CLOB, age NUMBER, sex CLOB, major NUMBER, advisor NUMBER, city_code CLOB)
| Return all the distinct secretary votes made in the fall election cycle. | SELECT DISTINCT secretary_vote FROM voting_record WHERE election_cycle = "Fall" | SELECT DISTINCT "secretary_vote" FROM "voting_record" WHERE "Fall" = "election_cycle" | 0.083008 |
CREATE TABLE table_23286112_7 (high_points VARCHAR2, location_attendance VARCHAR2)
| Who has high points when verizon center 17,152 is location attendance? | SELECT high_points FROM table_23286112_7 WHERE location_attendance = "Verizon Center 17,152" | SELECT "high_points" FROM "table_23286112_7" WHERE "Verizon Center 17,152" = "location_attendance" | 0.095703 |
CREATE TABLE table_24724 ("Year" FLOAT, "Film" CLOB, "Budget" CLOB, "Domestic Box Office" CLOB, "Foreign Box Office" CLOB, "Total" CLOB, "US DVD sales" CLOB, "Total ( with DVD sales ) " CLOB)
| What was the domestic box office for 'House on Haunted Hill'? | SELECT "Domestic Box Office" FROM table_24724 WHERE "Film" = 'House on Haunted Hill' | SELECT "Domestic Box Office" FROM "table_24724" WHERE "Film" = 'House on Haunted Hill' | 0.083984 |
CREATE TABLE table_name_4 (diameter__km_ NUMBER, name VARCHAR2, year_named VARCHAR2)
| Which Diameter (km) has a Name of alma-merghen planitia, and a Year named smaller than 1997? | SELECT MAX(diameter__km_) FROM table_name_4 WHERE name = "alma-merghen planitia" AND year_named < 1997 | SELECT MAX("diameter__km_") FROM "table_name_4" WHERE "alma-merghen planitia" = "name" AND "year_named" < 1997 | 0.107422 |
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 vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE 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 allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
| what were the four most frequent drugs prescribed to stroke male patients with age 60 or above during the same month after being diagnosed with stroke the last year? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'stroke' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.gender = 'male' AND patient.age >= 60 AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.drugstarttime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.drugstarttime, 'start of month') GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 4 | WITH "t2" AS (SELECT "patient"."uniquepid", "medication"."drugname", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" AND "patient"."age" >= 60 AND "patient"."gender" = 'male' WHERE DATETIME("medication"."drugstarttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')), "t3" AS (SELECT "t2"."drugname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" "t2" ON "diagnosis"."diagnosistime" < "t2"."drugstarttime" AND "patient"."uniquepid" = "t2"."uniquepid" AND DATETIME("diagnosis"."diagnosistime", 'start of month') = DATETIME("t2"."drugstarttime", 'start of month') WHERE "diagnosis"."diagnosisname" = 'stroke' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY "t2"."drugname") SELECT "t3"."drugname" FROM "t3" "t3" WHERE "t3"."c1" <= 4 | 1.00293 |
CREATE TABLE table_6720 ("Rider" CLOB, "Bike" CLOB, "Laps" FLOAT, "Time" CLOB, "Grid" FLOAT)
| What is the sum of laps for Karl Muggeridge on a grid less than 16? | SELECT SUM("Laps") FROM table_6720 WHERE "Rider" = 'karl muggeridge' AND "Grid" < '16' | SELECT SUM("Laps") FROM "table_6720" WHERE "Grid" < '16' AND "Rider" = 'karl muggeridge' | 0.085938 |
CREATE TABLE table_19283806_4 (location VARCHAR2, median_household_income__2011_ VARCHAR2)
| How many locations have a median household income in 2011 of $71,479? | SELECT COUNT(location) FROM table_19283806_4 WHERE median_household_income__2011_ = "$71,479" | SELECT COUNT("location") FROM "table_19283806_4" WHERE "$71,479" = "median_household_income__2011_" | 0.09668 |
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, a bar chart shows the distribution of name and the average of code , and group by attribute name, and display y-axis in ascending order. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code | SELECT "T2"."Name", "T1"."Code" FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "T2"."Name" ORDER BY "T1"."Code" | 0.15332 |
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
| how many male patients remained admitted in hospital for more than 6 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay > "6" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "6" < "demographic"."days_stay" AND "M" = "demographic"."gender" | 0.135742 |
CREATE TABLE table_58835 ("7:00 am" CLOB, "9:00 am" CLOB, "10:00 am" CLOB, "11:00 am" CLOB, "noon" CLOB, "12:30 pm" CLOB, "1:00 pm" CLOB, "1:30 pm" CLOB, "2:00 pm" CLOB, "2:30 pm" CLOB, "3:30 pm" CLOB, "4:30 pm" CLOB, "5:00 pm" CLOB, "6:30 pm" CLOB)
| What shows for 3:30 pm when 1:30 pm is the bold and the beautiful? | SELECT "3:30 pm" FROM table_58835 WHERE "1:30 pm" = 'the bold and the beautiful' | SELECT "3:30 pm" FROM "table_58835" WHERE "1:30 pm" = 'the bold and the beautiful' | 0.080078 |
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
| what were the three most frequently prescribed medications to patients who were previously treated with vasopressors - phenylephrine (neosynephrine) within 2 months, since 2104? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vasopressors - phenylephrine (neosynephrine)' AND STRFTIME('%y', treatment.treatmenttime) >= '2104') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', medication.drugstarttime) >= '2104') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.drugstarttime AND DATETIME(t2.drugstarttime) BETWEEN DATETIME(t1.treatmenttime) AND DATETIME(t1.treatmenttime, '+2 month') GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 3 | WITH "t2" AS (SELECT "patient"."uniquepid", "medication"."drugname", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" WHERE STRFTIME('%y', "medication"."drugstarttime") >= '2104'), "t3" AS (SELECT "t2"."drugname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" JOIN "t2" "t2" ON "patient"."uniquepid" = "t2"."uniquepid" AND "t2"."drugstarttime" > "treatment"."treatmenttime" AND DATETIME("t2"."drugstarttime") <= DATETIME("treatment"."treatmenttime", '+2 month') AND DATETIME("t2"."drugstarttime") >= DATETIME("treatment"."treatmenttime") WHERE "treatment"."treatmentname" = 'vasopressors - phenylephrine (neosynephrine)' AND STRFTIME('%y', "treatment"."treatmenttime") >= '2104' GROUP BY "t2"."drugname") SELECT "t3"."drugname" FROM "t3" "t3" WHERE "t3"."c1" <= 3 | 0.925781 |
CREATE TABLE table_203_857 (id NUMBER, "denomination" CLOB, "1870" CLOB, "1880" CLOB, "1890" CLOB, "1900" CLOB, "1910" CLOB, "1920" CLOB, "1930" CLOB, "1941" CLOB, "1949" CLOB, "2001" CLOB, "2011" CLOB)
| what is the largest religious denomination in budapest ? | SELECT "denomination" FROM table_203_857 ORDER BY "1870" DESC LIMIT 1 | SELECT "denomination" FROM "table_203_857" ORDER BY "1870" DESC FETCH FIRST 1 ROWS ONLY | 0.084961 |
CREATE TABLE table_16199 ("Institution" CLOB, "Nickname" CLOB, "Location" CLOB, "Founded" FLOAT, "Type" CLOB, "Enrollment" FLOAT)
| point park university is what type of institution | SELECT "Type" FROM table_16199 WHERE "Institution" = 'Point Park University' | SELECT "Type" FROM "table_16199" WHERE "Institution" = 'Point Park University' | 0.076172 |
CREATE TABLE market (market_id NUMBER, country CLOB, number_cities NUMBER)
CREATE TABLE film_market_estimation (estimation_id NUMBER, low_estimate NUMBER, high_estimate NUMBER, film_id NUMBER, type CLOB, market_id NUMBER, year NUMBER)
CREATE TABLE film (film_id NUMBER, title CLOB, studio CLOB, director CLOB, gross_in_dollar NUMBER)
| What are the years of film market estimation for the market of Japan, ordered by year descending? | SELECT T1.year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.market_id WHERE T2.country = "Japan" ORDER BY T1.year DESC | SELECT "T1"."year" FROM "film_market_estimation" "T1" JOIN "market" "T2" ON "Japan" = "T2"."country" AND "T1"."market_id" = "T2"."market_id" ORDER BY "T1"."year" DESC | 0.162109 |
CREATE TABLE table_40019 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Attendance" FLOAT)
| What was the result of the game on November 6, 1988? | SELECT "Result" FROM table_40019 WHERE "Date" = 'november 6, 1988' | SELECT "Result" FROM "table_40019" WHERE "Date" = 'november 6, 1988' | 0.066406 |
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)
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)
| how many patients are admitted under elective type and diagnosed with icd9 code 42833? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.icd9_code = "42833" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "42833" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "ELECTIVE" = "demographic"."admission_type" | 0.21875 |
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name 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 fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2)
CREATE TABLE flight_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 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 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 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 food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt 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 time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
| please list all flights leaving on thursday morning from NEW YORK to TORONTO | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW YORK' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'TORONTO' 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" = 24 AND "date_day"."month_number" = 5 AND "date_day"."year" = 1991 JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'TORONTO' 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_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" = 'NEW YORK' | 0.765625 |
CREATE TABLE table_48885 ("Team" CLOB, "Make" CLOB, "Drivers" CLOB, "Tyre" CLOB, "Rounds" CLOB)
| When driver yuji tachikawa had a make of lexus, what team did he represent? | SELECT "Team" FROM table_48885 WHERE "Make" = 'lexus' AND "Drivers" = 'yuji tachikawa' | SELECT "Team" FROM "table_48885" WHERE "Drivers" = 'yuji tachikawa' AND "Make" = 'lexus' | 0.085938 |
CREATE TABLE table_28685 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "Production code" FLOAT, "U.S. viewers ( million ) " CLOB)
| What is the name of chapter 8 of season 4? | SELECT "Title" FROM table_28685 WHERE "No. in season" = '8' | SELECT "Title" FROM "table_28685" WHERE "No. in season" = '8' | 0.05957 |
CREATE TABLE countries (country_id CLOB, country_name CLOB, region_id NUMBER)
CREATE TABLE departments (department_id NUMBER, department_name CLOB, manager_id NUMBER, location_id NUMBER)
CREATE TABLE job_history (employee_id NUMBER, start_date TIME, end_date TIME, job_id CLOB, department_id NUMBER)
CREATE TABLE jobs (job_id CLOB, job_title CLOB, min_salary NUMBER, max_salary NUMBER)
CREATE TABLE locations (location_id NUMBER, street_address CLOB, postal_code CLOB, city CLOB, state_province CLOB, country_id CLOB)
CREATE TABLE regions (region_id NUMBER, region_name CLOB)
CREATE TABLE employees (employee_id NUMBER, first_name CLOB, last_name CLOB, email CLOB, phone_number CLOB, hire_date TIME, job_id CLOB, salary NUMBER, commission_pct NUMBER, manager_id NUMBER, department_id NUMBER)
| What are the unique ids of those departments where any manager is managing 4 or more employees. | SELECT DISTINCT department_id FROM employees GROUP BY department_id, manager_id HAVING COUNT(employee_id) >= 4 | SELECT DISTINCT "department_id" FROM "employees" GROUP BY "department_id", "manager_id" HAVING COUNT("employee_id") >= 4 | 0.117188 |
CREATE TABLE table_17553 ("Season" FLOAT, "Mens singles" CLOB, "Womens singles" CLOB, "Mens doubles" CLOB, "Womens doubles" CLOB, "Mixed doubles" CLOB)
| How many women doubles teams competed in the same year as when Jamie van Hooijdonk competed in men singles? | SELECT COUNT("Womens doubles") FROM table_17553 WHERE "Mens singles" = 'Jamie van Hooijdonk' | SELECT COUNT("Womens doubles") FROM "table_17553" WHERE "Mens singles" = 'Jamie van Hooijdonk' | 0.091797 |
CREATE TABLE aircraft (aid NUMBER, name CLOB, distance NUMBER)
CREATE TABLE flight (flno NUMBER, origin CLOB, destination CLOB, distance NUMBER, departure_date TIME, arrival_date TIME, price NUMBER, aid NUMBER)
CREATE TABLE employee (eid NUMBER, name CLOB, salary NUMBER)
CREATE TABLE certificate (eid NUMBER, aid NUMBER)
| Show all origins and the number of flights from each origin. | SELECT origin, COUNT(*) FROM flight GROUP BY origin | SELECT "origin", COUNT(*) FROM "flight" GROUP BY "origin" | 0.055664 |
CREATE TABLE table_21058836_1 (game VARCHAR2, opponent VARCHAR2)
| What game did the Bruins play Santa Clara? | SELECT game FROM table_21058836_1 WHERE opponent = "Santa Clara" | SELECT "game" FROM "table_21058836_1" WHERE "Santa Clara" = "opponent" | 0.068359 |
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college 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 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 course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
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 comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
| Following 08:00 A.M. what section is in RCSSCI 517 ? | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '08:00' AND course.course_id = course_offering.course_id AND course.department = 'RCSSCI' AND course.number = 517 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | SELECT DISTINCT "course_offering"."end_time", "course_offering"."section_number", "course_offering"."start_time" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" AND "course_offering"."start_time" > '08:00' JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'WN' AND "semester"."year" = 2016 WHERE "course"."department" = 'RCSSCI' AND "course"."number" = 517 | 0.443359 |
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 bar chart about the distribution of name and manufacturer , and group by attribute founder, and rank by the X in descending. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name DESC | SELECT "T1"."Name", "T1"."Manufacturer" FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "Founder", "T1"."Name" ORDER BY "T1"."Name" DESC | 0.176758 |
CREATE TABLE table_9544 ("Player" CLOB, "Country" CLOB, "Year ( s ) won" CLOB, "Total" FLOAT, "To par" CLOB, "Finish" CLOB)
| What was the average total for the player from the United States, who won in 1978? | SELECT AVG("Total") FROM table_9544 WHERE "Country" = 'united states' AND "Year(s) won" = '1978' | SELECT AVG("Total") FROM "table_9544" WHERE "Country" = 'united states' AND "Year(s) won" = '1978' | 0.095703 |
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 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 minimum age of patients whose admission location is phys referral/normal deli and primary disease is congestive heart failure? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "CONGESTIVE HEART FAILURE" | SELECT MIN("demographic"."age") FROM "demographic" WHERE "CONGESTIVE HEART FAILURE" = "demographic"."diagnosis" AND "PHYS REFERRAL/NORMAL DELI" = "demographic"."admission_location" | 0.175781 |
CREATE TABLE table_35191 ("Year" FLOAT, "Class" CLOB, "Team" CLOB, "Points" FLOAT, "Rank" CLOB, "Wins" FLOAT)
| What is the highest year that Carlos drove for repsol honda and had less than 4 wins and less than 162 points? | SELECT MAX("Year") FROM table_35191 WHERE "Team" = 'repsol honda' AND "Wins" < '4' AND "Points" < '162' | SELECT MAX("Year") FROM "table_35191" WHERE "Points" < '162' AND "Team" = 'repsol honda' AND "Wins" < '4' | 0.102539 |
CREATE TABLE csu_fees (campus NUMBER, year NUMBER, campusfee NUMBER)
CREATE TABLE discipline_enrollments (campus NUMBER, discipline NUMBER, year NUMBER, undergraduate NUMBER, graduate NUMBER)
CREATE TABLE degrees (year NUMBER, campus NUMBER, degrees NUMBER)
CREATE TABLE faculty (campus NUMBER, year NUMBER, faculty NUMBER)
CREATE TABLE enrollments (campus NUMBER, year NUMBER, totalenrollment_ay NUMBER, fte_ay NUMBER)
CREATE TABLE campuses (id NUMBER, campus CLOB, location CLOB, county CLOB, year NUMBER)
| What are the degrees conferred in 'San Francisco State University' in 2001. | SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Francisco State University" AND t2.year = 2001 | SELECT "degrees" FROM "campuses" "T1" JOIN "degrees" "T2" ON "t1"."id" = "t2"."campus" WHERE "San Francisco State University" = "t1"."campus" AND "t2"."year" = 2001 | 0.160156 |
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 lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
| tell me the three most frequent surgeries that patients received during the same month after having had a sedative agent - lorazepam procedure last year? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'sedative agent - lorazepam' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmentname, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.treatmenttime AND DATETIME(t1.treatmenttime, 'start of month') = DATETIME(t2.treatmenttime, 'start of month') GROUP BY t2.treatmentname) AS t3 WHERE t3.c1 <= 3 | WITH "t2" AS (SELECT "patient"."uniquepid", "treatment"."treatmentname", "treatment"."treatmenttime" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" WHERE DATETIME("treatment"."treatmenttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')), "t3" AS (SELECT "t2"."treatmentname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" JOIN "t2" "t2" ON "patient"."uniquepid" = "t2"."uniquepid" AND "t2"."treatmenttime" > "treatment"."treatmenttime" AND DATETIME("t2"."treatmenttime", 'start of month') = DATETIME("treatment"."treatmenttime", 'start of month') WHERE "treatment"."treatmentname" = 'sedative agent - lorazepam' AND DATETIME("treatment"."treatmenttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY "t2"."treatmentname") SELECT "t3"."treatmentname" FROM "t3" "t3" WHERE "t3"."c1" <= 3 | 0.980469 |
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 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)
| provide the number of patients whose year of death is less than or equal to 2164 and diagnoses icd9 code is 99592? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2164.0" AND diagnoses.icd9_code = "99592" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "99592" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "2164.0" >= "demographic"."dod_year" | 0.211914 |
CREATE TABLE table_name_7 (opponent VARCHAR2, loss VARCHAR2)
| Who was the opponent when there was a loss of Francisco (1-1)? | SELECT opponent FROM table_name_7 WHERE loss = "francisco (1-1)" | SELECT "opponent" FROM "table_name_7" WHERE "francisco (1-1)" = "loss" | 0.068359 |
CREATE TABLE staff (staff_id NUMBER, staff_address_id NUMBER, nickname CLOB, first_name CLOB, middle_name CLOB, last_name CLOB, date_of_birth TIME, date_joined_staff TIME, date_left_staff TIME)
CREATE TABLE addresses (address_id NUMBER, line_1_number_building CLOB, city CLOB, zip_postcode CLOB, state_province_county CLOB, country CLOB)
CREATE TABLE vehicles (vehicle_id NUMBER, vehicle_details CLOB)
CREATE TABLE customer_payments (customer_id NUMBER, datetime_payment TIME, payment_method_code CLOB, amount_payment NUMBER)
CREATE TABLE lessons (lesson_id NUMBER, customer_id NUMBER, lesson_status_code CLOB, staff_id NUMBER, vehicle_id NUMBER, lesson_date TIME, lesson_time CLOB, price NUMBER)
CREATE TABLE customers (customer_id NUMBER, customer_address_id NUMBER, customer_status_code CLOB, date_became_customer TIME, date_of_birth TIME, first_name CLOB, last_name CLOB, amount_outstanding NUMBER, email_address CLOB, phone_number CLOB, cell_mobile_phone_number CLOB)
| How many customers have no payment histories? | SELECT COUNT(*) FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_payments) | SELECT COUNT(*) FROM "customers" WHERE NOT "customer_id" IN (SELECT "customer_id" FROM "customer_payments") | 0.104492 |
CREATE TABLE table_2701851_5 (title VARCHAR2, production_code VARCHAR2)
| What was the title for the episode with the production code 404a? | SELECT title FROM table_2701851_5 WHERE production_code = "404a" | SELECT "title" FROM "table_2701851_5" WHERE "404a" = "production_code" | 0.068359 |
CREATE TABLE table_33357 ("Place" FLOAT, "Rider" CLOB, "Country" CLOB, "Machine" CLOB, "Speed" CLOB, "Time" CLOB, "Points" FLOAT)
| What was the speed of the rider that earned 1 point? | SELECT "Speed" FROM table_33357 WHERE "Points" = '1' | SELECT "Speed" FROM "table_33357" WHERE "Points" = '1' | 0.052734 |
CREATE TABLE table_25839957_5 (shader_model VARCHAR2, core_clock___mhz__ VARCHAR2)
| How many shader models have a 900 core clock ( mhz )? | SELECT COUNT(shader_model) FROM table_25839957_5 WHERE core_clock___mhz__ = "900" | SELECT COUNT("shader_model") FROM "table_25839957_5" WHERE "900" = "core_clock___mhz__" | 0.084961 |
CREATE TABLE table_66645 ("Tie no" CLOB, "Home team" CLOB, "Score" CLOB, "Away team" CLOB, "Attendance" CLOB)
| What was the score for the game with a tie no of 1? | SELECT "Score" FROM table_66645 WHERE "Tie no" = '1' | SELECT "Score" FROM "table_66645" WHERE "Tie no" = '1' | 0.052734 |
CREATE TABLE table_name_56 (high_points VARCHAR2, location_attendance VARCHAR2)
| What is High Points, when Location Attendance is Staples Center 18,964? | SELECT high_points FROM table_name_56 WHERE location_attendance = "staples center 18,964" | SELECT "high_points" FROM "table_name_56" WHERE "location_attendance" = "staples center 18,964" | 0.092773 |
CREATE TABLE table_name_66 (opponent VARCHAR2, score VARCHAR2)
| Who did the Toronto Blue Jays play against where the score was 4 - 2? | SELECT opponent FROM table_name_66 WHERE score = "4 - 2" | SELECT "opponent" FROM "table_name_66" WHERE "4 - 2" = "score" | 0.060547 |
CREATE TABLE table_203_33 (id NUMBER, "conference" CLOB, "date" CLOB, "place" CLOB, "attendance" NUMBER, "archive of presentations" CLOB)
| how many days was the wikimania 2011 ? | SELECT "date" - "date" FROM table_203_33 WHERE "conference" = 'wikimania 2011' | SELECT "date" - "date" FROM "table_203_33" WHERE "conference" = 'wikimania 2011' | 0.078125 |
CREATE TABLE table_27358 ("Pick #" FLOAT, "NFL Team" CLOB, "Player" CLOB, "Position" CLOB, "College" CLOB)
| What NFL Team has the player Danny Triplett with the position linebacker? | SELECT "NFL Team" FROM table_27358 WHERE "Position" = 'Linebacker' AND "Player" = 'Danny Triplett' | SELECT "NFL Team" FROM "table_27358" WHERE "Player" = 'Danny Triplett' AND "Position" = 'Linebacker' | 0.097656 |
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)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| how many patients diagnosed with short title accid in resident instit have delta lab test abnormal status? | 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.short_title = "Accid in resident instit" AND lab.flag = "delta" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Accid in resident instit" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "lab" ON "delta" = "lab"."flag" AND "demographic"."hadm_id" = "lab"."hadm_id" | 0.271484 |
CREATE TABLE table_7874 ("Rank" CLOB, "Player" CLOB, "Lifespan" CLOB, "Country" CLOB, "Wins" FLOAT, "Winning span" CLOB)
| Which Country has a Player of arjun atwal? | SELECT "Country" FROM table_7874 WHERE "Player" = 'arjun atwal' | SELECT "Country" FROM "table_7874" WHERE "Player" = 'arjun atwal' | 0.063477 |
CREATE TABLE table_59860 ("Team" CLOB, "Average" FLOAT, "Points" FLOAT, "Played" FLOAT, "1991-92" CLOB, "1992-93" CLOB, "1993-94" FLOAT)
| Which 1992-93 has Played of 114, and a 1991-92 of 48? | SELECT "1992-93" FROM table_59860 WHERE "Played" = '114' AND "1991-92" = '48' | SELECT "1992-93" FROM "table_59860" WHERE "1991-92" = '48' AND "Played" = '114' | 0.077148 |
CREATE TABLE competition_result (Competition_ID NUMBER, Club_ID_1 NUMBER, Club_ID_2 NUMBER, Score CLOB)
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 player (Player_ID NUMBER, name CLOB, Position CLOB, Club_ID NUMBER, Apps FLOAT, Tries FLOAT, Goals CLOB, Points FLOAT)
| For each position, what is the average number of points for players in that position Plot them as bar chart, could you show y axis from low to high order? | SELECT Position, AVG(Points) FROM player GROUP BY Position ORDER BY AVG(Points) | SELECT "Position", AVG("Points") FROM "player" GROUP BY "Position" ORDER BY AVG("Points") | 0.086914 |
CREATE TABLE table_12834315_5 (hand_guards VARCHAR2, name VARCHAR2)
| What hand guard system is used with a gas piston commando? | SELECT hand_guards FROM table_12834315_5 WHERE name = "Gas Piston Commando" | SELECT "hand_guards" FROM "table_12834315_5" WHERE "Gas Piston Commando" = "name" | 0.079102 |
CREATE TABLE ref_colors (color_code VARCHAR2, color_description VARCHAR2)
CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR2, characteristic_name VARCHAR2)
CREATE TABLE products (product_id VARCHAR2, color_code VARCHAR2)
CREATE TABLE product_characteristics (product_id VARCHAR2, characteristic_id VARCHAR2)
| Count the products that have the color description 'white' or have the characteristic name 'hot'. | SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "white" OR t3.characteristic_name = "hot" | SELECT COUNT(*) FROM "products" "t1" JOIN "product_characteristics" "t2" ON "t1"."product_id" = "t2"."product_id" JOIN "CHARACTERISTICS" "t3" ON "t2"."characteristic_id" = "t3"."characteristic_id" JOIN "ref_colors" "t4" ON ("hot" = "t3"."characteristic_name" OR "t4"."color_description" = "white") AND "t1"."color_code" = "t4"."color_code" | 0.331055 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.