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_8956 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text )
### Question ###
What were the Away team Kangaroos Crowd totals?
### Accurate SQL ###
|
SELECT SUM("Crowd") FROM table_8956 WHERE "Away team" = 'kangaroos'
|
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_50266 ( "Match" real, "Date" text, "Round" text, "Home/Away" text, "Opponent team" text, "Score" text )
### Question ###
What date was match 5?
### Accurate SQL ###
|
SELECT "Date" FROM table_50266 WHERE "Match" = '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 university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text )
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 )
### Question ###
Show me about the distribution of ACC_Regular_Season and All_Games_Percent in a bar chart, and could you order in desc by the names please?
### Accurate SQL ###
|
SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY ACC_Regular_Season 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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) )
TABLE: CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) )
TABLE: CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) )
TABLE: CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) )
TABLE: CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(4,0) )
TABLE: CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) )
TABLE: CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) )
### Question ###
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time.
### Accurate SQL ###
|
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
|
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 ( opponents INTEGER, record VARCHAR, vikings_points VARCHAR )
### Question ###
Tell me the highest opponents for record of 7-3 and vikings points more than 7
### Accurate SQL ###
|
SELECT MAX(opponents) FROM table_name_97 WHERE record = "7-3" AND vikings_points > 7
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_81 (country VARCHAR, player VARCHAR)
### Question ###
From what Country is Gary Evans?
### Accurate SQL ###
|
SELECT country FROM table_name_81 WHERE player = "gary evans"
|
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 (elevator VARCHAR, cardinalatial_title VARCHAR)
### Question ###
What is listed for the Elevator, that also has the Cardinalatial title of Deacon of S. Maria in Portico?
### Accurate SQL ###
|
SELECT elevator FROM table_name_78 WHERE cardinalatial_title = "deacon of s. maria in portico"
|
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_17288825_7 ( score VARCHAR, date VARCHAR )
### Question ###
What is the score for the game played on January 25?
### Accurate SQL ###
|
SELECT score FROM table_17288825_7 WHERE date = "January 25"
|
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 diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
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 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 lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
TABLE: CREATE TABLE 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 ###
what was the first time patient 030-75705 had the minimum level of -eos since 09/2105?
### Accurate SQL ###
|
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-75705')) AND lab.labname = '-eos' AND STRFTIME('%y-%m', lab.labresulttime) >= '2105-09' ORDER BY lab.labresult, lab.labresulttime 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_65 ( director VARCHAR, result VARCHAR, year__ceremony_ VARCHAR )
### Question ###
What is Director, when Result is nominee, and when Year (Ceremony) is 1969 (42nd)?
### Accurate SQL ###
|
SELECT director FROM table_name_65 WHERE result = "nominee" AND year__ceremony_ = "1969 (42nd)"
|
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_86 ( points_for VARCHAR, club VARCHAR )
### Question ###
How many points for did Bridgend Athletic RFC score?
### Accurate SQL ###
|
SELECT points_for FROM table_name_86 WHERE club = "bridgend athletic rfc"
|
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_2140071_8 ( coach VARCHAR, episode VARCHAR )
### Question ###
Who was the coach for episode 15?
### Accurate SQL ###
|
SELECT coach FROM table_2140071_8 WHERE episode = 15
|
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_1204998_2 (area VARCHAR, english_name VARCHAR)
### Question ###
What is the area of the English name Shanghang County?
### Accurate SQL ###
|
SELECT area FROM table_1204998_2 WHERE english_name = "Shanghang County"
|
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 (record VARCHAR, date VARCHAR)
### Question ###
What is the record for April 22?
### Accurate SQL ###
|
SELECT record FROM table_name_25 WHERE date = "april 22"
|
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_37 ( lner_class VARCHAR, passed_to_lner VARCHAR, date_introduced VARCHAR )
### Question ###
Which LNER class has been Passed to LNER larger than 3 and a introduced in 1895 98?
### Accurate SQL ###
|
SELECT lner_class FROM table_name_37 WHERE passed_to_lner > 3 AND date_introduced = "1895–98"
|
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_75 ( goals_for INTEGER, games_played INTEGER )
### Question ###
What is the average number of goals for games played that total more than 8?
### Accurate SQL ###
|
SELECT AVG(goals_for) FROM table_name_75 WHERE games_played > 8
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_9 ( venue VARCHAR, figures VARCHAR )
### Question ###
What is Venue, when Figures is 5/29?
### Accurate SQL ###
|
SELECT venue FROM table_name_9 WHERE figures = "5/29"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_1058787_1 (examples VARCHAR, existential_question_ VARCHAR, _not_in_citation_given_ VARCHAR)
### Question ###
Which examples ask the existential question "Can I Love?"
### Accurate SQL ###
|
SELECT examples FROM table_1058787_1 WHERE existential_question_[_not_in_citation_given_] = "Can I Love?"
|
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_52052 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
### Question ###
On what date was Richmond hosted as the away team?
### Accurate SQL ###
|
SELECT "Date" FROM table_52052 WHERE "Away team" = 'richmond'
|
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_13 ( home_team VARCHAR, away_team VARCHAR )
### Question ###
What was the home team's score when they played Richmond?
### Accurate SQL ###
|
SELECT home_team AS score FROM table_name_13 WHERE away_team = "richmond"
|
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_62765 ( "Frequency" text, "Call sign" text, "Format" text, "Owner" text, "Notes" text )
### Question ###
What is the format for the one which has a call sign of cite-fm-1?
### Accurate SQL ###
|
SELECT "Format" FROM table_62765 WHERE "Call sign" = 'cite-fm-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_47832 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
### Question ###
Which Pick has a Round larger than 8, a Name of kenny fells, and an Overall larger than 297?
### Accurate SQL ###
|
SELECT SUM("Pick") FROM table_47832 WHERE "Round" > '8' AND "Name" = 'kenny fells' AND "Overall" > '297'
|
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_12266757_1 (mens_singles VARCHAR, mixed_doubles VARCHAR)
### Question ###
Who won the Mens Singles when the Mixed doubles went to Stellan Mohlin Kerstin Ståhl , Aik?
### Accurate SQL ###
|
SELECT mens_singles FROM table_12266757_1 WHERE mixed_doubles = "Stellan Mohlin Kerstin Ståhl , AIK"
|
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_23014923_1 (season VARCHAR, primary__south__winners VARCHAR)
### Question ###
If the primary (South) winners is Inter The Bloomfield, what is the season total number?
### Accurate SQL ###
|
SELECT COUNT(season) FROM table_23014923_1 WHERE primary__south__winners = "Inter The Bloomfield"
|
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 (hmos VARCHAR, conventional_plans VARCHAR, year VARCHAR)
### Question ###
Which HMO has a conventional plan of 3% in 2005?
### Accurate SQL ###
|
SELECT hmos FROM table_name_96 WHERE conventional_plans = "3%" AND year = 2005
|
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 Student (Advisor VARCHAR)
### Question ###
Advisor 1121 has how many students?
### Accurate SQL ###
|
SELECT COUNT(*) FROM Student WHERE Advisor = 1121
|
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_44 ( category VARCHAR, recipient_s_ VARCHAR, award VARCHAR, result VARCHAR, year VARCHAR )
### Question ###
What category was Joe Jonas nominated for at the Kids' Choice Awards Mexico in 2010?
### Accurate SQL ###
|
SELECT category FROM table_name_44 WHERE result = "nominated" AND year = 2010 AND award = "kids' choice awards mexico" AND recipient_s_ = "joe jonas"
|
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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description 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 Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
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 )
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 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 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 Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
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 PostTags ( PostId number, TagId number )
### Question ###
TOP USERS IN TAG GROUPED BY COUNTRY.
### Accurate SQL ###
|
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation, COUNT(p.Id) FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE LOWER(Location) LIKE LOWER('%##countryname##%') AND t.TagName = '##tagname##' GROUP BY u.Reputation, u.Id ORDER BY Reputation 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 catalog_contents ( catalog_entry_id number, catalog_level_number number, parent_entry_id number, previous_entry_id number, next_entry_id number, catalog_entry_name text, product_stock_number text, price_in_dollars number, price_in_euros number, price_in_pounds number, capacity text, length text, height text, width text )
TABLE: CREATE TABLE attribute_definitions ( attribute_id number, attribute_name text, attribute_data_type text )
TABLE: CREATE TABLE catalog_contents_additional_attributes ( catalog_entry_id number, catalog_level_number number, attribute_id number, attribute_value text )
TABLE: CREATE TABLE catalogs ( catalog_id number, catalog_name text, catalog_publisher text, date_of_publication time, date_of_latest_revision time )
TABLE: CREATE TABLE catalog_structure ( catalog_level_number number, catalog_id number, catalog_level_name text )
### Question ###
What are the entry names of catalog with the attribute possessed by most entries.
### Accurate SQL ###
|
SELECT t1.catalog_entry_name FROM catalog_contents AS t1 JOIN catalog_contents_additional_attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = (SELECT attribute_value FROM catalog_contents_additional_attributes GROUP BY attribute_value 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_72 ( Id VARCHAR )
### Question ###
What 2011 has 2r as 2010, and a 2008 of A?
### Accurate SQL ###
|
SELECT 2011 FROM table_name_72 WHERE 2010 = "2r" AND 2008 = "a"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE shop (LOCATION VARCHAR)
### Question ###
Find the number of shops in each location.
### Accurate SQL ###
|
SELECT COUNT(*), LOCATION FROM shop GROUP BY LOCATION
|
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_92 ( college VARCHAR, pick INTEGER )
### Question ###
Which college had a pick of under 5?
### Accurate SQL ###
|
SELECT college FROM table_name_92 WHERE pick < 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_34 (position VARCHAR, school_club_team VARCHAR)
### Question ###
What is Position, when School/Club Team is McMaster?
### Accurate SQL ###
|
SELECT position FROM table_name_34 WHERE school_club_team = "mcmaster"
|
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_55 (location VARCHAR)
### Question ###
Tell me the average 1st prize for tennessee
### Accurate SQL ###
|
SELECT AVG(1 AS st_prize__) AS $__ FROM table_name_55 WHERE location = "tennessee"
|
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 ( attendance INTEGER, opponent VARCHAR )
### Question ###
What was the attendance when the opponent was virginia?
### Accurate SQL ###
|
SELECT SUM(attendance) FROM table_name_96 WHERE opponent = "virginia"
|
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_73501 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
### Question ###
How many people got high points in game 35?
### Accurate SQL ###
|
SELECT COUNT("High points") FROM table_73501 WHERE "Game" = '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_90 (tries_for INTEGER, points_for VARCHAR, tries_against VARCHAR)
### Question ###
What is the average tries for less than 117 points and less than 48 tries against?
### Accurate SQL ###
|
SELECT AVG(tries_for) FROM table_name_90 WHERE points_for < 117 AND tries_against < 48
|
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_7549 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
### Question ###
What is the Team 1 with a Team 2 with brest hc meshkov?
### Accurate SQL ###
|
SELECT "Team 1" FROM table_7549 WHERE "Team 2" = 'brest hc meshkov'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_33 (round VARCHAR)
### Question ###
What is the 1st leg of 2q round?
### Accurate SQL ###
|
SELECT 1 AS st_leg FROM table_name_33 WHERE round = "2q"
|
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_14154 ( "Year" real, "September" text, "October" text, "November" text, "December" text )
### Question ###
Who is in November after 1988 when Prinzzess is in October?
### Accurate SQL ###
|
SELECT "November" FROM table_14154 WHERE "Year" > '1988' AND "October" = 'prinzzess'
|
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 ( record VARCHAR, date VARCHAR )
### Question ###
What is the Record with a Date with december 9?
### Accurate SQL ###
|
SELECT record FROM table_name_97 WHERE date = "december 9"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
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 TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE ReviewTaskResultTypes ( 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 FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
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 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
### Question ###
Users with only Fanatic and Enthusiast badge and done nothing else.
### Accurate SQL ###
|
SELECT b.UserId AS "user_link" FROM Badges AS b GROUP BY b.UserId HAVING COUNT(*) = 1 AND MIN(Name) = 'Enthusiast'
|
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_19174 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text )
### Question ###
When 2-0 is the 1st leg what are the home (2nd leg)?
### Accurate SQL ###
|
SELECT "Home (2nd leg)" FROM table_19174 WHERE "1st Leg" = '2-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_19729 ( "Name" text, "Years" text, "League" text, "FA Cup" text, "League Cup" text, "Europe" text, "Other a" text, "Total" text )
### Question ###
which leage had a league cup of 46 (1)
### Accurate SQL ###
|
SELECT "League" FROM table_19729 WHERE "League Cup" = '46 (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_54 ( color VARCHAR, scientific_name VARCHAR )
### Question ###
What is the color of the Chamaeleo Calyptratus?
### Accurate SQL ###
|
SELECT color FROM table_name_54 WHERE scientific_name = "chamaeleo calyptratus"
|
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 airlines (country VARCHAR, active VARCHAR)
### Question ###
Which countries has the most number of airlines whose active status is 'Y'?
### Accurate SQL ###
|
SELECT country FROM airlines WHERE active = 'Y' GROUP BY country 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 month ( month_number int, month_name text )
TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar )
TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text )
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 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 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 )
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_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_interval ( period text, begin_time int, end_time 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 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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
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 code_description ( code varchar, description text )
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 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 food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text )
### Question ###
what flights go from BOSTON to ATLANTA
### 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
|
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 VARCHAR )
### Question ###
How many students play video games?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT StuID) FROM Plays_games
|
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_41 ( away_team VARCHAR )
### Question ###
I want the away team score for away team of fitzroy
### Accurate SQL ###
|
SELECT away_team AS score FROM table_name_41 WHERE away_team = "fitzroy"
|
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_11589522_3 ( original_air_date VARCHAR, written_by VARCHAR )
### Question ###
what's the original air date where written by is iain morris & damon beesley
### Accurate SQL ###
|
SELECT original_air_date FROM table_11589522_3 WHERE written_by = "Iain Morris & Damon Beesley"
|
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_9831 ( "Rank" real, "Title" text, "Studio" text, "Director(s)" text, "Worldwide gross" text )
### Question ###
In what studio was the film grossing $457,640,427 made?
### Accurate SQL ###
|
SELECT "Studio" FROM table_9831 WHERE "Worldwide gross" = '$457,640,427'
|
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_17412 ( "Jurisdiction" text, "For Prohibition" real, "Percent For" text, "Against Prohibition" real, "Percent Against" text )
### Question ###
What is the percent for in manitoba?
### Accurate SQL ###
|
SELECT "Percent For" FROM table_17412 WHERE "Jurisdiction" = 'Manitoba'
|
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_652 ( id number, "title" text, "year" number, "director" text, "country" text, "genre" text, "notes" text )
### Question ###
how many films were from argentina ?
### Accurate SQL ###
|
SELECT COUNT("title") FROM table_204_652 WHERE "country" = 'argentina'
|
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_24399615_10 (viewers VARCHAR, cable_rank VARCHAR)
### Question ###
List the number of viewers when the cable rank for Russell Howard's Good New was 5.
### Accurate SQL ###
|
SELECT viewers FROM table_24399615_10 WHERE cable_rank = "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_35694 ( "Category" text, "Type" text, "Attribute" text, "Bubbles" text, "Cancelable" text )
### Question ###
Which bubble have a cancelable of yes and an attribute of onpointerdown?
### Accurate SQL ###
|
SELECT "Bubbles" FROM table_35694 WHERE "Cancelable" = 'yes' AND "Attribute" = 'onpointerdown'
|
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_43 (city VARCHAR, past_season VARCHAR)
### Question ###
what city has a past season of n/a?
### Accurate SQL ###
|
SELECT city FROM table_name_43 WHERE past_season = "n/a"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_31862 ( "Team" text, "Driver" text, "Chassis" text, "Engine" text, "Rounds" text )
### Question ###
Tell me the engine for dhg tom's racing
### Accurate SQL ###
|
SELECT "Engine" FROM table_31862 WHERE "Team" = 'dhg tom''s racing'
|
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 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 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 )
### Question ###
provide the number of patients whose admission year is less than 2158 and diagnoses long title is benign neoplasm of spinal meninges?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2158" AND diagnoses.long_title = "Benign neoplasm of spinal meninges"
|
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_587 ( id number, "drop(s)" text, "multiplayer map(s)" text, "spec ops mission(s)" text, "face off map(s)" text, "xbox 360 release date" text, "playstation 3 release date" text )
### Question ###
were drops 4-6 released on xbox 360 after they were released on playstation 3 ?
### Accurate SQL ###
|
SELECT (SELECT "xbox 360 release date" FROM table_204_587 WHERE "drop(s)" = '4-6') > (SELECT "playstation 3 release date" FROM table_204_587 WHERE "drop(s)" = '4-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_24833 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
### Question ###
What is the production code for the episode with 8.56 million U.S. viewers?
### Accurate SQL ###
|
SELECT "Production code" FROM table_24833 WHERE "U.S. viewers (millions)" = '8.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_87 (losses INTEGER, scored VARCHAR, points VARCHAR)
### Question ###
Which Losses has Scored of 9, and Points larger than 8?
### Accurate SQL ###
|
SELECT AVG(losses) FROM table_name_87 WHERE scored = 9 AND points > 8
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_48 (perfect_fifth VARCHAR, minor_seventh VARCHAR)
### Question ###
What is the Perfect fifth with a Minor that is seventh of d?
### Accurate SQL ###
|
SELECT perfect_fifth FROM table_name_48 WHERE minor_seventh = "d"
|
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_54678 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
### Question ###
What was the venue when Collingwood was the away team?
### Accurate SQL ###
|
SELECT "Venue" FROM table_54678 WHERE "Away team" = 'collingwood'
|
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 ( personal_name VARCHAR )
### Question ###
How many students have personal names that contain the word 'son'?
### Accurate SQL ###
|
SELECT COUNT(*) FROM Students WHERE personal_name LIKE "%son%"
|
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_52 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
### Question ###
what competition was on 9 may 2006 ?
### Accurate SQL ###
|
SELECT "competition" FROM table_204_52 WHERE "date" = '9 may 2006'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_46 (player VARCHAR, to_par VARCHAR, year_s__won VARCHAR)
### Question ###
Who won in 1979 with +8 to par?
### Accurate SQL ###
|
SELECT player FROM table_name_46 WHERE to_par = "+8" AND year_s__won = "1979"
|
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_95 ( losses VARCHAR, appearances INTEGER )
### Question ###
How many losses did the division who appeared less than 16 times have?
### Accurate SQL ###
|
SELECT losses FROM table_name_95 WHERE appearances < 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 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 )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE 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 ###
provide the number of patients whose diagnoses long title is regional enteritis of unspecified site and drug route is ih?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Regional enteritis of unspecified site" AND prescriptions.route = "IH"
|
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 (l2_cache VARCHAR, model_number VARCHAR)
### Question ###
WHat kind of L2 cache has a Model number of turion x2 ultra zm-85?
### Accurate SQL ###
|
SELECT l2_cache FROM table_name_31 WHERE model_number = "turion x2 ultra zm-85"
|
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 (uk_base VARCHAR, airborne_unit VARCHAR)
### Question ###
Which UK Base has an airborne unit of Pathfinders?
### Accurate SQL ###
|
SELECT uk_base FROM table_name_42 WHERE airborne_unit = "pathfinders"
|
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_987 ( "Name Of Place" text, "Height from Sea Level In Meters" text, "Nearby Town" text, "Trekking Route" text, "Category" text )
### Question ###
If extremely adventures is the category what is the height from sea level in meters?
### Accurate SQL ###
|
SELECT "Height from Sea Level In Meters" FROM table_987 WHERE "Category" = 'Extremely Adventures'
|
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 (city VARCHAR, stadium VARCHAR)
### Question ###
Which City has a Stadium of estadio san cristóbal?
### Accurate SQL ###
|
SELECT city FROM table_name_96 WHERE stadium = "estadio san cristóbal"
|
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_62265 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
### Question ###
What is Score, when Home is 'Montreal Canadiens', and when Date is 'May 16'?
### Accurate SQL ###
|
SELECT "Score" FROM table_62265 WHERE "Home" = 'montreal canadiens' AND "Date" = 'may 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_34261 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Wins" real )
### Question ###
What was the highest rank for greg norman with Earnings less than $10,484,065?
### Accurate SQL ###
|
SELECT MAX("Rank") FROM table_34261 WHERE "Player" = 'greg norman' AND "Earnings ( $ )" < '10,484,065'
|
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 band ( id number, firstname text, lastname text )
TABLE: CREATE TABLE tracklists ( albumid number, position number, songid number )
TABLE: CREATE TABLE albums ( aid number, title text, year number, label text, type text )
TABLE: CREATE TABLE vocals ( songid number, bandmate number, type text )
TABLE: CREATE TABLE instruments ( songid number, bandmateid number, instrument text )
TABLE: CREATE TABLE performance ( songid number, bandmate number, stageposition text )
TABLE: CREATE TABLE songs ( songid number, title text )
### Question ###
What is the type of vocals that the band member with the last name 'Heilo' played the most?
### Accurate SQL ###
|
SELECT type FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = "Heilo" GROUP BY type 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_81 (ship VARCHAR, country VARCHAR, builder VARCHAR)
### Question ###
What ship was built by Palmers Shipbuilding and Iron Company for the Royal Navy?
### Accurate SQL ###
|
SELECT ship FROM table_name_81 WHERE country = "royal navy" AND builder = "palmers shipbuilding and iron company"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_2 (round INTEGER, position VARCHAR, school_club_team VARCHAR)
### Question ###
What is the sum of Round, when Position is Forward, and when School/Club Team is Western Kentucky?
### Accurate SQL ###
|
SELECT SUM(round) FROM table_name_2 WHERE position = "forward" AND school_club_team = "western kentucky"
|
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_78077 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
### Question ###
How much time is required for less than 35 laps and less than 10 grids?
### Accurate SQL ###
|
SELECT "Time/Retired" FROM table_78077 WHERE "Laps" < '35' AND "Grid" < '10'
|
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_test_5 ( "id" int, "systemic_lupus_erythematosus" bool, "anemia" bool, "gender" string, "pregnancy_or_lactation" bool, "serum_potassium" float, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "renal_disease" bool, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "chronic_inflammatory_disease" bool, "global_lvef" int, "rheumatoid_arthritis" bool, "liver_disease" bool, "serum_creatinine" float, "kidney_disease" bool, "lung_disease" bool, "age" float, "NOUSE" float )
### Question ###
male or non _ pregnant female , aged 18 _ 80 years old
### Accurate SQL ###
|
SELECT * FROM table_test_5 WHERE (gender = 'male' OR (gender = 'female' AND pregnancy_or_lactation = 0)) AND (age >= 18 AND age <= 80)
|
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 players (country_code VARCHAR)
### Question ###
find the number of players for each country.
### Accurate SQL ###
|
SELECT COUNT(*), country_code FROM players GROUP BY country_code
|
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 (score VARCHAR, location VARCHAR)
### Question ###
Which Score has a Location of richfield coliseum?
### Accurate SQL ###
|
SELECT score FROM table_name_96 WHERE location = "richfield coliseum"
|
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_16 ( player VARCHAR, position VARCHAR, years_in_toronto VARCHAR )
### Question ###
Which Player's Position is guard and played in Toronto during the Years 2007-08?
### Accurate SQL ###
|
SELECT player FROM table_name_16 WHERE position = "guard" AND years_in_toronto = "2007-08"
|
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_59157 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
### Question ###
What home team played Hinckley United?
### Accurate SQL ###
|
SELECT "Home team" FROM table_59157 WHERE "Away team" = 'hinckley united'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_66 (off_site_atms INTEGER, bank_type VARCHAR, on_site_atms VARCHAR)
### Question ###
With foreign banks as the bank type, and on-site ATMS less than 218, what is the average off-site ATMs?
### Accurate SQL ###
|
SELECT AVG(off_site_atms) FROM table_name_66 WHERE bank_type = "foreign banks" AND on_site_atms < 218
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_33 ( venue VARCHAR, date VARCHAR )
### Question ###
What is the venue of the game on 20 November 2002?
### Accurate SQL ###
|
SELECT venue FROM table_name_33 WHERE date = "20 november 2002"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE 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 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 ###
how many patients whose ethnicity is black/cape verdean and diagnoses long title is secondary diabetes mellitus without mention of complication, not stated as uncontrolled, or unspecified?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND diagnoses.long_title = "Secondary diabetes mellitus without mention of complication, not stated as uncontrolled, or unspecified"
|
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 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 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 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 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 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
### Question ###
what did patient 015-94542 receive for his or her last procedure until 2104?
### Accurate SQL ###
|
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-94542')) AND STRFTIME('%y', treatment.treatmenttime) <= '2104' ORDER BY treatment.treatmenttime 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 city (gdp VARCHAR, Regional_Population VARCHAR)
### Question ###
what is the GDP of the city with the largest population.
### Accurate SQL ###
|
SELECT gdp FROM city ORDER BY Regional_Population 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 takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) )
TABLE: CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) )
TABLE: CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) )
TABLE: CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) )
TABLE: CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) )
TABLE: CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4) )
TABLE: CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) )
TABLE: CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min numeric(2) )
TABLE: CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) )
TABLE: CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) )
TABLE: CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) )
### Question ###
Find the names and average salaries of all departments whose average salary is greater than 42000, show by the x axis from high to low.
### Accurate SQL ###
|
SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name 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_28311 ( "Rank" real, "Player" text, "Year" real, "Opponent" text, "Passing yards" real, "Rushing yards" real, "Total offense" real )
### Question ###
Who was the opponent when there was 81 rushing yards?
### Accurate SQL ###
|
SELECT "Opponent" FROM table_28311 WHERE "Rushing yards" = '81'
|
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_60273 ( "Model" text, "Year" text, "Type" text, "Engine" text, "Displacement cc" text )
### Question ###
What is the CC displacement for 1965?
### Accurate SQL ###
|
SELECT "Displacement cc" FROM table_60273 WHERE "Year" = '1965'
|
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_27 (viewers__in_millions_ VARCHAR, finale VARCHAR)
### Question ###
How many people tuned in to the finale on May 16, 2007?
### Accurate SQL ###
|
SELECT COUNT(viewers__in_millions_) FROM table_name_27 WHERE finale = "may 16, 2007"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_19 (name VARCHAR, hanzi VARCHAR)
### Question ###
With a Hanzi of 深圳卫视, what is the name?
### Accurate SQL ###
|
SELECT name FROM table_name_19 WHERE hanzi = "深圳卫视"
|
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_59 ( score VARCHAR, host_city VARCHAR )
### Question ###
What is the score of the season in the host city k dainiai?
### Accurate SQL ###
|
SELECT score FROM table_name_59 WHERE host_city = "kėdainiai"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_47 (rank INTEGER, sets_won VARCHAR, loss VARCHAR)
### Question ###
What is the least rank with more than 16 sets won and less than 1 loss?
### Accurate SQL ###
|
SELECT MIN(rank) FROM table_name_47 WHERE sets_won > 16 AND loss < 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_4 (title VARCHAR, from_album VARCHAR, label VARCHAR, Nr VARCHAR, x VARCHAR)
### Question ###
Which Title has an album of tough talk, and a Label-Nr of x-371?
### Accurate SQL ###
|
SELECT title FROM table_name_4 WHERE from_album = "tough talk" AND label - Nr = x - 371
|
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 Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME )
TABLE: CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) )
TABLE: CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) )
TABLE: CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) )
TABLE: CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) )
TABLE: CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) )
### Question ###
A line chart for finding the number of the dates of the tests taken with result 'Pass', order X in asc order.
### Accurate SQL ###
|
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" ORDER BY date_test_taken
|
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_46094 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
### Question ###
What lost has 86 points?
### Accurate SQL ###
|
SELECT "Lost" FROM table_46094 WHERE "Points" = '86'
|
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 ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
TABLE: CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
### Question ###
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the average of revenue , and group by attribute founder, I want to order the average of revenue in desc order.
### Accurate SQL ###
|
SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Revenue) 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 ndecoreexcel_math_grade8 ( year number, state text, all_students text, average_scale_score number )
TABLE: CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district text, nces_id text, yr_data number, t_fed_rev number, c14 number, c25 number )
TABLE: CREATE TABLE finrev_fed_key_17 ( state_code number, state text, #_records text )
### Question ###
What is the state code of VA?
### Accurate SQL ###
|
SELECT state_code FROM finrev_fed_key_17 WHERE state = "Virginia"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.