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 ( region VARCHAR, catalog VARCHAR )
### Question ###
What is the Region of the 1766390 Catalog?
### Accurate SQL ###
| SELECT region FROM table_name_71 WHERE catalog = "1766390" |
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_25459168_2 (fastest_lap VARCHAR, pole_position VARCHAR)
### Question ###
Who won the fastest lap if Anders Krohn won the pole position?
### Accurate SQL ###
| SELECT fastest_lap FROM table_25459168_2 WHERE pole_position = "Anders Krohn" |
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_2780146_6 (pm__g_kwh_ VARCHAR, co__g_kwh_ VARCHAR)
### Question ###
What's the PM for the standard with 12.3 g/kWh CO?
### Accurate SQL ###
| SELECT pm__g_kwh_ FROM table_2780146_6 WHERE co__g_kwh_ = "12.3" |
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_32847 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
### Question ###
What away team did Carlton play?
### Accurate SQL ###
| SELECT "Away team" FROM table_32847 WHERE "Home team" = 'carlton' |
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_426 ( id number, "year" number, "title" text, "peak chart positions\naus" number, "peak chart positions\nnz" number, "peak chart positions\nuk" number, "album" text )
### Question ###
how many single only releases did the triffids release ?
### Accurate SQL ###
| SELECT COUNT(*) FROM table_203_426 WHERE "album" = 'single-only release' |
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 medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime 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 )
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 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 microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
### Question ###
what is the total blood loss output for patient 022-142620 on 04/30/2104?
### Accurate SQL ###
| SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-142620')) AND intakeoutput.celllabel = 'blood loss' AND intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) = '2104-04-30' |
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 On_Call ( Nurse INTEGER, BlockFloor INTEGER, BlockCode INTEGER, OnCallStart DATETIME, OnCallEnd DATETIME )
TABLE: CREATE TABLE Stay ( StayID INTEGER, Patient INTEGER, Room INTEGER, StayStart DATETIME, StayEnd DATETIME )
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 Department ( DepartmentID INTEGER, Name VARCHAR(30), Head INTEGER )
TABLE: CREATE TABLE Physician ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), SSN INTEGER )
TABLE: CREATE TABLE Procedures ( Code INTEGER, Name VARCHAR(30), Cost REAL )
TABLE: CREATE TABLE Trained_In ( Physician INTEGER, Treatment INTEGER, CertificationDate DATETIME, CertificationExpires DATETIME )
TABLE: CREATE TABLE Room ( RoomNumber INTEGER, RoomType VARCHAR(30), BlockFloor INTEGER, BlockCode INTEGER, Unavailable BOOLEAN )
TABLE: CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, PrepNurse INTEGER, Physician INTEGER, Start DATETIME, End DATETIME, ExaminationRoom TEXT )
TABLE: CREATE TABLE Patient ( SSN INTEGER, Name VARCHAR(30), Address VARCHAR(30), Phone VARCHAR(30), InsuranceID INTEGER, PCP INTEGER )
TABLE: CREATE TABLE Block ( BlockFloor INTEGER, BlockCode INTEGER )
TABLE: CREATE TABLE Nurse ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), Registered BOOLEAN, SSN INTEGER )
TABLE: CREATE TABLE Medication ( Code INTEGER, Name VARCHAR(30), Brand VARCHAR(30), Description VARCHAR(30) )
TABLE: CREATE TABLE Prescribes ( Physician INTEGER, Patient INTEGER, Medication INTEGER, Date DATETIME, Appointment INTEGER, Dose VARCHAR(30) )
### Question ###
Return a bar chart on how many patients do each physician take care of? List their names and number of patients they take care of, and show by the Y-axis in desc.
### Accurate SQL ###
| SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY COUNT(*) 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_26316 ( "Rank" real, "Operators Name" text, "Technology" text, "Subscribers (in millions)" text, "Ownership" text, "Market Share" text )
### Question ###
What was the rank of operator whose technology is CDMA EVDO?
### Accurate SQL ###
| SELECT MIN("Rank") FROM table_26316 WHERE "Technology" = 'CDMA EVDO' |
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_17521433_1 ( country VARCHAR, swimsuit VARCHAR )
### Question ###
What country had a swimsuit score of 8.788?
### Accurate SQL ###
| SELECT country FROM table_17521433_1 WHERE swimsuit = "8.788" |
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 diagnoses ( 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 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 ###
provide the number of patients whose ethnicity is white - russian and lab test name is monocytes?
### Accurate SQL ###
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND lab.label = "Monocytes" |
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 Plays_Games ( StuID INTEGER, GameID INTEGER, Hours_Played INTEGER )
TABLE: CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) )
TABLE: CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, OnScholarship VARCHAR(1) )
TABLE: CREATE TABLE Video_Games ( GameID INTEGER, GName VARCHAR(40), GType VARCHAR(40) )
### Question ###
What are ids and total number of hours played for each game.
### Accurate SQL ###
| SELECT GameID, SUM(Hours_Played) FROM Plays_Games GROUP BY GameID |
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_5987 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
### Question ###
Rank of 5, and a Silver larger than 0 had what sum of total?
### Accurate SQL ###
| SELECT SUM("Total") FROM table_5987 WHERE "Rank" = '5' AND "Silver" > '0' |
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_57 ( draw VARCHAR, match VARCHAR, team VARCHAR )
### Question ###
What was the draw for Lp Gda sk with a match of 8?
### Accurate SQL ###
| SELECT draw FROM table_name_57 WHERE match = "8" AND team = "lpż gdańsk" |
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_91 ( team_1 VARCHAR )
### Question ###
What is the 1st round result for ECAC Chaumont (D2) as team 1?
### Accurate SQL ###
| SELECT 1 AS st_round FROM table_name_91 WHERE team_1 = "ecac chaumont (d2)" |
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_14023 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
### Question ###
Who did the Eagle's play on November 5, 1961?
### Accurate SQL ###
| SELECT "Opponent" FROM table_14023 WHERE "Date" = 'november 5, 1961' |
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_573 ( id number, "#" number, "title" text, "performer(s)" text, "film" text, "length" text )
### Question ###
which was from the lion king , can you feel the love tonight or candle on the water ?
### Accurate SQL ###
| SELECT "title" FROM table_204_573 WHERE "title" IN ('"can you feel the love tonight"', '"candle on the water"') AND "film" = 'the lion king' |
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 candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real )
TABLE: CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real )
### Question ###
Draw a bar chart about the distribution of Date_of_Birth and Height , sort from low to high by the x axis.
### Accurate SQL ###
| SELECT Date_of_Birth, Height FROM people ORDER BY Date_of_Birth |
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_7 (result INTEGER, name VARCHAR)
### Question ###
What is Anna Rogowska's average result?
### Accurate SQL ###
| SELECT AVG(result) FROM table_name_7 WHERE name = "anna rogowska" |
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_11323 ( "Tournament" text, "Wins" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
### Question ###
What is the lowest number of events a tournament with more tha 5 cuts and less than 13 top-25 has?
### Accurate SQL ###
| SELECT MIN("Events") FROM table_11323 WHERE "Cuts made" > '5' AND "Top-25" < '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_10722506_6 ( record VARCHAR, round_of_32 VARCHAR, conference VARCHAR )
### Question ###
What is the record when round of 32 is 0 and metro atlantic conference?
### Accurate SQL ###
| SELECT record FROM table_10722506_6 WHERE round_of_32 = 0 AND conference = "Metro Atlantic" |
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_96 ( winner VARCHAR, prize VARCHAR )
### Question ###
Who is the winner of the prize of 93,000?
### Accurate SQL ###
| SELECT winner FROM table_name_96 WHERE prize = "€93,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_29565673_2 (w VARCHAR, pa VARCHAR)
### Question ###
What is the win record where the pa record is 62?
### Accurate SQL ###
| SELECT w FROM table_29565673_2 WHERE pa = 62 |
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 students ( student_id number, date_of_registration time, date_of_latest_logon time, login_name text, password text, personal_name text, middle_name text, family_name text )
TABLE: CREATE TABLE subjects ( subject_id number, subject_name text )
TABLE: CREATE TABLE courses ( course_id number, author_id number, subject_id number, course_name text, course_description text )
TABLE: CREATE TABLE student_tests_taken ( registration_id number, date_test_taken time, test_result text )
TABLE: CREATE TABLE student_course_enrolment ( registration_id number, student_id number, course_id number, date_of_enrolment time, date_of_completion time )
TABLE: CREATE TABLE course_authors_and_tutors ( author_id number, author_tutor_atb text, login_name text, password text, personal_name text, middle_name text, family_name text, gender_mf text, address_line_1 text )
### Question ###
What are the descriptions of the courses with name 'database'?
### Accurate SQL ###
| SELECT course_description FROM courses WHERE course_name = "database" |
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 csu_fees ( campusfee INTEGER, YEAR VARCHAR )
### Question ###
Find the average fee on a CSU campus in 1996
### Accurate SQL ###
| SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 1996 |
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_38 (driver VARCHAR, grid VARCHAR)
### Question ###
Who drove the car with a grid of 7?
### Accurate SQL ###
| SELECT driver FROM table_name_38 WHERE grid = 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 PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
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 ReviewTaskResultTypes ( 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 ReviewTaskTypes ( 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 FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
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 PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
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 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 )
### Question ###
Your comments' votes with Links.
### Accurate SQL ###
| SELECT Score, CreationDate, Id AS "comment_link", Text FROM Comments WHERE UserId = '##User:int##' ORDER BY Score 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_23050383_1 (kei VARCHAR, economic_incentive_regime VARCHAR)
### Question ###
How many KEI catagories are listed when the economic incentive regime is 2.56?
### Accurate SQL ###
| SELECT COUNT(kei) FROM table_23050383_1 WHERE economic_incentive_regime = "2.56" |
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 authors ( authid number, lname text, fname text )
TABLE: CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number )
TABLE: CREATE TABLE papers ( paperid number, title text )
TABLE: CREATE TABLE inst ( instid number, name text, country text )
### Question ###
Which authors belong to the institution 'Google'? Show the first names and last names.
### Accurate SQL ###
| SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google" |
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_277 ( id number, "region" text, "country" text, "location" text, "size (m)" text, "payload (metric tonnes)" text, "degrees of freedom" number, "x horiz disp (mm)" number, "y horiz disp (mm)" number, "z vert disp (mm)" number, "x horiz vel (mm/s)" number, "y horiz vel (mm/s)" number, "z vert vel (mm/s)" number, "x horiz accel (m/s2)" number, "y horiz accel (m/s2)" number, "z vert accel (m/s2)" number, "max freq (hz)" text, "details checked" text )
### Question ###
which is the other besides asia the most region charted
### Accurate SQL ###
| SELECT "region" FROM table_204_277 WHERE "region" <> 'asia' GROUP BY "region" ORDER BY COUNT(*) DESC 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_51 (opponent VARCHAR, november VARCHAR, game VARCHAR)
### Question ###
Can you tell me the Opponent that has the November larger than 26, and the Game larger than 18?
### Accurate SQL ###
| SELECT opponent FROM table_name_51 WHERE november > 26 AND game > 18 |
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
TABLE: CREATE TABLE diagnoses_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 )
TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom 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 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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text )
TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time )
TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text )
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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 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 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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
### Question ###
what are the five most frequently prescribed drugs for patients, who were also prescribed isosorbide mononitrate (extended release) at the same time, in a year before?
### Accurate SQL ###
| SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'isosorbide mononitrate (extended release)' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 5 |
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_11148572_1 ( mls_cup_winner VARCHAR, mls_cup_runner_up VARCHAR )
### Question ###
What is the name of the shield winner in which the mls cup winner and mls cup runner up is colorado rapids?
### Accurate SQL ###
| SELECT mls_cup_winner FROM table_11148572_1 WHERE mls_cup_runner_up = "Colorado Rapids" |
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_44033 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
### Question ###
Who was the away team when the home team was Ramsgate?
### Accurate SQL ###
| SELECT "Away team" FROM table_44033 WHERE "Home team" = 'ramsgate' |
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_83 ( company_or_product_name VARCHAR, episode VARCHAR, investing_dragon_s_ VARCHAR )
### Question ###
What is the name of the Company or Product that is Episode 3 and is suppoted by Investing Dragon Deborah Meaden?
### Accurate SQL ###
| SELECT company_or_product_name FROM table_name_83 WHERE episode = "episode 3" AND investing_dragon_s_ = "deborah meaden" |
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 broadcast ( Channel_ID int, Program_ID int, Time_of_day text )
TABLE: CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text )
TABLE: CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real )
TABLE: CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date text, Share_in_percent real )
### Question ###
Count the number of programs broadcast for each time section of a day Show bar chart, order Y-axis in ascending order.
### Accurate SQL ###
| SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day ORDER BY COUNT(*) |
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 (venue VARCHAR, against INTEGER)
### Question ###
Which Venue has a Against smaller than 7?
### Accurate SQL ###
| SELECT venue FROM table_name_31 WHERE against < 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_204_320 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
### Question ###
which countries have the least amount of total medals ?
### Accurate SQL ###
| SELECT "nation" FROM table_204_320 WHERE "total" = (SELECT MIN("total") FROM table_204_320) |
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_16744 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
### Question ###
Did the I Brazilian Grand Prix have a report?
### Accurate SQL ###
| SELECT "Report" FROM table_16744 WHERE "Race Name" = 'I Brazilian Grand Prix' |
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_13966 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
### Question ###
What is the lowest number of f/laps in the 5th position?
### Accurate SQL ###
| SELECT MIN("F/Laps") FROM table_13966 WHERE "Position" = '5th' |
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 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment 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 ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE FlagTypes ( 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 )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
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 PostTypes ( Id number, Name text )
TABLE: CREATE TABLE PostTags ( PostId number, TagId 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId 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 CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense 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 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 )
### Question ###
Brazilian Tag League Ranking All Time.
### Accurate SQL ###
| SELECT p.* FROM Users AS u, Posts AS p, PostTags AS pt, Tags AS t WHERE t.TagName = 'java' AND pt.TagId = t.Id AND pt.PostId = p.ParentId AND p.PostTypeId = 2 AND u.Id = p.OwnerUserId AND u.Id = 1064325 |
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_35389 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
### Question ###
What was the pick number for Deji Karim, in a round lower than 6?
### Accurate SQL ###
| SELECT AVG("Pick #") FROM table_35389 WHERE "Name" = 'deji karim' AND "Round" < '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_name_78 ( date VARCHAR, record VARCHAR )
### Question ###
Record of 19 16 occurred on what date?
### Accurate SQL ###
| SELECT date FROM table_name_78 WHERE record = "19–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_72 ( no_in_season INTEGER, written_by VARCHAR )
### Question ###
Which episode was the last written by chris hawkshaw this season?
### Accurate SQL ###
| SELECT MAX(no_in_season) FROM table_name_72 WHERE written_by = "chris hawkshaw" |
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 basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text )
TABLE: CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text )
### Question ###
Find ACC_Regular_Season and School_ID , and visualize them by a bar chart, and show in asc by the x axis please.
### Accurate SQL ###
| SELECT ACC_Regular_Season, School_ID FROM basketball_match ORDER BY ACC_Regular_Season |
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 (rider VARCHAR, time VARCHAR, grid VARCHAR, laps VARCHAR)
### Question ###
Which Rider has a Grid larger than 6, and has Laps of 28, and a Time of +39.476?
### Accurate SQL ###
| SELECT rider FROM table_name_42 WHERE grid > 6 AND laps = 28 AND time = "+39.476" |
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_31672 ( "Year" text, "Broadcast date" text, "BBC One total viewing" text, "BBC One Rank" text, "BBC Two total viewing" text, "BBC Two Rank" text )
### Question ###
What is the BBC 2 rank when BBC 1 is 1st rank and the total viewing is 9,840,000?
### Accurate SQL ###
| SELECT "BBC Two Rank" FROM table_31672 WHERE "BBC One Rank" = '1st' AND "BBC One total viewing" = '9,840,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 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
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 )
### Question ###
get me the number of patients suffering from celo-vessicle fistula primary disease.
### Accurate SQL ###
| SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CELO-VESSICLE FISTULA" |
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_52909 ( "Ship" text, "Date Commissioned" real, "Gross Tonnage" real, "Propulsion" text, "Material" text )
### Question ###
Tell me the lowest date commissioned for iron rmsrhone and gross tonnage less than 2,738
### Accurate SQL ###
| SELECT MIN("Date Commissioned") FROM table_52909 WHERE "Material" = 'iron' AND "Ship" = 'rmsrhone' AND "Gross Tonnage" < '2,738' |
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_59869 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Attendance" real )
### Question ###
What is the highest attendance of the game with eastwood town as the away team?
### Accurate SQL ###
| SELECT MAX("Attendance") FROM table_59869 WHERE "Away team" = 'eastwood town' |
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_25 (Regular VARCHAR, team VARCHAR, tournament VARCHAR, total VARCHAR)
### Question ###
How many regular season titles did Kansas receive when they received fewer than 2 tournament titles and more than 0 total titles?
### Accurate SQL ###
| SELECT Regular AS season FROM table_name_25 WHERE tournament < 2 AND total > 0 AND team = "kansas" |
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_66106 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
### Question ###
The game with 13 as the tie no had what as the score?
### Accurate SQL ###
| SELECT "Score" FROM table_66106 WHERE "Tie no" = '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_name_99 (money___$__ VARCHAR, player VARCHAR)
### Question ###
what is the money ($) for player justin leonard?
### Accurate SQL ###
| SELECT money___$__ FROM table_name_99 WHERE player = "justin leonard" |
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 class_of_service ( booking_class varchar, rank int, class_description text )
TABLE: CREATE TABLE month ( month_number int, month_name text )
TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )
TABLE: CREATE TABLE code_description ( code varchar, description text )
TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar )
TABLE: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int )
TABLE: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar )
TABLE: CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar )
TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar )
TABLE: CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int )
TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int )
TABLE: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text )
TABLE: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text )
TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar )
TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text )
TABLE: CREATE TABLE days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar )
### Question ###
all UA flights with stopovers in DENVER
### Accurate SQL ###
| SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight_stop.stop_airport = airport_service.airport_code AND flight.airline_code = 'UA' AND flight.flight_id = flight_stop.flight_id |
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 PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name 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 CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE FlagTypes ( 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 Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount 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 PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTaskStates ( 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 )
### Question ###
Gold Java Badge Ranking in South Africa. This query retrieves all the gold java badge users and ranks them according to their gold badge date received.
### Accurate SQL ###
| SELECT b.UserId, MAX(b.Date) AS DateReceived, u.DisplayName FROM Users AS u, Badges AS b WHERE b.Name = 'java' AND u.Id = b.UserId AND LOWER(u.Location) LIKE '%russia%' GROUP BY b.UserId, u.DisplayName HAVING COUNT(*) > 2 ORDER BY DateReceived |
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_16457934_5 ( Id VARCHAR )
### Question ###
What is the minimum if 40 to 44?
### Accurate SQL ###
| SELECT MIN(40 AS _to_44) FROM table_16457934_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_name_29 (team VARCHAR, school VARCHAR)
### Question ###
What is the name of the School of the Sussex Tech's Team?
### Accurate SQL ###
| SELECT team FROM table_name_29 WHERE school = "sussex tech" |
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 ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int )
TABLE: CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text )
### Question ###
Show different types of ships and the average tonnage of ships of each type in a bar chart, and could you sort by the x-axis in ascending please?
### Accurate SQL ###
| SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY Type |
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 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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
### Question ###
how many patients in the 1020 ward until 2104?
### Accurate SQL ###
| SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 1020 AND STRFTIME('%y', patient.unitadmittime) <= '2104' |
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 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 )
### Question ###
what is drug name of drug code abac300?
### Accurate SQL ###
| SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ABAC300" |
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_3312 ( "Position" real, "Sail number" text, "Yacht" text, "State/country" text, "Yacht type" text, "LOA (Metres)" text, "Skipper" text, "Corrected time d:hh:mm:ss" text )
### Question ###
How many yachts show a corrected time d:hh:mm:ss is 4:00:05:35?
### Accurate SQL ###
| SELECT COUNT("Yacht") FROM table_3312 WHERE "Corrected time d:hh:mm:ss" = '4:00:05: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_38 ( swimsuit INTEGER, average VARCHAR )
### Question ###
What is the lowest swimsuit for a contestant with an average of 9.125?
### Accurate SQL ###
| SELECT MIN(swimsuit) FROM table_name_38 WHERE average = 9.125 |
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 products ( color_code VARCHAR, product_name VARCHAR )
TABLE: CREATE TABLE ref_colors ( color_description VARCHAR, color_code VARCHAR )
### Question ###
What is the color code and description of the product named 'chervil'?
### Accurate SQL ###
| SELECT t1.color_code, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = "chervil" |
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 month ( month_number int, month_name text )
TABLE: CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int, time_elapsed int, to_airport varchar )
TABLE: CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar )
TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text )
TABLE: CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int )
TABLE: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text )
TABLE: CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_miles int, pressurized varchar )
TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text )
TABLE: CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text )
TABLE: CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int )
TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
TABLE: CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar )
TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar )
TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text )
TABLE: CREATE TABLE code_description ( code varchar, description text )
TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int )
TABLE: CREATE TABLE days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
TABLE: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar )
### Question ###
give me the flights from PITTSBURGH to LOS ANGELES thursday evening
### Accurate SQL ###
| SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.departure_time BETWEEN 1800 AND 2200 |
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_34512 ( "Rank" text, "Player" text, "Position" text, "Career" text, "Points" real )
### Question ###
What are the highest points that Emmitt Smith had?
### Accurate SQL ###
| SELECT MAX("Points") FROM table_34512 WHERE "Player" = 'emmitt smith' |
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_24798489_1 ( challenge_winner VARCHAR, original_airdate VARCHAR )
### Question ###
Who was the challenge winner in the episode that originally aired on January 28, 2009?
### Accurate SQL ###
| SELECT challenge_winner FROM table_24798489_1 WHERE original_airdate = "January 28, 2009" |
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 member (member_id VARCHAR, Hometown VARCHAR)
TABLE: CREATE TABLE branch (name VARCHAR, branch_id VARCHAR)
TABLE: CREATE TABLE membership_register_branch (branch_id VARCHAR, member_id VARCHAR)
### Question ###
Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.
### Accurate SQL ###
| SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Louisville , Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Hiram , Georgia' |
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 nomination ( Artwork_ID int, Festival_ID int, Result text )
TABLE: CREATE TABLE festival_detail ( Festival_ID int, Festival_Name text, Chair_Name text, Location text, Year int, Num_of_Audience int )
TABLE: CREATE TABLE artwork ( Artwork_ID int, Type text, Name text )
### Question ###
Show the total number from each type, and I want to sort names from high to low order.
### Accurate SQL ###
| SELECT Type, COUNT(*) FROM artwork GROUP BY Type ORDER BY Type 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_10260 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text )
### Question ###
Which player plays for Illinois?
### Accurate SQL ###
| SELECT "Player" FROM table_10260 WHERE "School/Club Team/Country" = '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_23 ( silver INTEGER, nation VARCHAR, total VARCHAR )
### Question ###
What average silver has belarus as the nation, with a total less than 1?
### Accurate SQL ###
| SELECT AVG(silver) FROM table_name_23 WHERE nation = "belarus" AND total < 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 region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text )
TABLE: CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text )
TABLE: CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text )
TABLE: CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int )
### Question ###
Bar chart x axis left office y axis the number of left office, show total number from low to high order.
### Accurate SQL ###
| SELECT Left_office, COUNT(Left_office) FROM party ORDER BY COUNT(Left_office) |
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 ( bronze VARCHAR, sport VARCHAR )
### Question ###
Tell me the total number of Bronze for futsal
### Accurate SQL ###
| SELECT COUNT(bronze) FROM table_name_67 WHERE sport = "futsal" |
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_197286_4 ( distance VARCHAR, direction VARCHAR )
### Question ###
Name the distance from north
### Accurate SQL ###
| SELECT distance FROM table_197286_4 WHERE direction = "North" |
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_21799 ( "Scientific name" text, "Common name" text, "Length (male)" text, "Length (female)" text, "Color" text, "Lifespan (years)" text )
### Question ###
Name the common name for furcifer pardalis
### Accurate SQL ###
| SELECT "Common name" FROM table_21799 WHERE "Scientific name" = 'Furcifer pardalis' |
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_11452830_2 ( attendance VARCHAR, record VARCHAR )
### Question ###
How many crowds watched the game where the record was 1-3?
### Accurate SQL ###
| SELECT COUNT(attendance) FROM table_11452830_2 WHERE record = "1-3" |
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_26375386_28 (average VARCHAR, number_of_dances VARCHAR)
### Question ###
What is every average when number of dances is 1?
### Accurate SQL ###
| SELECT average FROM table_26375386_28 WHERE number_of_dances = 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_26561508_1 ( written_by VARCHAR, production_code VARCHAR )
### Question ###
Who was the writter for the episode identified by the production code 2t5954?
### Accurate SQL ###
| SELECT written_by FROM table_26561508_1 WHERE production_code = "2T5954" |
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 (performer_s_ VARCHAR, composer_s_ VARCHAR)
### Question ###
Who sang the song composed by Mariah Carey and Walter Afanasieff?
### Accurate SQL ###
| SELECT performer_s_ FROM table_name_20 WHERE composer_s_ = "mariah carey and walter afanasieff" |
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
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 )
### Question ###
what is the insurance for patient id 990?
### Accurate SQL ###
| SELECT demographic.insurance FROM demographic WHERE demographic.subject_id = "990" |
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_9408 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Bonus Points" text, "Points" text )
### Question ###
How many rounds were played in the matching resulting in a Points For score of 343?
### Accurate SQL ###
| SELECT "Played" FROM table_9408 WHERE "Points for" = '343' |
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_20345 ( "Name" text, "Japanese" text, "Date of designation" text, "Date of reclassification" text, "Region" text, "Prefecture" text )
### Question ###
Name the total number of japanese for amagasaki
### Accurate SQL ###
| SELECT COUNT("Japanese") FROM table_20345 WHERE "Name" = 'Amagasaki' |
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 player ( player_id number, sponsor_name text, player_name text, gender text, residence text, occupation text, votes number, rank text )
TABLE: CREATE TABLE coach ( coach_id number, coach_name text, gender text, club_id number, rank number )
TABLE: CREATE TABLE player_coach ( player_id number, coach_id number, starting_year number )
TABLE: CREATE TABLE club ( club_id number, club_name text, region text, start_year number )
TABLE: CREATE TABLE match_result ( rank number, club_id number, gold number, big_silver number, small_silver number, bronze number, points number )
### Question ###
How many players are there?
### Accurate SQL ###
| SELECT COUNT(*) FROM player |
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_3028 ( "Position" text, "Name" text, "Nationality" text, "Event 1 Medley" text, "Event 2 Truck Pull" text, "Event 3 Squat Lift" text, "Event 4 Carwalk" text, "Event 5 Dumbbell Press" text, "Event 6 Atlas Stones" text )
### Question ###
How many men had an event 1 medley score of 6 (16.6m)?
### Accurate SQL ###
| SELECT COUNT("Event 2 Truck Pull") FROM table_3028 WHERE "Event 1 Medley" = '6 (16.6m)' |
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_34 ( id number, "season" text, "appearance" number, "interchange" number, "tries" number, "goals" number, "f/g" number, "points" number )
### Question ###
how many appearances did he have in 2001 ?
### Accurate SQL ###
| SELECT "appearance" FROM table_203_34 WHERE "season" = 2001 |
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 Premises ( premise_id INTEGER, premises_type VARCHAR(15), premise_details VARCHAR(255) )
TABLE: CREATE TABLE Order_Items ( item_id INTEGER, order_item_status_code VARCHAR(15), order_id INTEGER, product_id INTEGER, item_status_code VARCHAR(15), item_delivered_datetime DATETIME, item_order_quantity VARCHAR(80) )
TABLE: CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(15), shipping_method_code VARCHAR(15), order_placed_datetime DATETIME, order_delivered_datetime DATETIME, order_shipping_charges VARCHAR(255) )
TABLE: CREATE TABLE Customers ( customer_id INTEGER, payment_method VARCHAR(15), customer_name VARCHAR(80), customer_phone VARCHAR(80), customer_email VARCHAR(80), customer_address VARCHAR(255), customer_login VARCHAR(80), customer_password VARCHAR(10) )
TABLE: CREATE TABLE Mailshot_Customers ( mailshot_id INTEGER, customer_id INTEGER, outcome_code VARCHAR(15), mailshot_customer_date DATETIME )
TABLE: CREATE TABLE Mailshot_Campaigns ( mailshot_id INTEGER, product_category VARCHAR(15), mailshot_name VARCHAR(80), mailshot_start_date DATETIME, mailshot_end_date DATETIME )
TABLE: CREATE TABLE Customer_Addresses ( customer_id INTEGER, premise_id INTEGER, date_address_from DATETIME, address_type_code VARCHAR(15), date_address_to DATETIME )
TABLE: CREATE TABLE Products ( product_id INTEGER, product_category VARCHAR(15), product_name VARCHAR(80) )
### Question ###
Show me the total number by outcome code in a histogram, and order y-axis in desc order.
### Accurate SQL ###
| SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code ORDER BY COUNT(*) 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 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 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 )
### Question ###
what is primary disease and procedure icd9 code of subject id 18480?
### Accurate SQL ###
| SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "18480" |
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_72978 ( "Aircraft" text, "1990" real, "destroyed" real, "damaged" real, "to Iran" real, "survived" real )
### Question ###
If the aircraft was ussr mig-25 rb how many were destroyed?
### Accurate SQL ###
| SELECT "destroyed" FROM table_72978 WHERE "Aircraft" = 'USSR MiG-25 RB' |
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_17964087_2 ( foreign_nationality VARCHAR, romanised_name VARCHAR )
### Question ###
For the name romanised name is lo yik-kee, victor what is the total number foreign nationality that is listed?
### Accurate SQL ###
| SELECT COUNT(foreign_nationality) FROM table_17964087_2 WHERE romanised_name = "Lo Yik-kee, Victor" |
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_31970 ( "Heat Rank" real, "Lane" real, "Swimmer" text, "Country" text, "Time" real, "Overall Rank" text )
### Question ###
Which country is ranked 56 overall and has a heat rank smaller than 8?
### Accurate SQL ###
| SELECT "Country" FROM table_31970 WHERE "Heat Rank" < '8' AND "Overall Rank" = '56' |
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_9 (player VARCHAR, pick VARCHAR)
### Question ###
Tell me the player for pick of 145
### Accurate SQL ###
| SELECT player FROM table_name_9 WHERE pick = "145" |
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_28677 ( "Alumni" text, "Original season" text, "Fresh Meat Partner" text, "Age" real, "Hometown" text, "Finish" text )
### Question ###
What alumni were in rw: cancun as their original season?
### Accurate SQL ###
| SELECT "Alumni" FROM table_28677 WHERE "Original season" = 'RW: Cancun' |
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 ( opponents VARCHAR, partner VARCHAR )
### Question ###
What is Opponents, when Partner is Vitalia Diatchenko?
### Accurate SQL ###
| SELECT opponents FROM table_name_60 WHERE partner = "vitalia diatchenko" |
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_13694 ( "Lane" real, "Name" text, "Country" text, "Reaction Time" real, "Time" real )
### Question ###
Which Lane has a Country of united states, and a Time smaller than 22.01, and a Reaction Time smaller than 0.193?
### Accurate SQL ###
| SELECT MIN("Lane") FROM table_13694 WHERE "Country" = 'united states' AND "Time" < '22.01' AND "Reaction Time" < '0.193' |
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 people (Name VARCHAR, Birth_Date VARCHAR)
### Question ###
List the names and birth dates of people in ascending alphabetical order of name.
### Accurate SQL ###
| SELECT Name, Birth_Date FROM people ORDER BY 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_name_80 (bullet_weight_gram__grain_ VARCHAR, case_capacity___percentage_ VARCHAR)
### Question ###
Which 8.23 g (127 gr) is the highest one that has a Bullet weight gram (grain) of 8x64mm s, and a Case capacity (%) smaller than 110.3?
### Accurate SQL ###
| SELECT MAX(823 AS _g__127_gr_) FROM table_name_80 WHERE bullet_weight_gram__grain_ = "8x64mm s" AND case_capacity___percentage_ < 110.3 |
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 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 )
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 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 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
### Question ###
tell me the name of the medication that patient 022-127262 was first prescribed via the sub-q route since 9 months ago?
### Accurate SQL ###
| SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-127262')) AND medication.routeadmin = 'sub-q' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-9 month') ORDER BY medication.drugstarttime 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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE ReviewTaskTypes ( 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
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 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 FlagTypes ( 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 ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId 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 Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
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 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 CloseReasonTypes ( 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE VoteTypes ( Id number, Name 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 )
### Question ###
Count answers per tag per year.
### Accurate SQL ###
| SELECT COUNT(a.Id) FROM Posts AS a LEFT JOIN Posts AS p ON a.ParentId = p.Id LEFT JOIN PostTags AS pt ON p.Id = pt.PostId LEFT JOIN Tags AS t ON pt.TagId = t.Id WHERE t.TagName = '##TagName:string##' AND YEAR(p.CreationDate) = 2019 AND p.DeletionDate IS 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_dev_28 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "consent" bool, "hemoglobin_a1c_hba1c" float, "hematocrit_hct" float, "fasting_triglycerides" int, "fasting_blood_glucose_fbg" float, "diastolic_blood_pressure_dbp" int, "hba1c" float, "metformin" bool, "age" float, "NOUSE" float )
### Question ###
systolic blood pressure greater than 160 mmhg, or diastolic blood pressure greater than 100 mmhg at screening
### Accurate SQL ###
| SELECT * FROM table_dev_28 WHERE systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 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 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 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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime 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 allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime 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 cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
### Question ###
what was the first respiration in patient 029-26705's body?
### Accurate SQL ###
| SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-26705')) AND NOT vitalperiodic.respiration IS NULL ORDER BY vitalperiodic.observationtime 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_train_9 ( "id" int, "pregnancy_or_lactation" bool, "intention_to_arterial_catheter" bool, "intention_to_central_venous_catheter" bool, "surgery" bool, "hypotension" bool, "chest_trauma" bool, "burn_injury" int, "impossible_transthoracic_echocardiogram_tte" bool, "NOUSE" float )
### Question ###
known pregnancy
### Accurate SQL ###
| SELECT * FROM table_train_9 WHERE pregnancy_or_lactation = 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_97 (date VARCHAR, plant_patent_number VARCHAR)
### Question ###
What date had the patent number US plant patent 12098?
### Accurate SQL ###
| SELECT date FROM table_name_97 WHERE plant_patent_number = "us plant patent 12098" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.