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 Manufacturers (Code NUMBER, Name VARCHAR2, Headquarter VARCHAR2, Founder VARCHAR2, Revenue FLOAT) CREATE TABLE Products (Code NUMBER, Name VARCHAR2, Price NUMBER, Manufacturer NUMBER)
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and manufacturer , and group by attribute headquarter, and show X-axis in desc order.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, 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 "Headquarter", "T1"."Name" ORDER BY "T1"."Name" DESC
0.180664
CREATE TABLE table_203_835 (id NUMBER, "season" CLOB, "club" CLOB, "country" CLOB, "competition" CLOB, "apps." NUMBER, "goals" NUMBER)
for 1 fc saabrucken how often did he have less than 20 appearances ?
SELECT COUNT(*) FROM table_203_835 WHERE "club" = '1. fc saarbrucken' AND "apps." < 20
SELECT COUNT(*) FROM "table_203_835" WHERE "apps." < 20 AND "club" = '1. fc saarbrucken'
0.085938
CREATE TABLE table_204_721 (id NUMBER, "rank" NUMBER, "wrestler" CLOB, "no. of reigns" NUMBER, "combined\ defenses" NUMBER, "combined\ days" NUMBER)
how many reigns has joey ryan had ?
SELECT "no. of reigns" FROM table_204_721 WHERE "wrestler" = 'joey ryan'
SELECT "no. of reigns" FROM "table_204_721" WHERE "wrestler" = 'joey ryan'
0.072266
CREATE TABLE table_26267849_11 (percentage_of_votes VARCHAR2, finished VARCHAR2)
Name the percentage of votes for 3rd finished
SELECT percentage_of_votes FROM table_26267849_11 WHERE finished = "3rd"
SELECT "percentage_of_votes" FROM "table_26267849_11" WHERE "3rd" = "finished"
0.076172
CREATE TABLE table_name_3 (qualifying_goals NUMBER, player VARCHAR2, finals_goals VARCHAR2)
What is the Average Qualifying Goals for Jack Froggatt where the Final Goals is greater than 0?
SELECT AVG(qualifying_goals) FROM table_name_3 WHERE player = "jack froggatt" AND finals_goals > 0
SELECT AVG("qualifying_goals") FROM "table_name_3" WHERE "finals_goals" > 0 AND "jack froggatt" = "player"
0.103516
CREATE TABLE table_name_17 (mark VARCHAR2, athlete VARCHAR2)
Which Mark has an Athlete of heike drechsler?
SELECT mark FROM table_name_17 WHERE athlete = "heike drechsler"
SELECT "mark" FROM "table_name_17" WHERE "athlete" = "heike drechsler"
0.068359
CREATE TABLE table_name_91 (tournament VARCHAR2)
What is 2008, when 2009 is 'A', and when Tournament is 'Madrid Masters'?
SELECT 2008 FROM table_name_91 WHERE 2009 = "a" AND tournament = "madrid masters"
SELECT 2008 FROM "table_name_91" WHERE "a" = 2009 AND "madrid masters" = "tournament"
0.083008
CREATE TABLE table_21103 ("Name" CLOB, "Latitude" CLOB, "Longitude" CLOB, "Diameter ( km ) " CLOB, "Year named" FLOAT, "Name origin" CLOB)
How many years have a longitude measure of 20.0e?
SELECT COUNT("Year named") FROM table_21103 WHERE "Longitude" = '20.0E'
SELECT COUNT("Year named") FROM "table_21103" WHERE "Longitude" = '20.0E'
0.071289
CREATE TABLE table_name_65 (frequency VARCHAR2, website VARCHAR2)
what is the frequency of visits to elmanana.com.mx
SELECT frequency FROM table_name_65 WHERE website = "elmanana.com.mx"
SELECT "frequency" FROM "table_name_65" WHERE "elmanana.com.mx" = "website"
0.073242
CREATE TABLE table_name_9 (school_year VARCHAR2, volleyball VARCHAR2, cross_country VARCHAR2, soccer VARCHAR2)
What is School Year, when Cross Country is Lexington, when Soccer is Ashland, and when Volleyball is Wooster?
SELECT school_year FROM table_name_9 WHERE cross_country = "lexington" AND soccer = "ashland" AND volleyball = "wooster"
SELECT "school_year" FROM "table_name_9" WHERE "ashland" = "soccer" AND "cross_country" = "lexington" AND "volleyball" = "wooster"
0.126953
CREATE TABLE table_12591022_2 (program VARCHAR2, duration__years_ VARCHAR2, teaching_language VARCHAR2)
WHat is the program where duration (years) is 1.5 and teaching language is german/english?
SELECT program FROM table_12591022_2 WHERE duration__years_ = "1.5" AND teaching_language = "German/English"
SELECT "program" FROM "table_12591022_2" WHERE "1.5" = "duration__years_" AND "German/English" = "teaching_language"
0.113281
CREATE TABLE table_204_913 (id NUMBER, "#" NUMBER, "date" CLOB, "venue" CLOB, "opponent" CLOB, "score" CLOB, "result" CLOB, "competition" CLOB)
what is the top listed venue in the table ?
SELECT "venue" FROM table_204_913 WHERE id = 1
SELECT "venue" FROM "table_204_913" WHERE "id" = 1
0.048828
CREATE TABLE table_19659 ("Year" FLOAT, "Mens Singles" CLOB, "Womens Singles" CLOB, "Men Doubles" CLOB, "Womens Doubles" CLOB, "Mixed Doubles" CLOB)
Name the men doubles for els baert
SELECT "Men Doubles" FROM table_19659 WHERE "Womens Singles" = 'Els Baert'
SELECT "Men Doubles" FROM "table_19659" WHERE "Womens Singles" = 'Els Baert'
0.074219
CREATE TABLE table_name_92 (name VARCHAR2, transfer_fee VARCHAR2)
What player costs 210k to transfer?
SELECT name FROM table_name_92 WHERE transfer_fee = "£210k"
SELECT "name" FROM "table_name_92" WHERE "transfer_fee" = "£210k"
0.063477
CREATE TABLE table_23950 ("City ( Utility ) " CLOB, "Residential Monthly usage: 1000 kWh" CLOB, "Small power Power demand: 40 kW; Consumption 10 , 000 kWh , load factor: 35%." CLOB, "Medium power Power demand: 1 , 000 kW; Consumption: 400 , 000 kWh , load factor: 56 %." CLOB, "Large power Power demand: 50 , 000 kW; Consumption: 30 , 600 , 000 kWh , load factor: 85%." CLOB)
What is every city with a residential monthly usage of 11.80?
SELECT "City (Utility)" FROM table_23950 WHERE "Residential Monthly usage: 1000 kWh" = '11.80'
SELECT "City (Utility)" FROM "table_23950" WHERE "Residential Monthly usage: 1000 kWh" = '11.80'
0.09375
CREATE TABLE company (Company_ID NUMBER, Rank NUMBER, Company CLOB, Headquarters CLOB, Main_Industry CLOB, Sales_billion FLOAT, Profits_billion FLOAT, Assets_billion FLOAT, Market_Value FLOAT) CREATE TABLE station_company (Station_ID NUMBER, Company_ID NUMBER, Rank_of_the_Year NUMBER) CREATE TABLE gas_station (Station_ID NUMBER, Open_Year NUMBER, Location CLOB, Manager_Name CLOB, Vice_Manager_Name CLOB, Representative_Name CLOB)
A bar chart about what are the main indstries and total market value for each industry?, I want to order sum market value in asc order.
SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY SUM(Market_Value)
SELECT "Main_Industry", SUM("Market_Value") FROM "company" GROUP BY "Main_Industry" ORDER BY SUM("Market_Value")
0.109375
CREATE TABLE table_3211 ("Region" CLOB, "HDI" CLOB, "Life expectancy at birth ( 2001-2002 ) " CLOB, "Adult literacy rate ( 2009 ) " CLOB, "Combined gross enrollment ratio ( 2009 ) " CLOB, "GDP ( PPP ) per capita ( 2008 ) " FLOAT)
What is the gdp per capita in 2008 for the region that had a combined gross enrollment ration of 89.0?
SELECT MIN("GDP (PPP) per capita (2008)") FROM table_3211 WHERE "Combined gross enrollment ratio (2009)" = '89.0'
SELECT MIN("GDP (PPP) per capita (2008)") FROM "table_3211" WHERE "Combined gross enrollment ratio (2009)" = '89.0'
0.112305
CREATE TABLE table_203_507 (id NUMBER, "#" CLOB, "player" CLOB, "\\u03c3 points" NUMBER, "qual." NUMBER, "final" NUMBER)
how many players had final scores higher than 5 ?
SELECT COUNT("player") FROM table_203_507 WHERE "final" > 5
SELECT COUNT("player") FROM "table_203_507" WHERE "final" > 5
0.05957
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 PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER) CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB) CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB) CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER) CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER) CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER) CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description 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 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 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 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 TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME) CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME) 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 PostTags (PostId NUMBER, TagId NUMBER) CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER) CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB) CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN) CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB) CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER) CREATE TABLE VoteTypes (Id NUMBER, Name 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 ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
accept answer under question with accepted answer.
SELECT c.Id, c.Id AS "comment_link", c.CreationDate FROM Comments AS c INNER JOIN Posts AS q ON q.Id = c.PostId AND q.PostTypeId = 1 AND LENGTH(c.Text) <= 75 AND LOWER(c.Text) LIKE '%forget%accept%' ORDER BY c.CreationDate DESC
SELECT "c"."Id", "c"."Id" AS "comment_link", "c"."CreationDate" FROM "Comments" "c" JOIN "Posts" "q" ON "c"."PostId" = "q"."Id" AND "q"."PostTypeId" = 1 AND LENGTH("c"."Text") <= 75 AND LOWER("c"."Text") LIKE '%forget%accept%' ORDER BY "c"."CreationDate" DESC
0.25293
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE 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_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label 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 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_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
what is the minimum cost of a hospital bill that includes a drug called loperamide hcl in 2101?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'loperamide hcl') AND STRFTIME('%y', cost.chargetime) = '2101' GROUP BY cost.hadm_id) AS t1
WITH "_u_0" AS (SELECT "prescriptions"."hadm_id" FROM "prescriptions" WHERE "prescriptions"."drug" = 'loperamide hcl' GROUP BY "hadm_id"), "t1" AS (SELECT SUM("cost"."cost") AS "c1" FROM "cost" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "cost"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND STRFTIME('%y', "cost"."chargetime") = '2101' GROUP BY "cost"."hadm_id") SELECT MIN("t1"."c1") FROM "t1" "t1"
0.380859
CREATE TABLE table_36482 ("Date" CLOB, "Tournament" CLOB, "Surface" CLOB, "Opponent in the final" CLOB, "Score" CLOB)
What surface did Smeets play on during the Kuwait tournament?
SELECT "Surface" FROM table_36482 WHERE "Tournament" = 'kuwait'
SELECT "Surface" FROM "table_36482" WHERE "Tournament" = 'kuwait'
0.063477
CREATE TABLE table_28996 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "U.S. viewers ( in millions ) " CLOB)
What is every original air date for the number in season of 7?
SELECT "Original air date" FROM table_28996 WHERE "No. in season" = '7'
SELECT "Original air date" FROM "table_28996" WHERE "No. in season" = '7'
0.071289
CREATE TABLE table_1180228_1 (released VARCHAR2, dvd_name VARCHAR2)
How many releases did the DVD River Cottage forever have?
SELECT COUNT(released) FROM table_1180228_1 WHERE dvd_name = "River Cottage Forever"
SELECT COUNT("released") FROM "table_1180228_1" WHERE "River Cottage Forever" = "dvd_name"
0.087891
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) 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 d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE 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 outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) 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 labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label 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 d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE 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)
how many patients have been discharged from hospital until 2 years ago.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime) <= DATETIME(CURRENT_TIME(), '-2 year')
SELECT COUNT(DISTINCT "admissions"."subject_id") FROM "admissions" WHERE DATETIME("admissions"."dischtime") <= DATETIME(CURRENT_TIME(), '-2 year') AND NOT "admissions"."dischtime" IS NULL
0.182617
CREATE TABLE table_name_67 (engine VARCHAR2, torque VARCHAR2)
Which engine has a torgue of lb ft (n m)?
SELECT engine FROM table_name_67 WHERE torque = "lb·ft (n·m)"
SELECT "engine" FROM "table_name_67" WHERE "lb·ft (n·m)" = "torque"
0.06543
CREATE TABLE table_204_503 (id NUMBER, "year" NUMBER, "competition" CLOB, "venue" CLOB, "position" CLOB, "notes" CLOB)
how many times did imma clopes compete ?
SELECT COUNT(*) FROM table_204_503
SELECT COUNT(*) FROM "table_204_503"
0.035156
CREATE TABLE table_8906 ("Week" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Stadium" CLOB, "Record" CLOB, "Attendance" CLOB)
What was the Week on December 17?
SELECT MIN("Week") FROM table_8906 WHERE "Date" = 'december 17'
SELECT MIN("Week") FROM "table_8906" WHERE "Date" = 'december 17'
0.063477
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
what is minimum age of patients whose marital status is married and admission type is elective?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admission_type = "ELECTIVE"
SELECT MIN("demographic"."age") FROM "demographic" WHERE "ELECTIVE" = "demographic"."admission_type" AND "MARRIED" = "demographic"."marital_status"
0.143555
CREATE TABLE table_16278349_1 (un_region VARCHAR2, population VARCHAR2)
Name the un region for 378000 population
SELECT un_region FROM table_16278349_1 WHERE population = 378000
SELECT "un_region" FROM "table_16278349_1" WHERE "population" = 378000
0.068359
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 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 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 whose drug code is metr500pm and lab test fluid is ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "METR500PM" AND lab.fluid = "Ascites"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Ascites" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" JOIN "prescriptions" ON "METR500PM" = "prescriptions"."formulary_drug_cd" AND "demographic"."hadm_id" = "prescriptions"."hadm_id"
0.277344
CREATE TABLE table_name_75 (drawn VARCHAR2, goals_against VARCHAR2, lost VARCHAR2)
What is the total number drawn with goals against less than 55, and a total of 14 losses?
SELECT COUNT(drawn) FROM table_name_75 WHERE goals_against < 55 AND lost = 14
SELECT COUNT("drawn") FROM "table_name_75" WHERE "goals_against" < 55 AND "lost" = 14
0.083008
CREATE TABLE table_10236830_6 (actors_name VARCHAR2, film_name VARCHAR2, nomination VARCHAR2)
What is the name of the actress that was nominated for best actress in a leading role in the film Chopin: Desire for love?
SELECT actors_name FROM table_10236830_6 WHERE film_name = "Chopin: Desire for Love" AND nomination = "Best Actress in a Leading Role"
SELECT "actors_name" FROM "table_10236830_6" WHERE "Best Actress in a Leading Role" = "nomination" AND "Chopin: Desire for Love" = "film_name"
0.138672
CREATE TABLE table_2241841_1 (team VARCHAR2, race_time VARCHAR2)
What team set a 3:15:43 winning time?
SELECT team FROM table_2241841_1 WHERE race_time = "3:15:43"
SELECT "team" FROM "table_2241841_1" WHERE "3:15:43" = "race_time"
0.064453
CREATE TABLE party (Party_ID NUMBER, Year FLOAT, Party CLOB, Governor CLOB, Lieutenant_Governor CLOB, Comptroller CLOB, Attorney_General CLOB, US_Senate CLOB) CREATE TABLE county (County_Id NUMBER, County_name CLOB, Population FLOAT, Zip_code CLOB) CREATE TABLE election (Election_ID NUMBER, Counties_Represented CLOB, District NUMBER, Delegate CLOB, Party NUMBER, First_Elected FLOAT, Committee CLOB)
For each party, return the name of the party and the number of delegates from that party Plot them as bar chart, and rank in asc by the Y.
SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY SUM(COUNT(*))
SELECT "T2"."Party", SUM(COUNT(*)) FROM "election" "T1" JOIN "party" "T2" ON "T1"."Party" = "T2"."Party_ID" GROUP BY "T2"."Party" ORDER BY SUM(COUNT(*))
0.148438
CREATE TABLE table_204_784 (id NUMBER, "player" CLOB, "league" NUMBER, "cup" NUMBER, "europa league" NUMBER, "total" NUMBER)
who was the top goalscorer on this team ?
SELECT "player" FROM table_204_784 WHERE id = 1
SELECT "player" FROM "table_204_784" WHERE "id" = 1
0.049805
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
give me the number of patients whose age is less than 43 and lab test fluid is cerebrospinal fluid (csf)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "43" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Cerebrospinal Fluid (CSF)" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "43" > "demographic"."age"
0.200195
CREATE TABLE match_season (Name VARCHAR2, Team_id VARCHAR2, Team VARCHAR2) CREATE TABLE team (Name VARCHAR2, Team_id VARCHAR2, Team VARCHAR2)
What are the names of teams that do no have match season record?
SELECT Name FROM team WHERE NOT Team_id IN (SELECT Team FROM match_season)
SELECT "Name" FROM "team" WHERE NOT "Team_id" IN (SELECT "Team" FROM "match_season")
0.082031
CREATE TABLE table_name_50 (league_goals VARCHAR2, league_apps VARCHAR2, fa_cup_goals VARCHAR2, fa_cup_apps VARCHAR2)
what is the league goals when the fa cup goals is higher than 0, the fa cup apps is 2 and the league apps is 45?
SELECT league_goals FROM table_name_50 WHERE fa_cup_goals > 0 AND fa_cup_apps = "2" AND league_apps = "45"
SELECT "league_goals" FROM "table_name_50" WHERE "2" = "fa_cup_apps" AND "45" = "league_apps" AND "fa_cup_goals" > 0
0.113281
CREATE TABLE table_name_26 (round NUMBER, player VARCHAR2)
What is recorded as the lowest Round for the Player Jim Thompson?
SELECT MIN(round) FROM table_name_26 WHERE player = "jim thompson"
SELECT MIN("round") FROM "table_name_26" WHERE "jim thompson" = "player"
0.070313
CREATE TABLE election (Election_ID NUMBER, Representative_ID NUMBER, Date CLOB, Votes FLOAT, Vote_Percent FLOAT, Seats FLOAT, Place FLOAT) CREATE TABLE representative (Representative_ID NUMBER, Name CLOB, State CLOB, Party CLOB, Lifespan CLOB)
List the dates and vote percents of elections Show bar chart, show by the Y from low to high.
SELECT Date, Vote_Percent FROM election ORDER BY Vote_Percent
SELECT "Date", "Vote_Percent" FROM "election" ORDER BY "Vote_Percent"
0.067383
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 gsi (course_offering_id NUMBER, student_id NUMBER) 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 offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER) CREATE TABLE area (course_id NUMBER, area VARCHAR2) CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2) CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2) CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2) CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2) CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2) CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2) CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER) 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 jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER) CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER) CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2) CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2) CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
What classes involve Special Naval Architecture and Marine Engineering and Orthodontics Practice Management and Transitions ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Orthodontics Practice Management and Transitions%' OR course.description LIKE '%Orthodontics Practice Management and Transitions%' OR course.name LIKE '%Orthodontics Practice Management and Transitions%') AND (area.area LIKE '%Special Naval Architecture and Marine Engineering%' OR course.description LIKE '%Special Naval Architecture and Marine Engineering%' OR course.name LIKE '%Special Naval Architecture and Marine Engineering%')
SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "area" ON ("area"."area" LIKE '%Orthodontics Practice Management and Transitions%' OR "course"."description" LIKE '%Orthodontics Practice Management and Transitions%' OR "course"."name" LIKE '%Orthodontics Practice Management and Transitions%') AND ("area"."area" LIKE '%Special Naval Architecture and Marine Engineering%' OR "course"."description" LIKE '%Special Naval Architecture and Marine Engineering%' OR "course"."name" LIKE '%Special Naval Architecture and Marine Engineering%') AND "area"."course_id" = "course"."course_id"
0.610352
CREATE TABLE table_1326 ("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 location and what is the attendance of game 38?
SELECT "Location Attendance" FROM table_1326 WHERE "Game" = '38'
SELECT "Location Attendance" FROM "table_1326" WHERE "Game" = '38'
0.064453
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 medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
what are the numbers of patients who have had a arteriovenous shunt for renal dialysis two or more times until 2104?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'arteriovenous shunt for renal dialysis' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') GROUP BY patient.uniquepid) AS t1 WHERE t1.c1 >= 2
WITH "t1" AS (SELECT "patient"."uniquepid", COUNT(*) AS "c1" FROM "patient" JOIN "treatment" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" AND "treatment"."treatmentname" = 'arteriovenous shunt for renal dialysis' AND STRFTIME('%y', "treatment"."treatmenttime") <= '2104' GROUP BY "patient"."uniquepid") SELECT COUNT(DISTINCT "t1"."uniquepid") FROM "t1" "t1" WHERE "t1"."c1" >= 2
0.390625
CREATE TABLE table_73766 ("Rank" FLOAT, "Rank w/o Hydropower" FLOAT, "State" CLOB, "% Renewable" CLOB, "% Renewable w/o Hydro" CLOB, "Renewable electricity ( GW\\u2022h ) " FLOAT, "Renewable electricity w/o Hydro ( GW\\u2022h ) " FLOAT, "Total electricity ( GW\\u2022h ) " FLOAT)
Which state has 5179 (gw h) of renewable energy without hydrogen power?wha
SELECT "State" FROM table_73766 WHERE "Renewable electricity w/o Hydro (GW\u2022h)" = '5179'
SELECT "State" FROM "table_73766" WHERE "Renewable electricity w/o Hydro (GW\u2022h)" = '5179'
0.091797
CREATE TABLE table_25663 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "Prod. code" CLOB, "Viewers ( millions ) " CLOB)
what is the name of the episode when the number of spectators was 5.60 millions?
SELECT "Title" FROM table_25663 WHERE "Viewers (millions)" = '5.60'
SELECT "Title" FROM "table_25663" WHERE "Viewers (millions)" = '5.60'
0.067383
CREATE TABLE table_29514 ("Year" CLOB, "Summits" CLOB, "Country" CLOB, "Continent" CLOB, "Elevation ft" FLOAT, "Elevation m" FLOAT)
what is the continent in which the country russia is listed?
SELECT "Continent" FROM table_29514 WHERE "Country" = 'Russia'
SELECT "Continent" FROM "table_29514" WHERE "Country" = 'Russia'
0.0625
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
what is days of hospital stay and admission time of subject name herlinda thomson?
SELECT demographic.days_stay, demographic.admittime FROM demographic WHERE demographic.name = "Herlinda Thomson"
SELECT "demographic"."days_stay", "demographic"."admittime" FROM "demographic" WHERE "Herlinda Thomson" = "demographic"."name"
0.123047
CREATE TABLE table_63955 ("Wimmera FL" CLOB, "Wins" FLOAT, "Byes" FLOAT, "Losses" FLOAT, "Draws" FLOAT, "Against" FLOAT)
What is the total number of byes with more than 0 losses and 1526 against?
SELECT COUNT("Byes") FROM table_63955 WHERE "Losses" > '0' AND "Against" = '1526'
SELECT COUNT("Byes") FROM "table_63955" WHERE "Against" = '1526' AND "Losses" > '0'
0.081055
CREATE TABLE table_74356 ("Series #" FLOAT, "Season #" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "Prod. code" FLOAT, "U.S. viewers ( millions ) " CLOB)
What number episode in the season had a production code of 334?
SELECT MAX("Season #") FROM table_74356 WHERE "Prod. code" = '334'
SELECT MAX("Season #") FROM "table_74356" WHERE "Prod. code" = '334'
0.066406
CREATE TABLE table_59487 ("Opposing Teams" CLOB, "Against" FLOAT, "Date" CLOB, "Venue" CLOB, "Status" CLOB)
Which venue was the opposing team New Zealand on 22/11/1997?
SELECT "Venue" FROM table_59487 WHERE "Opposing Teams" = 'new zealand' AND "Date" = '22/11/1997'
SELECT "Venue" FROM "table_59487" WHERE "Date" = '22/11/1997' AND "Opposing Teams" = 'new zealand'
0.095703
CREATE TABLE table_16751596_16 (republican VARCHAR2, lead_margin VARCHAR2)
How many times did Saxby Chambliss have a lead margin of 21?
SELECT COUNT(republican) AS :_saxby_chambliss FROM table_16751596_16 WHERE lead_margin = 21
SELECT COUNT("republican") AS :_saxby_chambliss FROM "table_16751596_16" WHERE "lead_margin" = 21
0.094727
CREATE TABLE area (course_id NUMBER, area VARCHAR2) CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location 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_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 semester (semester_id NUMBER, semester VARCHAR2, year NUMBER) CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction 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 requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2) CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER) CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2) CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER) CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname 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 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 gsi (course_offering_id NUMBER, student_id NUMBER) CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER) CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
In Summer , name the classes that are available that count towards CS major .
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE program_course.course_id = course.course_id AND program_course.course_id = course.course_id AND program.name LIKE '%CS%' AND program.program_id = program_course.program_id AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2016
SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" CROSS JOIN "course_offering" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'Summer' AND "semester"."year" = 2016 JOIN "program" ON "program"."name" LIKE '%CS%' AND "program"."program_id" = "program_course"."program_id"
0.429688
CREATE TABLE table_42589 ("Average population ( x 1 , 000 ) " CLOB, "Live births" CLOB, "Deaths" CLOB, "Natural change" CLOB, "Migration" CLOB, "Crude birth rate ( per 1 , 000 ) " FLOAT, "Crude death rate ( per 1 , 000 ) " FLOAT, "Natural change ( per 1 , 000 ) " FLOAT, "Migration ( per 1 , 000 ) " FLOAT)
What kind of Live births has a Migration of -14 873?
SELECT "Live births" FROM table_42589 WHERE "Migration" = '-14 873'
SELECT "Live births" FROM "table_42589" WHERE "Migration" = '-14 873'
0.067383
CREATE TABLE table_name_19 (opponent VARCHAR2, record VARCHAR2)
Name the opponent with record of 6-2
SELECT opponent FROM table_name_19 WHERE record = "6-2"
SELECT "opponent" FROM "table_name_19" WHERE "6-2" = "record"
0.05957
CREATE TABLE table_name_45 (goals VARCHAR2, points VARCHAR2)
How many goals were scored when 158 points were collected?
SELECT goals FROM table_name_45 WHERE points = "158"
SELECT "goals" FROM "table_name_45" WHERE "158" = "points"
0.056641
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 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 diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
how many patients whose gender is f and admission year is less than 2200?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admityear < "2200"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2200" > "demographic"."admityear" AND "F" = "demographic"."gender"
0.138672
CREATE TABLE table_name_9 (opponent VARCHAR2, round VARCHAR2)
Who was the opponent at the qf(r) round?
SELECT opponent FROM table_name_9 WHERE round = "qf(r)"
SELECT "opponent" FROM "table_name_9" WHERE "qf(r)" = "round"
0.05957
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
provide the number of patients whose diagnoses short title is convulsions nec and lab test fluid is cerebrospinal fluid (csf)?
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 = "Convulsions NEC" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Convulsions NEC" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "lab" ON "Cerebrospinal Fluid (CSF)" = "lab"."fluid" AND "demographic"."hadm_id" = "lab"."hadm_id"
0.283203
CREATE TABLE Grants (grant_id NUMBER, organisation_id NUMBER, grant_amount NUMBER, grant_start_date DATETIME, grant_end_date DATETIME, other_details VARCHAR2) CREATE TABLE Project_Staff (staff_id DOUBLE PRECISION, project_id NUMBER, role_code VARCHAR2, date_from DATETIME, date_to DATETIME, other_details VARCHAR2) CREATE TABLE Tasks (task_id NUMBER, project_id NUMBER, task_details VARCHAR2, "eg Agree Objectives" VARCHAR2) CREATE TABLE Research_Outcomes (outcome_code VARCHAR2, outcome_description VARCHAR2) CREATE TABLE Projects (project_id NUMBER, organisation_id NUMBER, project_details VARCHAR2) CREATE TABLE Staff_Roles (role_code VARCHAR2, role_description VARCHAR2) CREATE TABLE Organisations (organisation_id NUMBER, organisation_type VARCHAR2, organisation_details VARCHAR2) CREATE TABLE Document_Types (document_type_code VARCHAR2, document_description VARCHAR2) CREATE TABLE Organisation_Types (organisation_type VARCHAR2, organisation_type_description VARCHAR2) CREATE TABLE Documents (document_id NUMBER, document_type_code VARCHAR2, grant_id NUMBER, sent_date DATETIME, response_received_date DATETIME, other_details VARCHAR2) CREATE TABLE Project_Outcomes (project_id NUMBER, outcome_code VARCHAR2, outcome_details VARCHAR2) CREATE TABLE Research_Staff (staff_id NUMBER, employer_organisation_id NUMBER, staff_details VARCHAR2)
List the description of the outcomes for all projects, and count them by a bar chart, rank bars from low to high order.
SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_description ORDER BY outcome_description
SELECT "outcome_description", COUNT("outcome_description") FROM "Research_Outcomes" "T1" JOIN "Project_Outcomes" "T2" ON "T1"."outcome_code" = "T2"."outcome_code" GROUP BY "outcome_description" ORDER BY "outcome_description"
0.21875
CREATE TABLE table_name_97 (rank NUMBER, city VARCHAR2)
What is teh average rank of the city of mashhad, which had less than 667770 in 1976?
SELECT AVG(rank) FROM table_name_97 WHERE city = "mashhad" AND 1976 < 667770
SELECT AVG("rank") FROM "table_name_97" WHERE "city" = "mashhad"
0.0625
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB) CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
what is the total numbr of patients who had procedure icd9 code 3799?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "3799"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "3799" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id"
0.171875
CREATE TABLE table_32869 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
What was the away team when the home team scored 10.10 (70)?
SELECT "Away team" FROM table_32869 WHERE "Home team score" = '10.10 (70)'
SELECT "Away team" FROM "table_32869" WHERE "Home team score" = '10.10 (70)'
0.074219
CREATE TABLE table_name_90 (played NUMBER, goals_against VARCHAR2, position VARCHAR2, draws VARCHAR2)
Can you tell me the lowest Played that has the Position larger than 2, and the Draws smaller than 2, and the Goals against smaller than 18?
SELECT MIN(played) FROM table_name_90 WHERE position > 2 AND draws < 2 AND goals_against < 18
SELECT MIN("played") FROM "table_name_90" WHERE "draws" < 2 AND "goals_against" < 18 AND "position" > 2
0.100586
CREATE TABLE table_22941863_19 (mountains_classification VARCHAR2, winner VARCHAR2)
What is the mountain classification name if the winner is Bernhard Eisel?
SELECT mountains_classification FROM table_22941863_19 WHERE winner = "Bernhard Eisel"
SELECT "mountains_classification" FROM "table_22941863_19" WHERE "Bernhard Eisel" = "winner"
0.089844
CREATE TABLE table_name_17 (date VARCHAR2, set_2 VARCHAR2)
What is the date of the 21:12 Set 2?
SELECT date FROM table_name_17 WHERE set_2 = "21:12"
SELECT "date" FROM "table_name_17" WHERE "21:12" = "set_2"
0.056641
CREATE TABLE table_31050 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "Production code" CLOB)
How many episodes have the production code ip04004?
SELECT COUNT("Title") FROM table_31050 WHERE "Production code" = 'IP04004'
SELECT COUNT("Title") FROM "table_31050" WHERE "Production code" = 'IP04004'
0.074219
CREATE TABLE table_name_68 (method VARCHAR2, opponent VARCHAR2)
Which method had Travis Fulton as an opponent?
SELECT method FROM table_name_68 WHERE opponent = "travis fulton"
SELECT "method" FROM "table_name_68" WHERE "opponent" = "travis fulton"
0.069336
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
how many patients were prescribed enoxaparin within the same hospital visit after the diagnosis of splenic trauma - grade ii laceration,?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'splenic trauma - grade ii laceration') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'enoxaparin') AS t2 WHERE t1.diagnosistime < t2.drugstarttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid
WITH "t2" AS (SELECT "medication"."drugstarttime", "patient"."patienthealthsystemstayid" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" WHERE "medication"."drugname" = 'enoxaparin') SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" "t2" ON "diagnosis"."diagnosistime" < "t2"."drugstarttime" AND "patient"."patienthealthsystemstayid" = "t2"."patienthealthsystemstayid" WHERE "diagnosis"."diagnosisname" = 'splenic trauma - grade ii laceration'
0.585938
CREATE TABLE table_1087659_2 (division VARCHAR2, playoffs VARCHAR2)
What is the division for the division semifinals playoffs?
SELECT division FROM table_1087659_2 WHERE playoffs = "division Semifinals"
SELECT "division" FROM "table_1087659_2" WHERE "division Semifinals" = "playoffs"
0.079102
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 medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime 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 lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE 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)
had patient 008-10139 in this year been admitted to an emergency room?
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '008-10139' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
SELECT COUNT(*) > 0 FROM "patient" WHERE "patient"."hospitaladmitsource" = 'emergency department' AND "patient"."uniquepid" = '008-10139' AND DATETIME("patient"."unitadmittime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
0.243164
CREATE TABLE table_17941032_2 (played VARCHAR2, tries_for VARCHAR2)
How many times were there plays with a try of 56?
SELECT played FROM table_17941032_2 WHERE tries_for = "56"
SELECT "played" FROM "table_17941032_2" WHERE "56" = "tries_for"
0.0625
CREATE TABLE table_7602 ("Publication" CLOB, "Country" CLOB, "Accolade" CLOB, "Year" FLOAT, "Rank" FLOAT)
What is Accolade, when Year is less than 2009, and when Country is Germany?
SELECT "Accolade" FROM table_7602 WHERE "Year" < '2009' AND "Country" = 'germany'
SELECT "Accolade" FROM "table_7602" WHERE "Country" = 'germany' AND "Year" < '2009'
0.081055
CREATE TABLE table_name_8 (event VARCHAR2, venue VARCHAR2)
What tournement was held in Helsinki, Finland in 2005?
SELECT event FROM table_name_8 WHERE venue = "helsinki, finland"
SELECT "event" FROM "table_name_8" WHERE "helsinki, finland" = "venue"
0.068359
CREATE TABLE table_50750 ("2010 ARWU Rankings" CLOB, "2010 QS World Rankings" CLOB, "2010 QS Asian Rankings" CLOB, "2010 eduniversal Rankings" CLOB, "2009 QS Asian Rankings: Intpars_m_singlel faculty review" CLOB, "2009 QS Asian Rankings: Intpars_m_singlel student review" FLOAT, "2000 Singapore \\u201cAsiaweek\\u201d Rankings" CLOB, "University" CLOB, "Local" CLOB, "Median ranks" FLOAT)
Name the local that has the Int'l student review less than 320 and 2010 Eduniversal ranking of none.
SELECT "Local" FROM table_50750 WHERE "2010 eduniversal Rankings" = 'none' AND "2010 ARWU Rankings" = 'none' AND "2009 QS Asian Rankings: Int\u2019l student review" < '320'
SELECT "Local" FROM "table_50750" WHERE "2009 QS Asian Rankings: Int\u2019l student review" < '320' AND "2010 ARWU Rankings" = 'none' AND "2010 eduniversal Rankings" = 'none'
0.169922
CREATE TABLE table_39264 ("Date" CLOB, "Opponent" CLOB, "Score" CLOB, "Loss" CLOB, "Save" CLOB)
Who was the opponent on the September 3 game?
SELECT "Opponent" FROM table_39264 WHERE "Date" = 'september 3'
SELECT "Opponent" FROM "table_39264" WHERE "Date" = 'september 3'
0.063477
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 prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
how many self pay insurance patients have had blood lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "Blood"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Blood" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "Self Pay" = "demographic"."insurance"
0.192383
CREATE TABLE table_2383498_4 (team VARCHAR2, location VARCHAR2)
What is every team in the location of Port Moresby?
SELECT team FROM table_2383498_4 WHERE location = "Port Moresby"
SELECT "team" FROM "table_2383498_4" WHERE "Port Moresby" = "location"
0.068359
CREATE TABLE customer (acc_bal NUMBER, state VARCHAR2)
Find the total account balance of each customer from Utah or Texas.
SELECT SUM(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas'
SELECT SUM("acc_bal") FROM "customer" WHERE "state" = 'Texas' OR "state" = 'Utah'
0.079102
CREATE TABLE table_60001 ("Place" CLOB, "Player" CLOB, "Country" CLOB, "Score" CLOB, "To par" CLOB)
What's the score of the t10 player from australia?
SELECT "Score" FROM table_60001 WHERE "Place" = 't10' AND "Country" = 'australia'
SELECT "Score" FROM "table_60001" WHERE "Country" = 'australia' AND "Place" = 't10'
0.081055
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE 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 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)
count the number of patients that have had a stool microbiology test.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'stool')
WITH "_u_0" AS (SELECT "microlab"."patientunitstayid" FROM "microlab" WHERE "microlab"."culturesite" = 'stool' GROUP BY "patientunitstayid") SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL
0.290039
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) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
provide the number of patients whose ethnicity is american indian/alaska native?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "AMERICAN INDIAN/ALASKA NATIVE" = "demographic"."ethnicity"
0.130859
CREATE TABLE invoice_line_items (order_item_id NUMBER, invoice_number NUMBER, product_id NUMBER, product_title CLOB, product_quantity CLOB, product_price NUMBER, derived_product_cost NUMBER, derived_vat_payable NUMBER, derived_total_cost NUMBER) CREATE TABLE orders (order_id NUMBER, customer_id NUMBER, date_order_placed TIME, order_details CLOB) CREATE TABLE accounts (account_id NUMBER, customer_id NUMBER, date_account_opened TIME, account_name CLOB, other_account_details CLOB) CREATE TABLE order_items (order_item_id NUMBER, order_id NUMBER, product_id NUMBER, product_quantity CLOB, other_order_item_details CLOB) CREATE TABLE financial_transactions (transaction_id NUMBER, account_id NUMBER, invoice_number NUMBER, transaction_type CLOB, transaction_date TIME, transaction_amount NUMBER, transaction_comment CLOB, other_transaction_details CLOB) CREATE TABLE customers (customer_id NUMBER, customer_first_name CLOB, customer_middle_initial CLOB, customer_last_name CLOB, gender CLOB, email_address CLOB, login_name CLOB, login_password CLOB, phone_number CLOB, town_city CLOB, state_county_province CLOB, country CLOB) CREATE TABLE products (product_id NUMBER, parent_product_id NUMBER, production_type_code CLOB, unit_price NUMBER, product_name CLOB, product_color CLOB, product_size CLOB) CREATE TABLE invoices (invoice_number NUMBER, order_id NUMBER, invoice_date TIME) CREATE TABLE product_categories (production_type_code CLOB, product_type_description CLOB, vat_rating NUMBER)
Show the number of customers for each gender.
SELECT gender, COUNT(*) FROM customers GROUP BY gender
SELECT "gender", COUNT(*) FROM "customers" GROUP BY "gender"
0.058594
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)
Calculate the total number of patients with guillain barre syndrome as their primary disease who stayed at the hospital for more than 10 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.days_stay > "10"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "10" < "demographic"."days_stay" AND "GUILLAIN BARRE SYNDROME" = "demographic"."diagnosis"
0.161133
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 I want to list Y in desc 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 DESC
SELECT "T2"."Name", "T1"."Code" FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "T2"."Name" ORDER BY "T1"."Code" DESC
0.158203
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER) CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER) 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 countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER) CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER) CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, and sort x axis from low to high order.
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID
SELECT "JOB_ID", AVG("MANAGER_ID") FROM "employees" WHERE NOT "EMPLOYEE_ID" IN (SELECT "EMPLOYEE_ID" FROM "job_history") GROUP BY "JOB_ID" ORDER BY "JOB_ID"
0.152344
CREATE TABLE table_train_7 ("id" NUMBER, "bleeding" NUMBER, "hypotension" BOOLEAN, "burn_injury" NUMBER, "hypoperfusion" BOOLEAN, "hypertension" BOOLEAN, "age" FLOAT, "lactate" NUMBER, "NOUSE" FLOAT)
intracranial bleed or intracranial hypertension during this hospital admission
SELECT * FROM table_train_7 WHERE bleeding = 1 OR hypertension = 1
SELECT * FROM "table_train_7" WHERE "bleeding" = 1 OR "hypertension" = 1
0.070313
CREATE TABLE table_53454 ("Date" CLOB, "Visiting Team" CLOB, "Final Score" CLOB, "Host Team" CLOB, "Stadium" CLOB)
What is the stadium when the date of the game is December 14?
SELECT "Stadium" FROM table_53454 WHERE "Date" = 'december 14'
SELECT "Stadium" FROM "table_53454" WHERE "Date" = 'december 14'
0.0625
CREATE TABLE table_39940 ("singular" CLOB, "singular gender" CLOB, "plural" CLOB, "plural gender" CLOB, "meaning" CLOB)
What is the singular if the plural is xweer(a)du?
SELECT "singular" FROM table_39940 WHERE "plural" = 'xweer(a)du'
SELECT "singular" FROM "table_39940" WHERE "plural" = 'xweer(a)du'
0.064453
CREATE TABLE table_name_84 (location VARCHAR2, fatalities VARCHAR2)
What was the location of the accident that led to 50/50 fatalities?
SELECT location FROM table_name_84 WHERE fatalities = "50/50"
SELECT "location" FROM "table_name_84" WHERE "50/50" = "fatalities"
0.06543
CREATE TABLE table_61698 ("Goalkeeper" CLOB, "Goals" FLOAT, "Matches" FLOAT, "Average" FLOAT, "Team" CLOB)
What is the total of Matches with Goals of 18, and an Average larger than 0.55?
SELECT SUM("Matches") FROM table_61698 WHERE "Goals" = '18' AND "Average" > '0.55'
SELECT SUM("Matches") FROM "table_61698" WHERE "Average" > '0.55' AND "Goals" = '18'
0.082031
CREATE TABLE table_22546460_4 (best_male_mc VARCHAR2, best_male_lyricist VARCHAR2)
Who was the Best Male MC if Best Album won the Best Male Lyricist?
SELECT best_male_mc FROM table_22546460_4 WHERE best_male_lyricist = "Best Album"
SELECT "best_male_mc" FROM "table_22546460_4" WHERE "Best Album" = "best_male_lyricist"
0.084961
CREATE TABLE table_56425 ("Date" CLOB, "Tournament" CLOB, "Surface" CLOB, "Partnering" CLOB, "Opponents in the final" CLOB, "Score" CLOB)
Who were the opponents of the final on June 23, 2003?
SELECT "Opponents in the final" FROM table_56425 WHERE "Date" = 'june 23, 2003'
SELECT "Opponents in the final" FROM "table_56425" WHERE "Date" = 'june 23, 2003'
0.079102
CREATE TABLE manufacturers (founder VARCHAR2)
How many companies were created by Andy?
SELECT COUNT(*) FROM manufacturers WHERE founder = 'Andy'
SELECT COUNT(*) FROM "manufacturers" WHERE "founder" = 'Andy'
0.05957
CREATE TABLE financial_transactions (transaction_id NUMBER, account_id NUMBER, invoice_number NUMBER, transaction_type CLOB, transaction_date TIME, transaction_amount NUMBER, transaction_comment CLOB, other_transaction_details CLOB) CREATE TABLE accounts (account_id NUMBER, customer_id NUMBER, date_account_opened TIME, account_name CLOB, other_account_details CLOB) CREATE TABLE product_categories (production_type_code CLOB, product_type_description CLOB, vat_rating NUMBER) CREATE TABLE customers (customer_id NUMBER, customer_first_name CLOB, customer_middle_initial CLOB, customer_last_name CLOB, gender CLOB, email_address CLOB, login_name CLOB, login_password CLOB, phone_number CLOB, town_city CLOB, state_county_province CLOB, country CLOB) CREATE TABLE order_items (order_item_id NUMBER, order_id NUMBER, product_id NUMBER, product_quantity CLOB, other_order_item_details CLOB) CREATE TABLE invoices (invoice_number NUMBER, order_id NUMBER, invoice_date TIME) CREATE TABLE orders (order_id NUMBER, customer_id NUMBER, date_order_placed TIME, order_details CLOB) CREATE TABLE invoice_line_items (order_item_id NUMBER, invoice_number NUMBER, product_id NUMBER, product_title CLOB, product_quantity CLOB, product_price NUMBER, derived_product_cost NUMBER, derived_vat_payable NUMBER, derived_total_cost NUMBER) CREATE TABLE products (product_id NUMBER, parent_product_id NUMBER, production_type_code CLOB, unit_price NUMBER, product_name CLOB, product_color CLOB, product_size CLOB)
Show the id, the date of account opened, the account name, and other account detail for all accounts.
SELECT account_id, date_account_opened, account_name, other_account_details FROM accounts
SELECT "account_id", "date_account_opened", "account_name", "other_account_details" FROM "accounts"
0.09668
CREATE TABLE table_name_60 (venue VARCHAR2, competition VARCHAR2)
What venue has euro 2004 q. as the competition?
SELECT venue FROM table_name_60 WHERE competition = "euro 2004 q."
SELECT "venue" FROM "table_name_60" WHERE "competition" = "euro 2004 q."
0.070313
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE 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 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 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 allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
calculate patient 006-254232's duration of stay of the last stay in the icu.
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254232') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '006-254232' GROUP BY "patienthealthsystemstayid") SELECT STRFTIME('%j', "patient"."unitdischargetime") - STRFTIME('%j', "patient"."unitadmittime") FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL AND NOT "patient"."unitadmittime" IS NULL ORDER BY "patient"."unitadmittime" DESC FETCH FIRST 1 ROWS ONLY
0.467773
CREATE TABLE table_name_96 (surface VARCHAR2, opponent_in_the_final VARCHAR2)
Which Surface has an Opponent in the final of st phane robert?
SELECT surface FROM table_name_96 WHERE opponent_in_the_final = "stéphane robert"
SELECT "surface" FROM "table_name_96" WHERE "opponent_in_the_final" = "stéphane robert"
0.084961
CREATE TABLE table_name_23 (original_airdate VARCHAR2, identity_ies_ VARCHAR2)
Name the original airdate for mr. buckston
SELECT original_airdate FROM table_name_23 WHERE identity_ies_ = "mr. buckston"
SELECT "original_airdate" FROM "table_name_23" WHERE "identity_ies_" = "mr. buckston"
0.083008
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount 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 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 microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB) CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME) CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE procedures_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 outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
how many hours have passed since patient 83182 received his last platelet count lab test in their current hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83182 AND admissions.dischtime IS NULL) ORDER BY labevents.charttime DESC LIMIT 1
WITH "_u_0" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'platelet count' GROUP BY "itemid"), "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."dischtime" IS NULL AND "admissions"."subject_id" = 83182 GROUP BY "hadm_id") SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "labevents"."charttime")) FROM "labevents" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "labevents"."itemid" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "labevents"."hadm_id" WHERE NOT "_u_0"."" IS NULL AND NOT "_u_1"."" IS NULL ORDER BY "labevents"."charttime" DESC FETCH FIRST 1 ROWS ONLY
0.610352
CREATE TABLE table_552 ("English Title/Translation" CLOB, "Japanese Title" CLOB, "Developer" CLOB, "Publisher" CLOB, "Genre" CLOB, "Console ( s ) " CLOB, "Initial Release Date" CLOB)
What's the genre of Fever Ranma : Hot Springs Athletic Chapter?
SELECT "Genre" FROM table_552 WHERE "English Title/Translation" = 'Fever Ranma ½: Hot Springs Athletic Chapter'
SELECT "Genre" FROM "table_552" WHERE "English Title/Translation" = 'Fever Ranma ½: Hot Springs Athletic Chapter'
0.110352