text
stringlengths 432
6.49k
| target
stringlengths 2
4.44k
|
---|---|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_71 (wins INTEGER, manufacturer VARCHAR, rank VARCHAR)
### Question ###
Manufacturer of honda, and a Rank of 8 had what highest wins?
### Accurate SQL ###
| SELECT MAX(wins) FROM table_name_71 WHERE manufacturer = "honda" AND rank = 8 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_78 (team VARCHAR, points INTEGER)
### Question ###
Which team scored less than 35 points?
### Accurate SQL ###
| SELECT team FROM table_name_78 WHERE points < 35 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_79 ( competition VARCHAR, date VARCHAR )
### Question ###
What was being played on Nov 23, 2006?
### Accurate SQL ###
| SELECT competition FROM table_name_79 WHERE date = "nov 23, 2006" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_20 ( penalties VARCHAR, gf VARCHAR )
### Question ###
How many penalties were there in the game with a G.F. of 40?
### Accurate SQL ###
| SELECT penalties FROM table_name_20 WHERE gf = "40" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_204_836 ( id number, "#" number, "date" text, "opponent" text, "score" text, "result" text, "competition" text )
### Question ###
which date and opponent is next after june 12,1989
### Accurate SQL ###
| SELECT "date", "opponent" FROM table_204_836 WHERE "#" = (SELECT MAX("#") FROM table_204_836 WHERE "date" = 'june 12, 1989') + 1 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other )
TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
### Question ###
Suggested Edit Review Stats (your approval rate).
### Accurate SQL ###
| SELECT total, approved, rejected, ROUND(CAST(approved * 100 AS FLOAT) / total, 1) AS ApprovedPercentage, ROUND(CAST(rejected * 100 AS FLOAT) / total, 1) AS RejectedPercentage FROM (SELECT COUNT(Id) AS total, COUNT(ApprovalDate) AS approved, COUNT(RejectionDate) AS rejected FROM SuggestedEdits WHERE OwnerUserId = @UserId) AS grouped |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_47 ( overall VARCHAR, pick__number INTEGER )
### Question ###
What is the overall of the player with a pick # higher than 13?
### Accurate SQL ###
| SELECT overall FROM table_name_47 WHERE pick__number < 13 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_38498 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
### Question ###
Name the visitor for detroit on february 24
### Accurate SQL ###
| SELECT "Visitor" FROM table_38498 WHERE "Home" = 'detroit' AND "Date" = 'february 24' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_3 ( placement_in_miss_universe VARCHAR, delegate VARCHAR )
### Question ###
Which Placement in Miss Universe is armi barbara quiray crespo?
### Accurate SQL ###
| SELECT placement_in_miss_universe FROM table_name_3 WHERE delegate = "armi barbara quiray crespo" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_19 (draws INTEGER, points VARCHAR, position VARCHAR, wins VARCHAR)
### Question ###
What was the sum of the draws for the team that had 11 wins, less than 38 points, and a position smaller than 4?
### Accurate SQL ###
| SELECT SUM(draws) FROM table_name_19 WHERE position < 4 AND wins = 11 AND points < 38 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_60 (game VARCHAR, score VARCHAR)
### Question ###
What game was the final score 82-79?
### Accurate SQL ###
| SELECT game FROM table_name_60 WHERE score = "82-79" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_42 ( year VARCHAR, class VARCHAR )
### Question ###
What year has WSC class?
### Accurate SQL ###
| SELECT year FROM table_name_42 WHERE class = "wsc" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_73 ( points_diff VARCHAR, points_against VARCHAR )
### Question ###
What is points diff when points against is 123?
### Accurate SQL ###
| SELECT points_diff FROM table_name_73 WHERE points_against = "123" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_56 ( southbridge VARCHAR, cpu_support VARCHAR )
### Question ###
What is the Southbridge when the CPU support was athlon, athlonxp, duron( socketa ), alpha21264?
### Accurate SQL ###
| SELECT southbridge FROM table_name_56 WHERE cpu_support = "athlon, athlonxp, duron( socketa ), alpha21264" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_20898602_1 ( player VARCHAR, status VARCHAR, position VARCHAR )
### Question ###
how many players played running back where status is made 53-man roster at start of 2009 season
### Accurate SQL ###
| SELECT COUNT(player) FROM table_20898602_1 WHERE status = "Made 53-man roster at start of 2009 season" AND position = "Running back" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_dev_17 ( "id" int, "gender" string, "white_blood_cell_count_wbc" int, "hemoglobin_a1c_hba1c" float, "cd4_count" int, "dyslipidemia" bool, "renal_disease" bool, "fasting_blood_glucose_fbg" float, "creatinine_clearance_cl" float, "platelet_count" float, "high_density_lipoprotein_cholesterol_hdl_c" int, "smoking" bool, "fasting_triglyceride" int, "NOUSE" float )
### Question ###
fast blood glucose ( fbg ) >= 7 mmol / l, and hemoglobin a1c ( hgba1c ) >= 7 %
### Accurate SQL ###
| SELECT * FROM table_dev_17 WHERE fasting_blood_glucose_fbg >= 7 AND hemoglobin_a1c_hba1c >= 7 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_42 ( date VARCHAR, total VARCHAR )
### Question ###
What date was the total 75 45?
### Accurate SQL ###
| SELECT date FROM table_name_42 WHERE total = "75–45" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_93 ( runner_up VARCHAR, venue VARCHAR, year VARCHAR )
### Question ###
Who was the runner-up in 1980 at the Pocking venue?
### Accurate SQL ###
| SELECT runner_up FROM table_name_93 WHERE venue = "pocking" AND year = "1980" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_66 (votes INTEGER, date VARCHAR, _percentage_of_national_vote VARCHAR)
### Question ###
How many votes were tallied in 1956 with a % of national vote larger than 11.47?
### Accurate SQL ###
| SELECT SUM(votes) FROM table_name_66 WHERE date = "1956" AND _percentage_of_national_vote > 11.47 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) )
TABLE: CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) )
TABLE: CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) )
TABLE: CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) )
TABLE: CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) )
TABLE: CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) )
TABLE: CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) )
### Question ###
For those employees who do not work in departments with managers that have ids between 100 and 200, find first_name and commission_pct , and visualize them by a bar chart, and rank bar in ascending order.
### Accurate SQL ###
| SELECT FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_25773116_2 (winning_driver VARCHAR, date VARCHAR)
### Question ###
Who won the April 11 race?
### Accurate SQL ###
| SELECT winning_driver FROM table_25773116_2 WHERE date = "April 11" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_11694832_1 ( title VARCHAR, production_code VARCHAR )
### Question ###
What is the episode title of the show that had a production code of 3T5764?
### Accurate SQL ###
| SELECT title FROM table_11694832_1 WHERE production_code = "3T5764" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_31 ( mrc_championships INTEGER, solo VARCHAR, pct VARCHAR, co_champions VARCHAR )
### Question ###
What is the average value of MRC Championships with more than 0.685 PCT., more than 1 for co-champions, and less than 5 solo?
### Accurate SQL ###
| SELECT AVG(mrc_championships) FROM table_name_31 WHERE pct > 0.685 AND co_champions > 1 AND solo < 5 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_15196 ( "Name" text, "Hair Color:" text, "Eye Color:" text, "Release Date" text, "Retired?" text )
### Question ###
What is the eye color of Oo-lala Olivia with release date of October 2008?
### Accurate SQL ###
| SELECT "Eye Color:" FROM table_15196 WHERE "Release Date" = 'october 2008' AND "Name" = 'oo-lala olivia' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_55506 ( "PRR Class" text, "Builder\u2019s Model" text, "Build date" text, "Total produced" real, "Wheel arrangement" text, "Service" text, "Power output" text )
### Question ###
What is the PRR class of the freight train built in 1967 with a b-b wheel arrangement?
### Accurate SQL ###
| SELECT "PRR Class" FROM table_55506 WHERE "Wheel arrangement" = 'b-b' AND "Service" = 'freight' AND "Build date" = '1967' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_56 ( opponent VARCHAR, october INTEGER )
### Question ###
What is the Opponent of the game after October 28?
### Accurate SQL ###
| SELECT opponent FROM table_name_56 WHERE october > 28 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_13736 ( "Score" text, "Shooter" text, "Date" text, "Comp" text, "Place" text )
### Question ###
What is the Date of Shooter New Targets from 1989's record?
### Accurate SQL ###
| SELECT "Date" FROM table_13736 WHERE "Shooter" = 'new targets from 1989' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
TABLE: CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text )
TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
### Question ###
what is the average total cost of a hospital which involves the cortisol since 2104?
### Accurate SQL ###
| SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cortisol')) AND STRFTIME('%y', cost.chargetime) >= '2104' GROUP BY cost.patienthealthsystemstayid) AS t1 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_74834 ( "Year" text, "Title" text, "Type" text, "Episodes" text, "Role" text )
### Question ###
what episode is called jewboy
### Accurate SQL ###
| SELECT "Episodes" FROM table_74834 WHERE "Title" = 'jewboy' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_59356 ( "Season" text, "Record" text, "Seed" text, "First Round" text, "Conference Semifinals" text, "Conference Finals" text, "NBA Finals" text )
### Question ###
Which Conference Semifinals has a Conference Finals of denotes division championship?
### Accurate SQL ###
| SELECT "Conference Semifinals" FROM table_59356 WHERE "Conference Finals" = '† denotes division championship' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_67394 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
### Question ###
Name the region for cd with catalog of alca-9203
### Accurate SQL ###
| SELECT "Region" FROM table_67394 WHERE "Format" = 'cd' AND "Catalog" = 'alca-9203' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_93 ( points_1 VARCHAR, position VARCHAR, goal_difference VARCHAR )
### Question ###
What are the points 1 for the team with position less than 13 and goal difference of +16?
### Accurate SQL ###
| SELECT points_1 FROM table_name_93 WHERE position < 13 AND goal_difference = "+16" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_67 ( away_team VARCHAR, tie_no VARCHAR )
### Question ###
Which away team has a Tie no of 14?
### Accurate SQL ###
| SELECT away_team FROM table_name_67 WHERE tie_no = "14" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_30121082_1 (area__acres__ INTEGER, poor_law_union VARCHAR, civil_parish VARCHAR)
### Question ###
What is the greatest area when the Poor Law Union is Skibbereen and the Civil Parish is Tullagh?
### Accurate SQL ###
| SELECT MAX(area__acres__) FROM table_30121082_1 WHERE poor_law_union = "Skibbereen" AND civil_parish = "Tullagh" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_30030477_1 ( original_air_date VARCHAR, written_by VARCHAR )
### Question ###
What dated the episode written by is adam e. fierro & glen mazzara air?
### Accurate SQL ###
| SELECT original_air_date FROM table_30030477_1 WHERE written_by = "Adam E. Fierro & Glen Mazzara" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE VISITORS ( Tourist_ID VARCHAR, Tourist_Details VARCHAR )
TABLE: CREATE TABLE Tourist_Attractions ( Name VARCHAR, Tourist_Attraction_ID VARCHAR )
TABLE: CREATE TABLE VISITS ( Visit_Date VARCHAR, Tourist_Attraction_ID VARCHAR, Tourist_ID VARCHAR )
### Question ###
What are the names of the tourist attractions and the dates when the tourists named Vincent or Vivian visited there?
### Accurate SQL ###
| SELECT T1.Name, T3.Visit_Date FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = "Vincent" OR T2.Tourist_Details = "Vivian" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number )
### Question ###
WordPress Related Questions - 8 Months.
### Accurate SQL ###
| SELECT DISTINCT p.Id AS "ID", p.CreationDate AS "Date", p.Tags AS "Tags" FROM Posts AS p WHERE p.CreationDate BETWEEN '2019-01-01' AND '2019-08-28' AND (p.Tags LIKE '%wordpress%' OR p.Tags LIKE 'yoast%' OR p.Tags LIKE '%woocommerce%' OR p.Tags LIKE 'buddypress%' OR p.Tags LIKE 'bbpress%' OR p.Tags LIKE 'contact-form-7%') ORDER BY p.CreationDate DESC |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_2 (joined VARCHAR, founded VARCHAR, current_conference VARCHAR)
### Question ###
What joined that was founded prior to year 1856 and whose current conference is the Big South (NCAA Division I)?
### Accurate SQL ###
| SELECT joined FROM table_name_2 WHERE founded < 1856 AND current_conference = "big south (ncaa division i)" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text )
TABLE: CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number )
TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number )
TABLE: CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time )
TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time )
TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )
TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time )
### Question ###
what was the name of the lab test which patient 51200 first received the last month?
### Accurate SQL ###
| SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51200) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY labevents.charttime LIMIT 1) |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_87 ( Id VARCHAR )
### Question ###
What is the 1990 value with a 24 in 1995?
### Accurate SQL ###
| SELECT 1990 FROM table_name_87 WHERE 1995 = "24" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_26 ( episode_title VARCHAR, countries_visited VARCHAR )
### Question ###
Which episode title featured a visit to the country of Cuba?
### Accurate SQL ###
| SELECT episode_title FROM table_name_26 WHERE countries_visited = "cuba" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_73900 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text )
### Question ###
which categories fit under the institution calvin college?
### Accurate SQL ###
| SELECT "Type" FROM table_73900 WHERE "Institution" = 'Calvin College' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_10 ( losses VARCHAR, ballarat_fl VARCHAR, against VARCHAR )
### Question ###
How many Losses have a Ballarat FL of melton south, and an Against larger than 1468?
### Accurate SQL ###
| SELECT COUNT(losses) FROM table_name_10 WHERE ballarat_fl = "melton south" AND against > 1468 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE stock ( Shop_ID int, Device_ID int, Quantity int )
TABLE: CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text )
TABLE: CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int )
### Question ###
Give me a pie to show the total number from different software platform.
### Accurate SQL ###
| SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_2 (name VARCHAR, rocket VARCHAR, block VARCHAR)
### Question ###
What name has a Rocket of titan iv(401)b and a Block of block i/ii hybrid?
### Accurate SQL ###
| SELECT name FROM table_name_2 WHERE rocket = "titan iv(401)b" AND block = "block i/ii hybrid" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE reviewer ( rid number, name text )
TABLE: CREATE TABLE movie ( mid number, title text, year number, director text )
TABLE: CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time )
### Question ###
Find the names of all reviewers who have ratings with a NULL value for the date.
### Accurate SQL ###
| SELECT DISTINCT name FROM reviewer AS T1 JOIN rating AS T2 ON T1.rid = T2.rid WHERE ratingdate = "null" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_23316034_23 (dismissals INTEGER, rank VARCHAR)
### Question ###
Name the least dismissals for 4 rank
### Accurate SQL ###
| SELECT MAX(dismissals) FROM table_23316034_23 WHERE rank = 4 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_15869204_5 (high_assists VARCHAR, date VARCHAR)
### Question ###
Name the high assists for december 14
### Accurate SQL ###
| SELECT high_assists FROM table_15869204_5 WHERE date = "December 14" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_53781 ( "Season" real, "Premier" text, "Runner Up" text, "Score" text, "Venue" text, "Attendance" real, "Margin" real )
### Question ###
How many seasons feature essendon, and a Score of 15.12 (102) 9.14 (68)?
### Accurate SQL ###
| SELECT COUNT("Season") FROM table_53781 WHERE "Premier" = 'essendon' AND "Score" = '15.12 (102) – 9.14 (68)' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_10015132_9 (nationality VARCHAR, school_club_team VARCHAR)
### Question ###
What are the nationality of the players on the Fresno State school/club team?
### Accurate SQL ###
| SELECT nationality FROM table_10015132_9 WHERE school_club_team = "Fresno State" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_31 (position INTEGER, drawn VARCHAR, points_1 VARCHAR, goals_for VARCHAR)
### Question ###
what is the position when the points 1 is less than 36, goals for is less than 40 and drawn is less than 9?
### Accurate SQL ###
| SELECT SUM(position) FROM table_name_31 WHERE points_1 < 36 AND goals_for < 40 AND drawn < 9 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
### Question ###
how many days have passed since the first time patient 005-4471 was given a po clear liquids intake on the current intensive care unit visit?
### Accurate SQL ###
| SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471') AND patient.unitdischargetime IS NULL) AND intakeoutput.celllabel = 'po clear liquids' AND intakeoutput.cellpath LIKE '%intake%' ORDER BY intakeoutput.intakeoutputtime LIMIT 1 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_29 ( score VARCHAR, home_team VARCHAR )
### Question ###
What is the score when the home team is queens park rangers?
### Accurate SQL ###
| SELECT score FROM table_name_29 WHERE home_team = "queens park rangers" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_74099 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text, "Primary conference" text )
### Question ###
Where is Robert Morris University-Illinois held?
### Accurate SQL ###
| SELECT "Location" FROM table_74099 WHERE "Institution" = 'Robert Morris University-Illinois' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_33 (number_of_seasons_in_liga_mx INTEGER, club VARCHAR, number_of_seasons_in_top_division VARCHAR)
### Question ###
What is the highest Number of seasons in Liga MX for Club cruz azul, when their season in the top division is higher than 68?
### Accurate SQL ###
| SELECT MAX(number_of_seasons_in_liga_mx) FROM table_name_33 WHERE club = "cruz azul" AND number_of_seasons_in_top_division > 68 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: 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 )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: 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 )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
### Question ###
specify the primary disease of patient orville ford
### Accurate SQL ###
| SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Orville Ford" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number )
TABLE: CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time )
TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text )
TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time )
TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )
TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time )
TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number )
TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
### Question ###
show me the top four most frequent intake events this year?
### Accurate SQL ###
| SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 4) |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_1211 ( "Processor Speed (MHz)" real, "Input Clock (MHz)" text, "Voltage Center (V)" text, "Voltage Range (V)" text, "Part Number" text, "Clock Multiplier" text, "S-Spec Number" text )
### Question ###
What is the voltage range (v) if the clock multiplier is 3x or 2x mode and part number is a80486dx4wb-100?
### Accurate SQL ###
| SELECT COUNT("Voltage Range (V)") FROM table_1211 WHERE "Clock Multiplier" = '3X or 2X mode' AND "Part Number" = 'A80486DX4WB-100' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
TABLE: CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text )
TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
### Question ###
what was the name of the procedure that's been performed to patient 011-59493 two or more times in 06/this year?
### Accurate SQL ###
| SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-59493')) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', treatment.treatmenttime) = '06' GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 >= 2 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_40 (week VARCHAR, away_team VARCHAR, overall_record VARCHAR, home_team VARCHAR, divisional_record VARCHAR)
### Question ###
Can you tell me the Week that has the Home Team of detroit, and the Divisional Record of (3-0), and the Overall Record of (5-1), and the Away Team of minnesota?
### Accurate SQL ###
| SELECT week FROM table_name_40 WHERE home_team = "detroit" AND divisional_record = "(3-0)" AND overall_record = "(5-1)" AND away_team = "minnesota" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other )
TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number )
TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
### Question ###
Vicious Dog based on Strangeness.
### Accurate SQL ###
| SELECT COUNT(*), OwnerUserId FROM Posts WHERE PostTypeId = 2 AND Id IN (SELECT AcceptedAnswerId FROM Posts) GROUP BY OwnerUserId |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_43764 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text )
### Question ###
Who was the leading scorer on April 7?
### Accurate SQL ###
| SELECT "Leading scorer" FROM table_43764 WHERE "Date" = 'april 7' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_76299 ( "noun root (meaning)" text, "case suffix (case)" text, "postposition" text, "full word" text, "English meaning" text )
### Question ###
What is the Full Word, when Case Suffix (case) is '-sa (dative)'?
### Accurate SQL ###
| SELECT "full word" FROM table_76299 WHERE "case suffix (case)" = '-sa (dative)' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_42 ( catalog VARCHAR, region VARCHAR )
### Question ###
What is the Catalog number in the Region of France?
### Accurate SQL ###
| SELECT catalog FROM table_name_42 WHERE region = "france" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_51243 ( "Year" text, "Name" text, "Film" text, "Role" text, "Status" text )
### Question ###
What status has a role?
### Accurate SQL ###
| SELECT "Status" FROM table_51243 WHERE "Role" = 'role' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number )
TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
### Question ###
Top 5 Tags (with overall posts) and top 5 posts within each (by score).
### Accurate SQL ###
| SELECT * FROM PostTags AS t1 LEFT JOIN Tags AS t2 ON t1.TagId = t2.Id WHERE PostId IN (11227809, 927358) |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Trained_In ( Physician INTEGER, Treatment INTEGER, CertificationDate DATETIME, CertificationExpires DATETIME )
TABLE: CREATE TABLE Prescribes ( Physician INTEGER, Patient INTEGER, Medication INTEGER, Date DATETIME, Appointment INTEGER, Dose VARCHAR(30) )
TABLE: CREATE TABLE Room ( RoomNumber INTEGER, RoomType VARCHAR(30), BlockFloor INTEGER, BlockCode INTEGER, Unavailable BOOLEAN )
TABLE: CREATE TABLE Procedures ( Code INTEGER, Name VARCHAR(30), Cost REAL )
TABLE: CREATE TABLE Nurse ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), Registered BOOLEAN, SSN INTEGER )
TABLE: CREATE TABLE Undergoes ( Patient INTEGER, Procedures INTEGER, Stay INTEGER, DateUndergoes DATETIME, Physician INTEGER, AssistingNurse INTEGER )
TABLE: CREATE TABLE Affiliated_With ( Physician INTEGER, Department INTEGER, PrimaryAffiliation BOOLEAN )
TABLE: CREATE TABLE Stay ( StayID INTEGER, Patient INTEGER, Room INTEGER, StayStart DATETIME, StayEnd DATETIME )
TABLE: CREATE TABLE Block ( BlockFloor INTEGER, BlockCode INTEGER )
TABLE: CREATE TABLE Medication ( Code INTEGER, Name VARCHAR(30), Brand VARCHAR(30), Description VARCHAR(30) )
TABLE: CREATE TABLE On_Call ( Nurse INTEGER, BlockFloor INTEGER, BlockCode INTEGER, OnCallStart DATETIME, OnCallEnd DATETIME )
TABLE: CREATE TABLE Patient ( SSN INTEGER, Name VARCHAR(30), Address VARCHAR(30), Phone VARCHAR(30), InsuranceID INTEGER, PCP INTEGER )
TABLE: CREATE TABLE Physician ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), SSN INTEGER )
TABLE: CREATE TABLE Department ( DepartmentID INTEGER, Name VARCHAR(30), Head INTEGER )
TABLE: CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, PrepNurse INTEGER, Physician INTEGER, Start DATETIME, End DATETIME, ExaminationRoom TEXT )
### Question ###
What are the names of all the physicians who took appointments, and count them by a bar chart, and rank from low to high by the y-axis please.
### Accurate SQL ###
| SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Physician AS T2 ON T1.Physician = T2.EmployeeID GROUP BY Name ORDER BY COUNT(Name) |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_203_652 ( id number, "goal" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
### Question ###
what is the total number times panama was the opponent ?
### Accurate SQL ###
| SELECT COUNT(*) FROM table_203_652 WHERE "opponent" = 'panama' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_82 ( year VARCHAR, role_episode VARCHAR )
### Question ###
what is the year when the role/episode is david duchovny?
### Accurate SQL ###
| SELECT year FROM table_name_82 WHERE role_episode = "david duchovny" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_30431 ( "Club name" text, "Name of team song" text, "Basis for team song" text, "First used as team song" text, "Writer/composer" text )
### Question ###
Name the team that has a song writer named larry spokes.
### Accurate SQL ###
| SELECT "Club name" FROM table_30431 WHERE "Writer/composer" = 'Larry Spokes' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_1566852_10 ( cover_model VARCHAR, interview_subject VARCHAR )
### Question ###
Who were the cover models in the edition that included Benicio Del Toro as the interview subject?
### Accurate SQL ###
| SELECT cover_model FROM table_1566852_10 WHERE interview_subject = "Benicio del Toro" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_60 (event VARCHAR, method VARCHAR, record VARCHAR)
### Question ###
What is the event when the method was tko (punches), and the record was 7-1?
### Accurate SQL ###
| SELECT event FROM table_name_60 WHERE method = "tko (punches)" AND record = "7-1" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: 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 )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: 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 )
### Question ###
tell me the age and primary disease of patient with patient id 65652.
### Accurate SQL ###
| SELECT demographic.age, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "65652" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_58 ( score VARCHAR, club VARCHAR )
### Question ###
What's the final score of the competition that features the club of fk Austria wien?
### Accurate SQL ###
| SELECT score FROM table_name_58 WHERE club = "fk austria wien" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_87 ( tournament VARCHAR )
### Question ###
Which tournament had a 2010 result of A?
### Accurate SQL ###
| SELECT tournament FROM table_name_87 WHERE 2010 = "a" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_69464 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
### Question ###
What day did the record reach 15-4?
### Accurate SQL ###
| SELECT "Date" FROM table_69464 WHERE "Record" = '15-4' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_18600760_3 (latitude VARCHAR, township VARCHAR)
### Question ###
What was the latitude of the Clearwater townsship?
### Accurate SQL ###
| SELECT latitude FROM table_18600760_3 WHERE township = "Clearwater" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: 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 )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: 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 )
### Question ###
what is marital status and admission type of subject name jerry deberry?
### Accurate SQL ###
| SELECT demographic.marital_status, demographic.admission_type FROM demographic WHERE demographic.name = "Jerry Deberry" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_66 (pop_dens INTEGER, district VARCHAR, noof_settlements VARCHAR)
### Question ###
What is the lowest population density of Strakonice (st) with more than 112 settlements?
### Accurate SQL ###
| SELECT MIN(pop_dens) FROM table_name_66 WHERE district = "strakonice (st)" AND noof_settlements > 112 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
TABLE: CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text )
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
### Question ###
what was the number of times that patient 006-80884 received sorensons on this month/29?
### Accurate SQL ###
| SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.celllabel = 'sorensons' AND DATETIME(intakeoutput.intakeoutputtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND STRFTIME('%d', intakeoutput.intakeoutputtime) = '29' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: 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 )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: 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 )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
### Question ###
what is the number of patients whose gender is f and diagnoses short title is gram-neg septicemia nec?
### Accurate SQL ###
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Gram-neg septicemia NEC" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_21 ( home_team VARCHAR, result VARCHAR )
### Question ###
WHAT IS THE HOME TEAM, RESULT 99-112?
### Accurate SQL ###
| SELECT home_team FROM table_name_21 WHERE result = "99-112" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_88 ( notes VARCHAR, year VARCHAR )
### Question ###
What are 2004's notes?
### Accurate SQL ###
| SELECT notes FROM table_name_88 WHERE year = 2004 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_23286223_8 ( record VARCHAR, high_assists VARCHAR )
### Question ###
What was the record at the game where Deron Williams (6) did the high assists?
### Accurate SQL ###
| SELECT record FROM table_23286223_8 WHERE high_assists = "Deron Williams (6)" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_1682026_6 (profits__billion_$_ VARCHAR, company VARCHAR)
### Question ###
What are the profits in billions for Berkshire Hathaway?
### Accurate SQL ###
| SELECT profits__billion_$_ FROM table_1682026_6 WHERE company = "Berkshire Hathaway" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: 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 )
TABLE: 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 )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
### Question ###
give the number of patients whose admission location is transfer from hosp/extram and who were admitted before the year 2167.
### Accurate SQL ###
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2167" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_58 (attendance INTEGER, result VARCHAR)
### Question ###
What is the lowest Attendance at a game with the Result of w 25-17?
### Accurate SQL ###
| SELECT MIN(attendance) FROM table_name_58 WHERE result = "w 25-17" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_1301373_7 (captain VARCHAR, international_marquee VARCHAR)
### Question ###
Name the captain for emile heskey
### Accurate SQL ###
| SELECT captain FROM table_1301373_7 WHERE international_marquee = "Emile Heskey" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text )
TABLE: CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int )
TABLE: CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int )
TABLE: CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text )
### Question ###
Bar chart x axis meter 600 y axis id, order by the ID from high to low.
### Accurate SQL ###
| SELECT meter_600, ID FROM swimmer ORDER BY ID DESC |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_2909 ( "Episode" text, "First broadcast" text, "Davids team" text, "Lees team" text, "Scores" text )
### Question ###
How many David's team for the Lees Team of Deborah Meaden and Mark Watson?
### Accurate SQL ###
| SELECT COUNT("Davids team") FROM table_2909 WHERE "Lees team" = 'Deborah Meaden and Mark Watson' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: 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 )
TABLE: 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 )
### Question ###
how many patients died in or before 2165 and tested for albumin in lab?
### Accurate SQL ###
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2165.0" AND lab.label = "Albumin" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_51507 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
### Question ###
What's the value for 2007 when 2011 is a and 2009 is q2?
### Accurate SQL ###
| SELECT "2007" FROM table_51507 WHERE "2011" = 'a' AND "2009" = 'q2' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_22879323_10 (date VARCHAR, record VARCHAR)
### Question ###
What date was the record 11-67?
### Accurate SQL ###
| SELECT date FROM table_22879323_10 WHERE record = "11-67" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_97 ( junior_high_school__12_15_yrs_ VARCHAR, gender VARCHAR )
### Question ###
Which junior high school has male and female genders?
### Accurate SQL ###
| SELECT junior_high_school__12_15_yrs_ FROM table_name_97 WHERE gender = "male and female" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text )
TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time )
TABLE: CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time )
TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number )
TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )
TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time )
TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number )
### Question ###
what was the maximum yearly number of patients who were admitted for streptococcus group b until 3 years ago?
### Accurate SQL ###
| SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'streptococcus group b') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY STRFTIME('%y', diagnoses_icd.charttime)) AS t1 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_94 ( location VARCHAR, capacity INTEGER )
### Question ###
Which location has a capacity larger than 52,000?
### Accurate SQL ###
| SELECT location FROM table_name_94 WHERE capacity > 52 OFFSET 000 |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_23465864_5 (mon_24_aug VARCHAR, fri_28_aug VARCHAR)
### Question ###
What is the value for Monday August 24 if Friday August 28 is 26' 04.60 86.814mph?
### Accurate SQL ###
| SELECT mon_24_aug FROM table_23465864_5 WHERE fri_28_aug = "26' 04.60 86.814mph" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_27755603_7 ( high_assists VARCHAR, team VARCHAR )
### Question ###
Who had the most assists agains New Orleans?
### Accurate SQL ###
| SELECT high_assists FROM table_27755603_7 WHERE team = "New Orleans" |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_21602 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
### Question ###
Who had the high rebounds when the team played Sacramento?
### Accurate SQL ###
| SELECT "High rebounds" FROM table_21602 WHERE "Team" = 'Sacramento' |
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_98 (name VARCHAR, nat VARCHAR, app_l_c_e_ VARCHAR)
### Question ###
Who has a nationality of GRE and an App(L/C/E) of 49 (40/8/1)?
### Accurate SQL ###
| SELECT name FROM table_name_98 WHERE nat = "gre" AND app_l_c_e_ = "49 (40/8/1)" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.