schema
stringlengths 28
5.65k
| question
stringlengths 0
990
| rejected
stringlengths 2
4.44k
| chosen
stringlengths 4
9.17k
| weight
float64 0
8.95
|
---|---|---|---|---|
CREATE TABLE table_203_43 (id DECIMAL, "polling firm" TEXT, "month" TEXT, "link" TEXT, "favor" DECIMAL, "oppose" DECIMAL)
| how many months had more than 55 favor votes ? | SELECT COUNT("month") FROM table_203_43 WHERE "favor" > 55 | SELECT COUNT("month") FROM "table_203_43" WHERE "favor" > 55 | 0.058594 |
CREATE TABLE table_39196 ("Season" FLOAT, "Series" TEXT, "Team" TEXT, "Races" FLOAT, "Wins" FLOAT, "Poles" FLOAT, "Podiums" FLOAT)
| What is the largest amount of wins that was before the 2007 season, as well as the Team being silverstone motorsport academy? | SELECT MAX("Wins") FROM table_39196 WHERE "Season" < '2007' AND "Team" = 'silverstone motorsport academy' | SELECT MAX("Wins") FROM "table_39196" WHERE "Season" < '2007' AND "Team" = 'silverstone motorsport academy' | 0.104492 |
CREATE TABLE table_3324 ("Episode #" TEXT, "Fan Title" TEXT, "Writer" TEXT, "Artist ( s ) " TEXT, "Start Date" TEXT, "End Date" TEXT, "Inc. Dailies?" TEXT, "Inc. Sundays?" TEXT)
| How many writers where there for episode # 06? | SELECT COUNT("Writer") FROM table_3324 WHERE "Episode #" = '06' | SELECT COUNT("Writer") FROM "table_3324" WHERE "Episode #" = '06' | 0.063477 |
CREATE TABLE table_name_4 (tournament VARCHAR)
| For the Australian Open, in 2007 the result was A, but what was the result in 2012? | SELECT 2012 FROM table_name_4 WHERE 2007 = "a" AND tournament = "australian open" | SELECT 2012 FROM "table_name_4" WHERE "a" = 2007 AND "australian open" = "tournament" | 0.083008 |
CREATE TABLE table_name_28 (dance VARCHAR, visual_arts VARCHAR)
| What Dance has the Visual Arts of Bryon Kim? | SELECT dance FROM table_name_28 WHERE visual_arts = "bryon kim" | SELECT "dance" FROM "table_name_28" WHERE "bryon kim" = "visual_arts" | 0.067383 |
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
| TeX.SX \\ corruption (tabs) with edit link. | SELECT p.Id AS "post_link", 'site://posts/' + CAST(p.Id AS TEXT) + '/edit|' + 'Edit' AS "edit_link", p.CreationDate FROM Posts AS p WHERE ((REPLACE(REPLACE(p.Body, '\\', ''), CHAR(9), 'X') LIKE '%\X%')) ORDER BY p.CreationDate DESC | SELECT "p"."Id" AS "post_link", CONCAT(CONCAT(CONCAT('site://posts/', CAST("p"."Id" AS TEXT)), '/edit|'), 'Edit') AS "edit_link", "p"."CreationDate" FROM "Posts" AS "p" WHERE REPLACE(REPLACE("p"."Body", '\\', ''), CHR(9), 'X') LIKE '%\X%' ORDER BY "p"."CreationDate" DESC NULLS LAST | 0.275391 |
CREATE TABLE table_name_17 (name VARCHAR, country VARCHAR)
| What is the name of the player from NGA? | SELECT name FROM table_name_17 WHERE country = "nga" | SELECT "name" FROM "table_name_17" WHERE "country" = "nga" | 0.056641 |
CREATE TABLE table_63025 ("Year" FLOAT, "Place" TEXT, "Gold" TEXT, "Silver" TEXT, "Bronze" TEXT)
| Who won the Gold Medal in Moscow after the year 1982? | SELECT "Gold" FROM table_63025 WHERE "Year" > '1982' AND "Place" = 'moscow' | SELECT "Gold" FROM "table_63025" WHERE "Place" = 'moscow' AND "Year" > '1982' | 0.075195 |
CREATE TABLE table_name_80 (Id VARCHAR)
| What is the highest 2010 that has a 2009 less than 6.5, 0.4 as the 2008, with a 2007 less than 0.5? | SELECT MAX(2010) FROM table_name_80 WHERE 2009 < 6.5 AND 2008 = 0.4 AND 2007 < 0.5 | SELECT MAX(2010) FROM "table_name_80" WHERE FALSE | 0.047852 |
CREATE TABLE table_name_23 (date VARCHAR, visiting_team VARCHAR)
| When did the New England Patriots play as the visiting team? | SELECT date FROM table_name_23 WHERE visiting_team = "new england patriots" | SELECT "date" FROM "table_name_23" WHERE "new england patriots" = "visiting_team" | 0.079102 |
CREATE TABLE table_39290 ("Date" TEXT, "Jurisdiction" TEXT, "Ronald Reagan" TEXT, "George H. W. Bush" TEXT, "John B. Anderson" TEXT, "Howard Baker" TEXT, "John Connally" TEXT, "Phil Crane" TEXT, "Bob Dole" TEXT)
| Name the howard bake when bush had 66% | SELECT "Howard Baker" FROM table_39290 WHERE "George H. W. Bush" = '66%' | SELECT "Howard Baker" FROM "table_39290" WHERE "George H. W. Bush" = '66%' | 0.072266 |
CREATE TABLE table_name_92 (team_classification VARCHAR, stage VARCHAR)
| Name the team classification for stage of 20 | SELECT team_classification FROM table_name_92 WHERE stage = "20" | SELECT "team_classification" FROM "table_name_92" WHERE "20" = "stage" | 0.068359 |
CREATE TABLE table_202_205 (id DECIMAL, "year" TEXT, "title" TEXT, "role" TEXT, "notes" TEXT)
| which year did he play the role of mac harper and also pat trammell ? | SELECT "year" FROM table_202_205 WHERE "role" = 'mac harper' | SELECT "year" FROM "table_202_205" WHERE "role" = 'mac harper' | 0.060547 |
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
| how many patients whose discharge location is home and days of hospital stay is greater than 11? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "11" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "11" < "demographic"."days_stay" AND "HOME" = "demographic"."discharge_location" | 0.151367 |
CREATE TABLE club (Club_ID INT, name TEXT, Region TEXT, Start_year TEXT)
CREATE TABLE competition (Competition_ID INT, Year FLOAT, Competition_type TEXT, Country TEXT)
CREATE TABLE club_rank (Rank FLOAT, Club_ID INT, Gold FLOAT, Silver FLOAT, Bronze FLOAT, Total FLOAT)
CREATE TABLE competition_result (Competition_ID INT, Club_ID_1 INT, Club_ID_2 INT, Score TEXT)
CREATE TABLE player (Player_ID INT, name TEXT, Position TEXT, Club_ID INT, Apps FLOAT, Tries FLOAT, Goals TEXT, Points FLOAT)
| List the positions of players whose average number of points scored by that position is larger than 20, give me a bar chart showing the number of different positions, and I want to list by the Y in descending. | SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position) DESC | SELECT "Position", COUNT("Position") FROM "player" GROUP BY "Position" HAVING AVG("Points") >= 20 ORDER BY COUNT("Position") DESC NULLS LAST | 0.136719 |
CREATE TABLE table_train_121 ("id" INT, "depression" BOOLEAN, "suicidality" BOOLEAN, "neurodegenerative_disease" BOOLEAN, "unstable_asthmatic_condition" BOOLEAN, "vitamin_k_deficiency" BOOLEAN, "renal_disease" BOOLEAN, "cerebrovascular_disease" BOOLEAN, "hepatic_disease" BOOLEAN, "liver_disease" BOOLEAN, "cardiac_disease" BOOLEAN, "acute_severe" BOOLEAN, "chronic_obstructive_pulmonary_disease_copd" BOOLEAN, "alcohol_abuse" BOOLEAN, "parkinson_disease" BOOLEAN, "drug_abuse" BOOLEAN, "lewy_body_dementia" BOOLEAN, "coagulopathy" BOOLEAN, "NOUSE" FLOAT)
| history of clinically significant liver disease, coagulopathy, or vitamin k deficiency within the past 2 years. | SELECT * FROM table_train_121 WHERE liver_disease = 1 OR coagulopathy = 1 OR vitamin_k_deficiency = 1 | SELECT * FROM "table_train_121" WHERE "coagulopathy" = 1 OR "liver_disease" = 1 OR "vitamin_k_deficiency" = 1 | 0.106445 |
CREATE TABLE table_name_6 (nationality VARCHAR, college VARCHAR)
| What nationality is the player from the College of Cincinnati? | SELECT nationality FROM table_name_6 WHERE college = "cincinnati" | SELECT "nationality" FROM "table_name_6" WHERE "cincinnati" = "college" | 0.069336 |
CREATE TABLE table_32857 ("Sanctioning" TEXT, "Race Name" TEXT, "Circuit" TEXT, "City/Location" TEXT, "Date" TEXT)
| What is the date for the race that has a circuit of Milwaukee Mile and the sanctioning of cart? | SELECT "Date" FROM table_32857 WHERE "Circuit" = 'milwaukee mile' AND "Sanctioning" = 'cart' | SELECT "Date" FROM "table_32857" WHERE "Circuit" = 'milwaukee mile' AND "Sanctioning" = 'cart' | 0.091797 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| how many patients are admitted before the year 2133 and suggested with drug route po? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2133" AND prescriptions.route = "PO" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "PO" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "2133" > "demographic"."admityear" | 0.214844 |
CREATE TABLE table_41272 ("Year ( Ceremony ) " TEXT, "Film title used in nomination" TEXT, "Original title" TEXT, "Director" TEXT, "Result" TEXT)
| What is Result, when Director is Veljko Bulaji category:articles with hcards, and when Original title is Sarajevski Atentat? | SELECT "Result" FROM table_41272 WHERE "Director" = 'veljko bulajić category:articles with hcards' AND "Original title" = 'sarajevski atentat' | SELECT "Result" FROM "table_41272" WHERE "Director" = 'veljko bulajić category:articles with hcards' AND "Original title" = 'sarajevski atentat' | 0.140625 |
CREATE TABLE table_2179 ("Pitcher" TEXT, "Starts" FLOAT, "Wins" FLOAT, "Losses" FLOAT, "No decisions" FLOAT, "Winning %" TEXT, "Seasons" TEXT)
| what is the least number of no decisions for scott feldman category:articles with hcards | SELECT MIN("No decisions") FROM table_2179 WHERE "Pitcher" = 'Scott Feldman Category:Articles with hCards' | SELECT MIN("No decisions") FROM "table_2179" WHERE "Pitcher" = 'Scott Feldman Category:Articles with hCards' | 0.105469 |
CREATE TABLE table_50944 ("Rider" TEXT, "Manufacturer" TEXT, "Laps" FLOAT, "Time" TEXT, "Grid" FLOAT)
| What are the average Laps on Grid 15? | SELECT AVG("Laps") FROM table_50944 WHERE "Grid" = '15' | SELECT AVG("Laps") FROM "table_50944" WHERE "Grid" = '15' | 0.055664 |
CREATE TABLE table_25737761_3 (director VARCHAR, no VARCHAR)
| Who directed episode number 2? | SELECT director FROM table_25737761_3 WHERE no = 2 | SELECT "director" FROM "table_25737761_3" WHERE "no" = 2 | 0.054688 |
CREATE TABLE basketball_match (Team_ID INT, School_ID INT, Team_Name TEXT, ACC_Regular_Season TEXT, ACC_Percent TEXT, ACC_Home TEXT, ACC_Road TEXT, All_Games TEXT, All_Games_Percent INT, All_Home TEXT, All_Road TEXT, All_Neutral TEXT)
CREATE TABLE university (School_ID INT, School TEXT, Location TEXT, Founded FLOAT, Affiliation TEXT, Enrollment FLOAT, Nickname TEXT, Primary_conference TEXT)
| Return a bar chart about the distribution of All_Games and All_Games_Percent , could you order in descending by the names please? | SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games DESC | SELECT "All_Games", "All_Games_Percent" FROM "basketball_match" ORDER BY "All_Games" DESC NULLS LAST | 0.097656 |
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
| how many times has opn lft hemicolectmy nec been ordered since 6 years ago? | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'opn lft hemicolectmy nec') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') | SELECT COUNT(*) FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'opn lft hemicolectmy nec' WHERE DATETIME("procedures_icd"."charttime") >= DATETIME(CURRENT_TIME(), '-6 year') | 0.269531 |
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
| how many days since first time patient 016-22566 was diagnosed with acute coronary syndrome - acute myocardial infarction (with st elevation) during this hospital visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-22566' AND patient.hospitaldischargetime IS NULL)) AND diagnosis.diagnosisname = 'acute coronary syndrome - acute myocardial infarction (with st elevation)' ORDER BY diagnosis.diagnosistime LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."hospitaldischargetime" IS NULL AND "patient"."uniquepid" = '016-22566' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "diagnosis"."diagnosistime")) FROM "diagnosis" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "diagnosis"."patientunitstayid" WHERE "diagnosis"."diagnosisname" = 'acute coronary syndrome - acute myocardial infarction (with st elevation)' AND NOT "_u_1"."" IS NULL ORDER BY "diagnosis"."diagnosistime" NULLS FIRST LIMIT 1 | 0.760742 |
CREATE TABLE table_name_82 (opponent VARCHAR, score VARCHAR)
| What was the Opponent in the game with a Score of 102-125? | SELECT opponent FROM table_name_82 WHERE score = "102-125" | SELECT "opponent" FROM "table_name_82" WHERE "102-125" = "score" | 0.0625 |
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| what is age and primary disease of subject id 2560? | SELECT demographic.age, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560" | SELECT "demographic"."age", "demographic"."diagnosis" FROM "demographic" WHERE "2560" = "demographic"."subject_id" | 0.111328 |
CREATE TABLE table_38242 ("Outcome" TEXT, "Date" TEXT, "Tournament" TEXT, "Surface" TEXT, "Partnering" TEXT, "Opponents in the final" TEXT, "Score" TEXT)
| Name the surface for january 8, 2001 | SELECT "Surface" FROM table_38242 WHERE "Date" = 'january 8, 2001' | SELECT "Surface" FROM "table_38242" WHERE "Date" = 'january 8, 2001' | 0.066406 |
CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT)
CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT)
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT)
| UA flights stopping in DENVER before 1200 | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight_stop.arrival_time < 1200 AND flight_stop.stop_airport = airport_service.airport_code AND flight.airline_code = 'UA' AND flight.flight_id = flight_stop.flight_id | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" JOIN "city" ON "airport_service"."city_code" = "city"."city_code" AND "city"."city_name" = 'DENVER' JOIN "flight_stop" ON "airport_service"."airport_code" = "flight_stop"."stop_airport" AND "flight_stop"."arrival_time" < 1200 JOIN "flight" ON "flight"."airline_code" = 'UA' AND "flight"."flight_id" = "flight_stop"."flight_id" | 0.376953 |
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
| what are the top five most prescribed drugs for patients who were prescribed sulfasalazine_ 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 = 'sulfasalazine_' 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 <= 5 | 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 NULLS LAST) AS "c1" FROM "prescriptions" JOIN "admissions" ON "admissions"."hadm_id" = "prescriptions"."hadm_id" JOIN "t2" AS "t2" ON "admissions"."subject_id" = "t2"."subject_id" AND DATETIME("prescriptions"."startdate") = DATETIME("t2"."startdate") WHERE "prescriptions"."drug" = 'sulfasalazine_' AND DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY "t2"."drug") SELECT "t3"."drug" FROM "t3" AS "t3" WHERE "t3"."c1" <= 5 | 0.853516 |
CREATE TABLE table_32382 ("Stage" TEXT, "Date" TEXT, "Route" TEXT, "Terrain" TEXT, "Length" TEXT, "Winner" TEXT)
| Which date has a Terrain of plain stage, and a Stage of 4? | SELECT "Date" FROM table_32382 WHERE "Terrain" = 'plain stage' AND "Stage" = '4' | SELECT "Date" FROM "table_32382" WHERE "Stage" = '4' AND "Terrain" = 'plain stage' | 0.080078 |
CREATE TABLE table_3630 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" TEXT, "Result" TEXT, "Candidates" TEXT)
| How many incumbents were first elected in 1797 with the candidates abram trigg (dr)? | SELECT COUNT("Incumbent") FROM table_3630 WHERE "First elected" = '1797' AND "Candidates" = 'Abram Trigg (DR)' | SELECT COUNT("Incumbent") FROM "table_3630" WHERE "Candidates" = 'Abram Trigg (DR)' AND "First elected" = '1797' | 0.109375 |
CREATE TABLE table_72837 ("Country" TEXT, "Skip" TEXT, "W" FLOAT, "L" FLOAT, "PF" FLOAT, "PA" FLOAT, "Ends Won" FLOAT, "Ends Lost" FLOAT, "Blank Ends" FLOAT, "Stolen Ends" FLOAT, "Shot %" FLOAT)
| Andrea Sch pp is the skip of which country? | SELECT "Country" FROM table_72837 WHERE "Skip" = 'Andrea Schöpp' | SELECT "Country" FROM "table_72837" WHERE "Skip" = 'Andrea Schöpp' | 0.064453 |
CREATE TABLE table_20439 ("Engine type" TEXT, "Scenario" TEXT, "SFC in lb/ ( lbf\\u00b7h ) " TEXT, "SFC in g/ ( kN\\u00b7s ) " TEXT, "Specific impulse ( s ) " FLOAT, "Effective exhaust velocity ( m/s ) " FLOAT)
| What is the maximum specific impulse with a 4423 m/s effective exhaust velocity? | SELECT MAX("Specific impulse (s)") FROM table_20439 WHERE "Effective exhaust velocity (m/s)" = '4423' | SELECT MAX("Specific impulse (s)") FROM "table_20439" WHERE "Effective exhaust velocity (m/s)" = '4423' | 0.100586 |
CREATE TABLE table_12842 ("Election" TEXT, "1st Member" TEXT, "1st Party" TEXT, "2nd Member" TEXT, "2nd Party" TEXT)
| Which 1st Member has an Election of 1895? | SELECT "1st Member" FROM table_12842 WHERE "Election" = '1895' | SELECT "1st Member" FROM "table_12842" WHERE "Election" = '1895' | 0.0625 |
CREATE TABLE table_name_10 (title VARCHAR, director VARCHAR, production_number VARCHAR)
| What is the title of the film with production number 1553, directed by Friz Freleng? | SELECT title FROM table_name_10 WHERE director = "friz freleng" AND production_number = 1553 | SELECT "title" FROM "table_name_10" WHERE "director" = "friz freleng" AND "production_number" = 1553 | 0.097656 |
CREATE TABLE people (People_ID INT, Name TEXT, Age FLOAT, Height FLOAT, Hometown TEXT)
CREATE TABLE gymnast (Gymnast_ID INT, Floor_Exercise_Points FLOAT, Pommel_Horse_Points FLOAT, Rings_Points FLOAT, Vault_Points FLOAT, Parallel_Bars_Points FLOAT, Horizontal_Bar_Points FLOAT, Total_Points FLOAT)
| What are the hometowns of gymnasts and the corresponding number of gymnasts, and rank y-axis in ascending order. | SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) | SELECT "Hometown", COUNT(*) FROM "gymnast" AS "T1" JOIN "people" AS "T2" ON "T1"."Gymnast_ID" = "T2"."People_ID" GROUP BY "T2"."Hometown" ORDER BY COUNT(*) NULLS FIRST | 0.163086 |
CREATE TABLE table_23899 ("Central-Southern Calabrian" TEXT, "Phonetic Greek" TEXT, "Italian" TEXT, "French" TEXT, "English" TEXT)
| How many French words does zinnap tamu in Central-Southern Calabrian translate to? | SELECT COUNT("French") FROM table_23899 WHERE "Central-Southern Calabrian" = 'zinnapòtamu' | SELECT COUNT("French") FROM "table_23899" WHERE "Central-Southern Calabrian" = 'zinnapòtamu' | 0.089844 |
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
| A pie chart about what are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000? | SELECT JOB_TITLE, MAX_SALARY - MIN_SALARY FROM jobs WHERE MAX_SALARY BETWEEN 12000 AND 18000 | SELECT "JOB_TITLE", "MAX_SALARY" - "MIN_SALARY" FROM "jobs" WHERE "MAX_SALARY" <= 18000 AND "MAX_SALARY" >= 12000 | 0.110352 |
CREATE TABLE table_name_23 (years_in_senate VARCHAR, years_in_assembly VARCHAR, name VARCHAR)
| Which Years in Senate has a Years in Assembly of 2010 present, and toni atkins? | SELECT years_in_senate FROM table_name_23 WHERE years_in_assembly = "2010–present" AND name = "toni atkins" | SELECT "years_in_senate" FROM "table_name_23" WHERE "2010–present" = "years_in_assembly" AND "name" = "toni atkins" | 0.112305 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
| count the number of patients whose diagnosis short title is status autm crd dfbrltr and drug route is im. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Status autm crd dfbrltr" AND prescriptions.route = "IM" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Status autm crd dfbrltr" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "prescriptions" ON "IM" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" | 0.297852 |
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
| what is the monthly average value of patient 7400's weight? | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7400)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' AND d_items.linksto = 'chartevents') GROUP BY STRFTIME('%y-%m', chartevents.charttime) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 7400 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'admit wt' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT AVG("chartevents"."valuenum") FROM "chartevents" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL GROUP BY STRFTIME('%y-%m', "chartevents"."charttime") | 0.724609 |
CREATE TABLE table_name_83 (player VARCHAR, chng VARCHAR, rating VARCHAR, prev VARCHAR)
| What player has a rating greater than 2746, with a prev less than 4, and +4 as the chng? | SELECT player FROM table_name_83 WHERE rating > 2746 AND prev < 4 AND chng = "+4" | SELECT "player" FROM "table_name_83" WHERE "+4" = "chng" AND "prev" < 4 AND "rating" > 2746 | 0.088867 |
CREATE TABLE table_62598 ("Player" TEXT, "Country" TEXT, "Year ( s ) won" TEXT, "Total" FLOAT, "To par" TEXT, "Finish" TEXT)
| What is the Total for Seve Ballesteros? | SELECT SUM("Total") FROM table_62598 WHERE "Player" = 'seve ballesteros' | SELECT SUM("Total") FROM "table_62598" WHERE "Player" = 'seve ballesteros' | 0.072266 |
CREATE TABLE table_1566848_7 (pictorials VARCHAR, centerfold_model VARCHAR)
| Who were the pictorials when the centerfold model was Ava Fabian? | SELECT pictorials FROM table_1566848_7 WHERE centerfold_model = "Ava Fabian" | SELECT "pictorials" FROM "table_1566848_7" WHERE "Ava Fabian" = "centerfold_model" | 0.080078 |
CREATE TABLE table_44649 ("Round" FLOAT, "Pick" FLOAT, "Overall" FLOAT, "Name" TEXT, "Position" TEXT, "College" TEXT)
| what is the highest round when the overall is less than 17? | SELECT MAX("Round") FROM table_44649 WHERE "Overall" < '17' | SELECT MAX("Round") FROM "table_44649" WHERE "Overall" < '17' | 0.05957 |
CREATE TABLE actor (actor_id DECIMAL, name TEXT, musical_id DECIMAL, character TEXT, duration TEXT, age DECIMAL)
CREATE TABLE musical (musical_id DECIMAL, name TEXT, year DECIMAL, award TEXT, category TEXT, nominee TEXT, result TEXT)
| How many actors are there? | SELECT COUNT(*) FROM actor | SELECT COUNT(*) FROM "actor" | 0.027344 |
CREATE TABLE table_73591 ("Year" FLOAT, "Starts" FLOAT, "Wins" FLOAT, "Top 5" FLOAT, "Top 10" FLOAT, "Poles" FLOAT, "Avg. Start" TEXT, "Avg. Finish" TEXT, "Winnings" TEXT, "Position" TEXT, "Team ( s ) " TEXT)
| How many years did he have an average finish of 11.7? | SELECT COUNT("Avg. Start") FROM table_73591 WHERE "Avg. Finish" = '11.7' | SELECT COUNT("Avg. Start") FROM "table_73591" WHERE "Avg. Finish" = '11.7' | 0.072266 |
CREATE TABLE table_66696 ("Res." TEXT, "Record" TEXT, "Opponent" TEXT, "Method" TEXT, "Event" TEXT, "Round" FLOAT, "Time" TEXT, "Location" TEXT)
| In what round was the loss at ufc 118? | SELECT "Round" FROM table_66696 WHERE "Res." = 'loss' AND "Event" = 'ufc 118' | SELECT "Round" FROM "table_66696" WHERE "Event" = 'ufc 118' AND "Res." = 'loss' | 0.077148 |
CREATE TABLE table_28697228_4 (player VARCHAR, passing_yards VARCHAR)
| How may players have a passing yard score of 208? | SELECT COUNT(player) FROM table_28697228_4 WHERE passing_yards = 208 | SELECT COUNT("player") FROM "table_28697228_4" WHERE "passing_yards" = 208 | 0.072266 |
CREATE TABLE table_name_81 (player VARCHAR, year_s__won VARCHAR)
| Who is the player that won in the year 1978? | SELECT player FROM table_name_81 WHERE year_s__won = "1978" | SELECT "player" FROM "table_name_81" WHERE "1978" = "year_s__won" | 0.063477 |
CREATE TABLE table_name_21 (value__ VARCHAR, team VARCHAR, revenue__$m_ VARCHAR, rank VARCHAR)
| Name the total number of value for revenue more than 193 and rank less than 12 for manchester united | SELECT COUNT(value__) AS $m_ FROM table_name_21 WHERE revenue__$m_ > 193 AND rank < 12 AND team = "manchester united" | SELECT COUNT("value__") AS $m_ FROM "table_name_21" WHERE "manchester united" = "team" AND "rank" < 12 AND "revenue__$m_" > 193 | 0.124023 |
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
| In CS-LSA courses can I see the hardness ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE program_course.course_id = course.course_id AND program.name LIKE 'CS-LSA' AND program.program_id = program_course.program_id | SELECT DISTINCT "course"."department", "course"."name", "course"."number", "program_course"."workload" FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" JOIN "program" ON "program"."name" LIKE 'CS-LSA' AND "program"."program_id" = "program_course"."program_id" | 0.293945 |
CREATE TABLE table_49673 ("Year" FLOAT, "Entrant" TEXT, "Chassis" TEXT, "Engine" TEXT, "Points" TEXT)
| who is the entrant when the points is 42 (45) and the chassis is brabham bt20? | SELECT "Entrant" FROM table_49673 WHERE "Points" = '42 (45)' AND "Chassis" = 'brabham bt20' | SELECT "Entrant" FROM "table_49673" WHERE "Chassis" = 'brabham bt20' AND "Points" = '42 (45)' | 0.09082 |
CREATE TABLE table_53424 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| How large of a crowd can the Glenferrie oval hold? | SELECT "Crowd" FROM table_53424 WHERE "Venue" = 'glenferrie oval' | SELECT "Crowd" FROM "table_53424" WHERE "Venue" = 'glenferrie oval' | 0.06543 |
CREATE TABLE table_77818 ("Date" TEXT, "Venue" TEXT, "Score" TEXT, "Result" TEXT, "Competition" TEXT)
| Where was the friendly competition on 7 June 1999 played? | SELECT "Venue" FROM table_77818 WHERE "Competition" = 'friendly' AND "Date" = '7 june 1999' | SELECT "Venue" FROM "table_77818" WHERE "Competition" = 'friendly' AND "Date" = '7 june 1999' | 0.09082 |
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
| For Prof. Waheed Samy 's classes , is there always an exam ? | SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AND instructor.name LIKE '%Waheed Samy%' | SELECT COUNT(*) = 0 FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "offering_instructor" ON "course_offering"."offering_id" = "offering_instructor"."offering_id" JOIN "instructor" ON "instructor"."instructor_id" = "offering_instructor"."instructor_id" AND "instructor"."name" LIKE '%Waheed Samy%' WHERE "course"."has_exams" = 'N' | 0.371094 |
CREATE TABLE table_name_74 (home_team VARCHAR, away_team VARCHAR)
| Which home team played against the away team Carlton? | SELECT home_team FROM table_name_74 WHERE away_team = "carlton" | SELECT "home_team" FROM "table_name_74" WHERE "away_team" = "carlton" | 0.067383 |
CREATE TABLE table_29 ("Member" TEXT, "Electorate" TEXT, "Province" TEXT, "MPs term" TEXT, "Election date" TEXT)
| Which province is bay of islands in | SELECT "Province" FROM table_29 WHERE "Electorate" = 'Bay of Islands' | SELECT "Province" FROM "table_29" WHERE "Electorate" = 'Bay of Islands' | 0.069336 |
CREATE TABLE table_45767 ("Rank" FLOAT, "Name" TEXT, "Country" TEXT, "Wins" FLOAT, "Years" TEXT)
| Which Country has Wins larger than 2, and a Rank of 2, and a Name of federico bahamontes? | SELECT "Country" FROM table_45767 WHERE "Wins" > '2' AND "Rank" = '2' AND "Name" = 'federico bahamontes' | SELECT "Country" FROM "table_45767" WHERE "Name" = 'federico bahamontes' AND "Rank" = '2' AND "Wins" > '2' | 0.103516 |
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
| how many hours does it have been since the first time patient 55281 stayed in ward 33 on the current hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55281 AND admissions.dischtime IS NULL)) AND transfers.wardid = 33 ORDER BY transfers.intime LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."dischtime" IS NULL AND "admissions"."subject_id" = 55281 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id") SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "transfers"."intime")) FROM "transfers" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "transfers"."icustay_id" WHERE "transfers"."wardid" = 33 AND NOT "_u_1"."" IS NULL ORDER BY "transfers"."intime" NULLS FIRST LIMIT 1 | 0.594727 |
CREATE TABLE table_56578 ("Year" FLOAT, "Category" TEXT, "Genre" TEXT, "Title" TEXT, "Result" TEXT)
| What was the title of Ashanti's 2003 rap song? | SELECT "Title" FROM table_56578 WHERE "Year" = '2003' AND "Genre" = 'rap' | SELECT "Title" FROM "table_56578" WHERE "Genre" = 'rap' AND "Year" = '2003' | 0.073242 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| what is the number of patients whose ethnicity is white - russian and item id is 50910? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND lab.itemid = "50910" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "50910" = "lab"."itemid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "WHITE - RUSSIAN" = "demographic"."ethnicity" | 0.200195 |
CREATE TABLE table_64972 ("Governor" TEXT, "Took office" TEXT, "Left office" TEXT, "Party" TEXT, "Lieutenant Governor" TEXT, "Terms" TEXT)
| Who was lieutenant governor to the governor that left office on October 16, 2000? | SELECT "Lieutenant Governor" FROM table_64972 WHERE "Left office" = 'october 16, 2000' | SELECT "Lieutenant Governor" FROM "table_64972" WHERE "Left office" = 'october 16, 2000' | 0.085938 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| provide the number of patients whose marital status is widowed and year of birth is less than 1846? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.dob_year < "1846" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "1846" > "demographic"."dob_year" AND "WIDOWED" = "demographic"."marital_status" | 0.151367 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
| provide the number of patients who died on or before 2155 and had hypoxia as primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPOXIA" AND demographic.dod_year <= "2155.0" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2155.0" >= "demographic"."dod_year" AND "HYPOXIA" = "demographic"."diagnosis" | 0.149414 |
CREATE TABLE table_27874 ("Settlement" TEXT, "Cyrillic Name Other Names" TEXT, "Type" TEXT, "Population ( 2011 ) " FLOAT, "Largest ethnic group ( 2002 ) " TEXT, "Dominant religion ( 2002 ) " TEXT)
| What is the type for the population in 2011 of 1004? | SELECT "Type" FROM table_27874 WHERE "Population (2011)" = '1004' | SELECT "Type" FROM "table_27874" WHERE "Population (2011)" = '1004' | 0.06543 |
CREATE TABLE party_host (Party_ID INT, Host_ID INT, Is_Main_in_Charge BOOLEAN)
CREATE TABLE host (Host_ID INT, Name TEXT, Nationality TEXT, Age TEXT)
CREATE TABLE party (Party_ID INT, Party_Theme TEXT, Location TEXT, First_year TEXT, Last_year TEXT, Number_of_hosts INT)
| What are the last year of the parties whose theme is 'Spring' or 'Teqnology'? Bin the last year into weekday interval and count them. | SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" | SELECT "Last_year", COUNT("Last_year") FROM "party" WHERE "Party_Theme" = "Spring" OR "Party_Theme" = "Teqnology" | 0.110352 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| how many patients whose age is less than 64 and procedure icd9 code is 3891? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "64" AND procedures.icd9_code = "3891" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "3891" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "64" > "demographic"."age" | 0.204102 |
CREATE TABLE airlines (alid DECIMAL, name TEXT, iata TEXT, icao TEXT, callsign TEXT, country TEXT, active TEXT)
CREATE TABLE routes (rid DECIMAL, dst_apid DECIMAL, dst_ap TEXT, src_apid DECIMAL, src_ap TEXT, alid DECIMAL, airline TEXT, codeshare TEXT)
CREATE TABLE airports (apid DECIMAL, name TEXT, city TEXT, country TEXT, x DECIMAL, y DECIMAL, elevation DECIMAL, iata TEXT, icao TEXT)
| What are the countries of all airlines whose names start with Orbit? | SELECT country FROM airlines WHERE name LIKE 'Orbit%' | SELECT "country" FROM "airlines" WHERE "name" LIKE 'Orbit%' | 0.057617 |
CREATE TABLE table_name_48 (_percentage__1960_ INT, county VARCHAR, _percentage__2040_ VARCHAR, _percentage__2000_ VARCHAR)
| What is the % (1960) of Troms, which has a % (2040) smaller than 100 and a % (2000) smaller than 4.7? | SELECT SUM(_percentage__1960_) FROM table_name_48 WHERE _percentage__2040_ < 100 AND _percentage__2000_ < 4.7 AND county = "troms" | SELECT SUM("_percentage__1960_") FROM "table_name_48" WHERE "_percentage__2000_" < 4.7 AND "_percentage__2040_" < 100 AND "county" = "troms" | 0.136719 |
CREATE TABLE musical (musical_id DECIMAL, name TEXT, year DECIMAL, award TEXT, category TEXT, nominee TEXT, result TEXT)
CREATE TABLE actor (actor_id DECIMAL, name TEXT, musical_id DECIMAL, character TEXT, duration TEXT, age DECIMAL)
| What are the names of musicals who have no actors? | SELECT name FROM musical WHERE NOT musical_id IN (SELECT musical_id FROM actor) | SELECT "name" FROM "musical" WHERE NOT "musical_id" IN (SELECT "musical_id" FROM "actor") | 0.086914 |
CREATE TABLE table_71198 ("Res." TEXT, "Record" TEXT, "Opponent" TEXT, "Method" TEXT, "Event" TEXT, "Round" FLOAT, "Time" TEXT, "Location" TEXT)
| Which opponent has a Time of 1:34? | SELECT "Opponent" FROM table_71198 WHERE "Time" = '1:34' | SELECT "Opponent" FROM "table_71198" WHERE "Time" = '1:34' | 0.056641 |
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
| how many days have it taken since the last time patient 016-9636 received a procedure in their current hospital visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636' AND patient.hospitaldischargetime IS NULL)) ORDER BY treatment.treatmenttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."hospitaldischargetime" IS NULL AND "patient"."uniquepid" = '016-9636' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "treatment"."treatmenttime")) FROM "treatment" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "treatment"."patientunitstayid" WHERE NOT "_u_1"."" IS NULL ORDER BY "treatment"."treatmenttime" DESC NULLS LAST LIMIT 1 | 0.65625 |
CREATE TABLE table_42846 ("Year" FLOAT, "Chassis" TEXT, "Engine" TEXT, "Start" FLOAT, "Finish" FLOAT, "Entrant" TEXT)
| What chassis has patrick racing as an entrant, with a start greater than 6? | SELECT "Chassis" FROM table_42846 WHERE "Entrant" = 'patrick racing' AND "Start" > '6' | SELECT "Chassis" FROM "table_42846" WHERE "Entrant" = 'patrick racing' AND "Start" > '6' | 0.085938 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| find the number of patients with primary disease as s/p fall and their year of death is in or before 2112. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2112.0" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2112.0" >= "demographic"."dod_year" AND "S/P FALL" = "demographic"."diagnosis" | 0.150391 |
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
| For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the amount of hire_date bin hire_date by weekday in a bar chart, order by the Y from low to high. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY COUNT(HIRE_DATE) | SELECT "HIRE_DATE", COUNT("HIRE_DATE") FROM "employees" WHERE "HIRE_DATE" < '2002-06-21' ORDER BY COUNT("HIRE_DATE") NULLS FIRST | 0.125 |
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
| in this year, how many patients had been diagnosed with dvt - right lower extremity? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'dvt - right lower extremity' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) | WITH "_u_0" AS (SELECT "diagnosis"."patientunitstayid" FROM "diagnosis" WHERE "diagnosis"."diagnosisname" = 'dvt - right lower extremity' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY "patientunitstayid") SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL | 0.430664 |
CREATE TABLE appellations (No INT, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT)
CREATE TABLE wine (No INT, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INT, Price INT, Score INT, Cases INT, Drink TEXT)
CREATE TABLE grapes (ID INT, Grape TEXT, Color TEXT)
| Give me a scatter chart about the correlation between the average price and the score of wines grouped by appellation? | SELECT AVG(Price), AVG(Score) FROM wine GROUP BY AVG(Price) | SELECT AVG("Price"), AVG("Score") FROM "wine" GROUP BY AVG("Price") | 0.06543 |
CREATE TABLE table_name_85 (venue VARCHAR, extra VARCHAR)
| What venue has an extra of 45.08 S? | SELECT venue FROM table_name_85 WHERE extra = "45.08 s" | SELECT "venue" FROM "table_name_85" WHERE "45.08 s" = "extra" | 0.05957 |
CREATE TABLE table_name_57 (high_rebounds VARCHAR, high_assists VARCHAR, score VARCHAR)
| Who had the high rebounds when the score was w 105 95 (ot) and Jason Kidd (8) had the high assists? | SELECT high_rebounds FROM table_name_57 WHERE high_assists = "jason kidd (8)" AND score = "w 105–95 (ot)" | SELECT "high_rebounds" FROM "table_name_57" WHERE "high_assists" = "jason kidd (8)" AND "score" = "w 105–95 (ot)" | 0.110352 |
CREATE TABLE table_name_91 (laps INT, grid VARCHAR, time_retired VARCHAR)
| What is the high lap total for cards with a grid larger than 21, and a Time/Retired of +2 laps? | SELECT MAX(laps) FROM table_name_91 WHERE grid > 21 AND time_retired = "+2 laps" | SELECT MAX("laps") FROM "table_name_91" WHERE "+2 laps" = "time_retired" AND "grid" > 21 | 0.085938 |
CREATE TABLE table_4588 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| When the Home team score was 8.15 (63), what is the total Crowd? | SELECT COUNT("Crowd") FROM table_4588 WHERE "Home team score" = '8.15 (63)' | SELECT COUNT("Crowd") FROM "table_4588" WHERE "Home team score" = '8.15 (63)' | 0.075195 |
CREATE TABLE Transactions_Lots (transaction_id INT, lot_id INT)
CREATE TABLE Ref_Transaction_Types (transaction_type_code VARCHAR, transaction_type_description VARCHAR)
CREATE TABLE Investors (investor_id INT, Investor_details VARCHAR)
CREATE TABLE Lots (lot_id INT, investor_id INT, lot_details VARCHAR)
CREATE TABLE Purchases (purchase_transaction_id INT, purchase_details VARCHAR)
CREATE TABLE Transactions (transaction_id INT, investor_id INT, transaction_type_code VARCHAR, date_of_transaction DATETIME, amount_of_transaction DECIMAL, share_count VARCHAR, other_details VARCHAR)
CREATE TABLE Sales (sales_transaction_id INT, sales_details VARCHAR)
| Show the id and details for the investors who have the top 3 number of transactions by a bar chart. | SELECT T1.Investor_details, T1.investor_id FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3 | SELECT "T1"."Investor_details", "T1"."investor_id" FROM "Investors" AS "T1" JOIN "Transactions" AS "T2" ON "T1"."investor_id" = "T2"."investor_id" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 3 | 0.183594 |
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
| Which class is the easiest class to take to fulfill the Core requirement ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%Core%') | WITH "_u_0" AS (SELECT MIN("PROGRAM_COURSEalias1"."workload") FROM "program_course" AS "PROGRAM_COURSEalias1" WHERE "PROGRAM_COURSEalias1"."category" LIKE '%Core%') SELECT DISTINCT "course"."department", "course"."name", "course"."number", "program_course"."workload", "program_course"."workload" FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%Core%' JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "program_course"."workload" | 0.486328 |
CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT)
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
| which airline is AS | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'AS' | SELECT DISTINCT "airline_code" FROM "airline" WHERE "airline_code" = 'AS' | 0.071289 |
CREATE TABLE table_name_6 (venue VARCHAR, date VARCHAR)
| what is the venue when the date is december 7, 1998? | SELECT venue FROM table_name_6 WHERE date = "december 7, 1998" | SELECT "venue" FROM "table_name_6" WHERE "date" = "december 7, 1998" | 0.066406 |
CREATE TABLE table_39043 ("Position" FLOAT, "Team" TEXT, "Played" FLOAT, "Wins" FLOAT, "Draws" FLOAT, "Losses" FLOAT, "Scored" FLOAT, "Conceded" FLOAT, "Points" FLOAT)
| What's the lowest Position with a Conceded that's larger than 16, Draws of 3, and Losses that's larger than 3? | SELECT MIN("Position") FROM table_39043 WHERE "Conceded" > '16' AND "Draws" = '3' AND "Losses" > '3' | SELECT MIN("Position") FROM "table_39043" WHERE "Conceded" > '16' AND "Draws" = '3' AND "Losses" > '3' | 0.099609 |
CREATE TABLE event (ID INT, Name TEXT, Stadium_ID INT, Year TEXT)
CREATE TABLE stadium (ID INT, name TEXT, Capacity INT, City TEXT, Country TEXT, Opening_year INT)
CREATE TABLE swimmer (ID INT, name TEXT, Nationality TEXT, meter_100 FLOAT, meter_200 TEXT, meter_300 TEXT, meter_400 TEXT, meter_500 TEXT, meter_600 TEXT, meter_700 TEXT, Time TEXT)
CREATE TABLE record (ID INT, Result TEXT, Swimmer_ID INT, Event_ID INT)
| Show me about the distribution of meter_600 and ID in a bar chart, list by the y-axis from low to high. | SELECT meter_600, ID FROM swimmer ORDER BY ID | SELECT "meter_600", "ID" FROM "swimmer" ORDER BY "ID" NULLS FIRST | 0.063477 |
CREATE TABLE office_locations (building_id DECIMAL, company_id DECIMAL, move_in_year DECIMAL)
CREATE TABLE buildings (id DECIMAL, name TEXT, city TEXT, height DECIMAL, stories DECIMAL, status TEXT)
CREATE TABLE companies (id DECIMAL, name TEXT, headquarters TEXT, industry TEXT, sales_billion DECIMAL, profits_billion DECIMAL, assets_billion DECIMAL, market_value_billion TEXT)
| List the industry shared by the most companies. | SELECT industry FROM companies GROUP BY industry ORDER BY COUNT(*) DESC LIMIT 1 | SELECT "industry" FROM "companies" GROUP BY "industry" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1 | 0.09375 |
CREATE TABLE table_15848 ("Order Year" TEXT, "Manufacturer" TEXT, "Model" TEXT, "Fleet Series ( Quantity ) " TEXT, "Powertrain ( Engine/Transmission ) " TEXT, "Fuel Propulsion" TEXT)
| how many times is the model ge40lfr? | SELECT COUNT("Manufacturer") FROM table_15848 WHERE "Model" = 'GE40LFR' | SELECT COUNT("Manufacturer") FROM "table_15848" WHERE "Model" = 'GE40LFR' | 0.071289 |
CREATE TABLE table_name_15 (school VARCHAR, team VARCHAR)
| What is the School, when the Team is Golden Knights? | SELECT school FROM table_name_15 WHERE team = "golden knights" | SELECT "school" FROM "table_name_15" WHERE "golden knights" = "team" | 0.066406 |
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
| list the ids of patients who were diagnosed with dvt - related to vascular catheter in this year. | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'dvt - related to vascular catheter' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) | WITH "_u_0" AS (SELECT "diagnosis"."patientunitstayid" FROM "diagnosis" WHERE "diagnosis"."diagnosisname" = 'dvt - related to vascular catheter' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY "patientunitstayid") SELECT "patient"."uniquepid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL | 0.421875 |
CREATE TABLE table_48509 ("Tournament" TEXT, "1993" TEXT, "1994" TEXT, "1995" TEXT, "1996" TEXT, "1997" TEXT, "1998" TEXT, "1999" TEXT, "2000" TEXT, "2001" TEXT, "2002" TEXT, "2003" TEXT, "2004" TEXT, "2005" TEXT, "2006" TEXT, "2007" TEXT, "Career WR" TEXT, "Career Win-Loss" TEXT)
| What is 2000, when 1996 is 'A', when 1997 is 'A', and when 2007 is 'A'? | SELECT "2000" FROM table_48509 WHERE "1996" = 'a' AND "1997" = 'a' AND "2007" = 'a' | SELECT "2000" FROM "table_48509" WHERE "1996" = 'a' AND "1997" = 'a' AND "2007" = 'a' | 0.083008 |
CREATE TABLE table_name_91 (psychological_dependence VARCHAR, pleasure VARCHAR, mean VARCHAR)
| What is the total number of Psychological Dependence, when Pleasure is '2.3', and when Mean is less than 1.9300000000000002? | SELECT COUNT(psychological_dependence) FROM table_name_91 WHERE pleasure = 2.3 AND mean < 1.9300000000000002 | SELECT COUNT("psychological_dependence") FROM "table_name_91" WHERE "mean" < 1.9300000000000002 AND "pleasure" = 2.3 | 0.113281 |
CREATE TABLE table_34460 ("Date" TEXT, "Visitor" TEXT, "Score" TEXT, "Home" TEXT, "Series" TEXT)
| What score has april 28 as the date? | SELECT "Score" FROM table_34460 WHERE "Date" = 'april 28' | SELECT "Score" FROM "table_34460" WHERE "Date" = 'april 28' | 0.057617 |
CREATE TABLE dorm_amenity (amenity_name VARCHAR, amenid VARCHAR)
CREATE TABLE has_amenity (amenid VARCHAR)
| Find the name of amenity that is most common in all dorms. | SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1 | SELECT "T1"."amenity_name" FROM "dorm_amenity" AS "T1" JOIN "has_amenity" AS "T2" ON "T1"."amenid" = "T2"."amenid" GROUP BY "T2"."amenid" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1 | 0.174805 |
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
| what is patient 3125's average arterial bp mean, since 12/15/2105? | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3125)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' AND d_items.linksto = 'chartevents') AND STRFTIME('%y-%m-%d', chartevents.charttime) >= '2105-12-15' | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 3125 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'arterial bp mean' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT AVG("chartevents"."valuenum") FROM "chartevents" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%y-%m-%d', "chartevents"."charttime") >= '2105-12-15' | 0.746094 |
CREATE TABLE table_62283 ("Round" FLOAT, "Race" TEXT, "Circuit" TEXT, "Date" TEXT, "Event" TEXT, "Winning driver" TEXT, "Winning team" TEXT)
| What is the circuit for the ADAC gro er preis der tourenwagen race? | SELECT "Circuit" FROM table_62283 WHERE "Race" = 'adac großer preis der tourenwagen' | SELECT "Circuit" FROM "table_62283" WHERE "Race" = 'adac großer preis der tourenwagen' | 0.083984 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.