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_74717 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
### Question ###
What is the average crowd size when North Melbourne is the away team?
### Accurate SQL ###
|
SELECT AVG("Crowd") FROM table_74717 WHERE "Away team" = 'north melbourne'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_22348 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text )
### Question ###
Who vacated his post when his successor was formally installed on May 11, 1966?
### Accurate SQL ###
|
SELECT "Vacator" FROM table_22348 WHERE "Date of successors formal installation" = 'May 11, 1966'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
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 time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
TABLE: CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
TABLE: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar )
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 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 month ( month_number int, month_name text )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text )
TABLE: CREATE TABLE code_description ( code varchar, description 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 ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
TABLE: CREATE TABLE days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code 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 state ( state_code text, state_name text, country_name 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 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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight 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 )
### Question ###
please list the shortest 1 stop flight from ONTARIO CALIFORNIA to ORLANDO FLORIDA
### 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, state AS STATE_0, state AS STATE_1 WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AND flight.stops = 1 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND STATE_1.state_code = CITY_1.state_code AND STATE_1.state_name = 'FLORIDA') AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ONTARIO' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND STATE_0.state_code = CITY_0.state_code AND STATE_0.state_name = 'CALIFORNIA') AND flight.time_elapsed = (SELECT MIN(FLIGHTalias1.time_elapsed) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVICEalias3, city AS CITYalias2, city AS CITYalias3, flight AS FLIGHTalias1, state AS STATEalias2, state AS STATEalias3 WHERE (CITYalias3.city_code = AIRPORT_SERVICEalias3.city_code AND CITYalias3.city_name = 'ORLANDO' AND FLIGHTalias1.stops = 1 AND FLIGHTalias1.to_airport = AIRPORT_SERVICEalias3.airport_code AND STATEalias3.state_code = CITYalias3.state_code AND STATEalias3.state_name = 'FLORIDA') AND CITYalias2.city_code = AIRPORT_SERVICEalias2.city_code AND CITYalias2.city_name = 'ONTARIO' AND FLIGHTalias1.from_airport = AIRPORT_SERVICEalias2.airport_code AND STATEalias2.state_code = CITYalias2.state_code AND STATEalias2.state_name = 'CALIFORNIA')
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_74 (replaced_by VARCHAR, date_of_appointment VARCHAR)
### Question ###
What is the name of the person that was appointed on 13 May 2009?
### Accurate SQL ###
|
SELECT replaced_by FROM table_name_74 WHERE date_of_appointment = "13 may 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 table_name_4 ( drawn VARCHAR, played VARCHAR, lost VARCHAR, goal_difference VARCHAR )
### Question ###
How many Drawn have a Lost smaller than 25, and a Goal Difference of +7, and a Played larger than 34?
### Accurate SQL ###
|
SELECT COUNT(drawn) FROM table_name_4 WHERE lost < 25 AND goal_difference = "+7" AND played > 34
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
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 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 city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar )
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 date_day ( month_number int, day_number int, year int, day_name varchar )
TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant 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 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 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 state ( state_code text, state_name text, country_name text )
TABLE: CREATE TABLE month ( month_number int, month_name 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 food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text )
TABLE: CREATE TABLE days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar )
TABLE: CREATE TABLE airline ( airline_code varchar, airline_name text, note text )
TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
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 )
### Question ###
what are the classes of service on DL
### Accurate SQL ###
|
SELECT DISTINCT class_of_service.booking_class FROM class_of_service, fare, fare_basis, flight, flight_fare WHERE fare_basis.booking_class = class_of_service.booking_class AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.airline_code = 'DL' AND flight.flight_id = flight_fare.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 table_22277 ( "Departure" text, "Going to" text, "Calling at" text, "Arrival" text, "Operator" text )
### Question ###
when does the train arriving at bourne at 11.45 departure
### Accurate SQL ###
|
SELECT "Departure" FROM table_22277 WHERE "Going to" = 'Bourne' AND "Arrival" = '11.45'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTaskStates ( 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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress 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 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 PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description 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 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 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId 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 ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
### Question ###
We are golden gods of recruiting.
### 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 '%uk%' OR LOWER(Location) LIKE '%england%') AND LOWER(t.TagName) = 'java' 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 table_name_25 ( all_amendments_cosponsored INTEGER, amendments_originally_cosponsored VARCHAR, all_bills_sponsored VARCHAR )
### Question ###
What is the highest number of amendments cosponsored associated with 53 amendments originally cosponsored and over 54 bills sponsored?
### Accurate SQL ###
|
SELECT MAX(all_amendments_cosponsored) FROM table_name_25 WHERE amendments_originally_cosponsored = 53 AND all_bills_sponsored > 54
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_671 ( id number, "airing\ndate" text, "english title\n(chinese title)" text, "number of episodes" number, "main cast" text, "theme song (t)\nsub-theme song (st)" text, "genre" text, "notes" text, "official website" text )
### Question ###
what was the last show to air ?
### Accurate SQL ###
|
SELECT "english title\n(chinese title)" FROM table_204_671 ORDER BY id 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_90 ( degree VARCHAR, award_year VARCHAR, award VARCHAR )
### Question ###
Tell me the degree for chemistry 1965
### Accurate SQL ###
|
SELECT degree FROM table_name_90 WHERE award_year = 1965 AND award = "chemistry"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_298 ( id number, "rank" number, "name" text, "nation(s)" text, "born" text, "ascended" text, "years reigned" text )
### Question ###
besides bhumibol adulyadej , which other people were born in december ?
### Accurate SQL ###
|
SELECT "name" FROM table_203_298 WHERE "name" <> 'bhumibol adulyadej' AND "born" = 12
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_30121096_1 ( civil_parish VARCHAR, townland VARCHAR )
### Question ###
Which civil parish is for the townland clooncugger?
### Accurate SQL ###
|
SELECT civil_parish FROM table_30121096_1 WHERE townland = "Clooncugger"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_84 ( attendance INTEGER, date VARCHAR )
### Question ###
What is the highest attendance on September 14, 1986?
### Accurate SQL ###
|
SELECT MAX(attendance) FROM table_name_84 WHERE date = "september 14, 1986"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 (assists VARCHAR, opponent VARCHAR, team VARCHAR, competition VARCHAR, total_gs VARCHAR)
### Question ###
How many assists were in the k-league competition, which has more than 20 total Gs, the pohang steelers team, and chunnam dragons as the opponent?
### Accurate SQL ###
|
SELECT assists FROM table_name_90 WHERE competition = "k-league" AND total_gs > 20 AND team = "pohang steelers" AND opponent = "chunnam dragons"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
### Question ###
provide the number of patients whose drug name is repaglinide?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Repaglinide"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_60471 ( "English name" text, "Thai name" text, "Abbr." text, "Transcription" text, "Sanskrit word" text, "Zodiac sign" text )
### Question ###
What is the English word that is abbreviated . .?
### Accurate SQL ###
|
SELECT "English name" FROM table_60471 WHERE "Abbr." = 'พ.ย.'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_2544694_3 ( indonesia_super_series_2008 VARCHAR, runner_up VARCHAR )
### Question ###
Which series occurred in which the semi-finalist was runner-up and the 7800.00 was 6420.00?
### Accurate SQL ###
|
SELECT indonesia_super_series_2008 FROM table_2544694_3 WHERE runner_up = "Semi-Finalist" AND 780000 = "6420.00"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 ( icao VARCHAR, commenced_operations INTEGER )
### Question ###
Which ICAO has a Commenced operations larger than 2011?
### Accurate SQL ###
|
SELECT icao FROM table_name_72 WHERE commenced_operations > 2011
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_2618113_1 (original_air_date VARCHAR, production_code VARCHAR)
### Question ###
What was the airdate of k0120?
### Accurate SQL ###
|
SELECT original_air_date FROM table_2618113_1 WHERE production_code = "K0120"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text )
TABLE: CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text )
TABLE: CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float )
### Question ###
What are the title and maximum price of each film, show by the y-axis from low to high please.
### Accurate SQL ###
|
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price)
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 ( played INTEGER, drawn VARCHAR, position VARCHAR )
### Question ###
What is the greatest played with a drawn less than 1 and a position of less than 1?
### Accurate SQL ###
|
SELECT MAX(played) FROM table_name_99 WHERE drawn < 1 AND position < 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_23670057_1 (player VARCHAR, no VARCHAR)
### Question ###
name the player for number 5
### Accurate SQL ###
|
SELECT player FROM table_23670057_1 WHERE no = 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_23470 ( "Language" text, "Concepci\u00f3n Municipality (%)" real, "San Javier Municipality (%)" real, "San Ram\u00f3n Municipality (%)" real, "San Juli\u00e1n Municipality (%)" real, "San Antonio de Lomer\u00edo Municipality (%)" text, "Cuatro Ca\u00f1adas Municipality (%)" text )
### Question ###
What is the municipality percentage for San Antonio de Lomerio is San Javier municipality percentage is 31?
### Accurate SQL ###
|
SELECT "San Antonio de Lomer\u00edo Municipality (%)" FROM table_23470 WHERE "San Javier Municipality (%)" = '31'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_2897 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
### Question ###
What was the score for game 4?
### Accurate SQL ###
|
SELECT "Score" FROM table_2897 WHERE "Game" = '4'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_54 ( circuit VARCHAR, winning_driver VARCHAR )
### Question ###
Which circuit did fran ois eysermann win ?
### Accurate SQL ###
|
SELECT circuit FROM table_name_54 WHERE winning_driver = "françois eysermann"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_218 ( "id" int, "plasma_glucose_concentration" int, "c_peptide_level" float, "body_weight" float, "diabetic" string, "single_antigen_b_sab" int, "low_density_lipoprotein_ldl_cholesterol" int, "body_mass_index_bmi" float, "triglyceride_tg" float, "NOUSE" float )
### Question ###
body mass index < 30 kg / m^2
### Accurate SQL ###
|
SELECT * FROM table_train_218 WHERE body_mass_index_bmi < 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 table_2077192_2 (phonetic_greek VARCHAR, french VARCHAR)
### Question ###
How many Phonetic Greek words translate to grenouille in French?
### Accurate SQL ###
|
SELECT COUNT(phonetic_greek) FROM table_2077192_2 WHERE french = "grenouille"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_499 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number, "money ($)" number )
### Question ###
number of golfers from the united states ?
### Accurate SQL ###
|
SELECT COUNT("player") FROM table_203_499 WHERE "country" = 'united states'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_59052 ( "Place" text, "Player" text, "Country" text, "Score" real, "To Par" text )
### Question ###
Which Score has a To Par of 1?
### Accurate SQL ###
|
SELECT MIN("Score") FROM table_59052 WHERE "To Par" = '–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_93 (cumulative_time__min_and_seconds_ VARCHAR, shuttle_time__seconds_ VARCHAR, total_level_time__s_ VARCHAR)
### Question ###
What is the cumulative time (min and seconds) that has more than 6 seconds in shuttle time and a total level time of 64.8 seconds?
### Accurate SQL ###
|
SELECT cumulative_time__min_and_seconds_ FROM table_name_93 WHERE shuttle_time__seconds_ > 6 AND total_level_time__s_ = 64.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_14929574_3 ( series__number INTEGER, directed_by VARCHAR )
### Question ###
Which episode number was directed by Bill Eagles?
### Accurate SQL ###
|
SELECT MIN(series__number) FROM table_14929574_3 WHERE directed_by = "Bill Eagles"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time )
TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number )
TABLE: CREATE TABLE 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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number )
TABLE: CREATE TABLE 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_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
TABLE: CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )
TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
### Question ###
in 2105 has patient 5887 received any lab test?
### Accurate SQL ###
|
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5887) AND STRFTIME('%y', labevents.charttime) = '2105'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 (rank INTEGER, total INTEGER)
### Question ###
What's the rank that has a total of less than 1?
### Accurate SQL ###
|
SELECT SUM(rank) FROM table_name_19 WHERE 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 table_70285 ( "Date" text, "Venue" text, "Score [A ]" text, "Competition" text, "Att." text )
### Question ###
Which venue was used on 12 September 1998?
### Accurate SQL ###
|
SELECT "Venue" FROM table_70285 WHERE "Date" = '12 september 1998'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_795 ( id number, "date" text, "opponent" text, "score" text, "result" text, "location" text, "attendance" number )
### Question ###
tell me a game the attendance was the same as january 10 .
### Accurate SQL ###
|
SELECT "date" FROM table_204_795 WHERE "date" <> 'january 10, 1949' AND "attendance" = (SELECT "attendance" FROM table_204_795 WHERE "date" = 'january 10, 1949')
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_9512 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
### Question ###
What is the most losses for positions under 15 and 66 goals against?
### Accurate SQL ###
|
SELECT MAX("Lost") FROM table_9512 WHERE "Goals Against" = '66' AND "Position" < '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_name_20 (location VARCHAR, rank VARCHAR)
### Question ###
What is the location of the mountain ranked at 36?
### Accurate SQL ###
|
SELECT location FROM table_name_20 WHERE rank = 36
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_1341973_6 ( candidates VARCHAR, incumbent VARCHAR )
### Question ###
What candidates ran in the election that included john shelley?
### Accurate SQL ###
|
SELECT candidates FROM table_1341973_6 WHERE incumbent = "John Shelley"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_40 (first_runner_up VARCHAR, miss_maja_pilipinas VARCHAR)
### Question ###
What First runner-up has a Miss Maja Pilipinas of nanette prodigalidad?
### Accurate SQL ###
|
SELECT first_runner_up FROM table_name_40 WHERE miss_maja_pilipinas = "nanette prodigalidad"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 ( firefox VARCHAR, chrome VARCHAR )
### Question ###
What was the firefox % was chrome was 25.08%?
### Accurate SQL ###
|
SELECT firefox FROM table_name_86 WHERE chrome = "25.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_19753079_8 ( district VARCHAR, incumbent VARCHAR )
### Question ###
What district did George Miller belong to?
### Accurate SQL ###
|
SELECT district FROM table_19753079_8 WHERE incumbent = "George Miller"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_20866024_3 (engine VARCHAR, model_designation VARCHAR)
### Question ###
What type of engine does the model with model designation 97F00 have?
### Accurate SQL ###
|
SELECT engine FROM table_20866024_3 WHERE model_designation = "97F00"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_59833 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
### Question ###
What is the round for the opponent CSKA Sofia in Venue A?
### Accurate SQL ###
|
SELECT "Round" FROM table_59833 WHERE "Opponent" = 'cska sofia' AND "Venue" = '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_name_44 ( date VARCHAR, opponent VARCHAR )
### Question ###
What date was the opponent the Boston Yanks?
### Accurate SQL ###
|
SELECT date FROM table_name_44 WHERE opponent = "boston yanks"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_20722805_1 ( parish VARCHAR, mccain_percentage VARCHAR )
### Question ###
What parish did McCain have 45.37% of the votes?
### Accurate SQL ###
|
SELECT parish FROM table_20722805_1 WHERE mccain_percentage = "45.37%"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_14 ( visitor VARCHAR, date VARCHAR )
### Question ###
Who is the visitor on May 9?
### Accurate SQL ###
|
SELECT visitor FROM table_name_14 WHERE date = "may 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 table_78794 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
### Question ###
Which Score has a Record of 0-1?
### Accurate SQL ###
|
SELECT "Score" FROM table_78794 WHERE "Record" = '0-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_39 ( result VARCHAR, round VARCHAR )
### Question ###
What is the result of round 4?
### Accurate SQL ###
|
SELECT result FROM table_name_39 WHERE round = 4
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE products ( product_id text, product_name text, product_price number, product_description text, other_product_service_details text )
TABLE: CREATE TABLE performers_in_bookings ( order_id number, performer_id number )
TABLE: CREATE TABLE clients ( client_id number, address_id number, customer_email_address text, customer_name text, customer_phone text, other_details text )
TABLE: CREATE TABLE addresses ( address_id text, line_1 text, line_2 text, city_town text, state_county text, other_details text )
TABLE: CREATE TABLE drama_workshop_groups ( workshop_group_id number, address_id number, currency_code text, marketing_region_code text, store_name text, store_phone text, store_email_address text, other_details text )
TABLE: CREATE TABLE stores ( store_id text, address_id number, marketing_region_code text, store_name text, store_phone text, store_email_address text, other_details text )
TABLE: CREATE TABLE services ( service_id number, service_type_code text, workshop_group_id number, product_description text, product_name text, product_price number, other_product_service_details text )
TABLE: CREATE TABLE performers ( performer_id number, address_id number, customer_name text, customer_phone text, customer_email_address text, other_details text )
TABLE: CREATE TABLE invoices ( invoice_id number, order_id number, payment_method_code text, product_id number, order_quantity text, other_item_details text, order_item_id number )
TABLE: CREATE TABLE marketing_regions ( marketing_region_code text, marketing_region_name text, marketing_region_descriptrion text, other_details text )
TABLE: CREATE TABLE customers ( customer_id text, address_id number, customer_name text, customer_phone text, customer_email_address text, other_details text )
TABLE: CREATE TABLE bookings_services ( order_id number, product_id number )
TABLE: CREATE TABLE bookings ( booking_id number, customer_id number, workshop_group_id text, status_code text, store_id number, order_date time, planned_delivery_date time, actual_delivery_date time, other_order_details text )
TABLE: CREATE TABLE ref_service_types ( service_type_code text, parent_service_type_code text, service_type_description text )
TABLE: CREATE TABLE invoice_items ( invoice_item_id number, invoice_id number, order_id number, order_item_id number, product_id number, order_quantity number, other_item_details text )
TABLE: CREATE TABLE order_items ( order_item_id number, order_id number, product_id number, order_quantity text, other_item_details text )
TABLE: CREATE TABLE ref_payment_methods ( payment_method_code text, payment_method_description text )
TABLE: CREATE TABLE customer_orders ( order_id number, customer_id number, store_id number, order_date time, planned_delivery_date time, actual_delivery_date time, other_order_details text )
### Question ###
What is the description and code of the type of service that is performed the most often?
### Accurate SQL ###
|
SELECT T1.service_type_description, T1.service_type_code FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code GROUP BY T1.service_type_code 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_12 (de_laet__1633_ VARCHAR, munsee_delaware VARCHAR)
### Question ###
What is the De Laet term for a Munsee Delaware term of ní·ša?
### Accurate SQL ###
|
SELECT de_laet__1633_ FROM table_name_12 WHERE munsee_delaware = "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 film (title VARCHAR, Studio VARCHAR)
### Question ###
Find the titles and studios of the films that are produced by some film studios that contained the word "Universal".
### Accurate SQL ###
|
SELECT title, Studio FROM film WHERE Studio LIKE "%Universal%"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
### Question ###
give me the number of patients whose primary disease is aortic insufficiency\re-do sternotomy; aortic valve replacement and admission year is less than 2198?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.admityear < "2198"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_25548630_1 (points VARCHAR, team VARCHAR)
### Question ###
How many points does Marussia Manor Racing have?
### Accurate SQL ###
|
SELECT COUNT(points) FROM table_25548630_1 WHERE team = "Marussia Manor 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 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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
### Question ###
what is the marital status and days of hospital stay of subject id 6983?
### Accurate SQL ###
|
SELECT demographic.marital_status, demographic.days_stay FROM demographic WHERE demographic.subject_id = "6983"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 ( class VARCHAR, call_sign VARCHAR )
### Question ###
Name the class with call sign of k220cp
### Accurate SQL ###
|
SELECT class FROM table_name_2 WHERE call_sign = "k220cp"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_4456 ( "Shipyard" text, "Laid down" text, "Launched" text, "Commissioned" text, "Fleet" text, "Status" text )
### Question ###
Tell me the launched for august 31, 1964
### Accurate SQL ###
|
SELECT "Launched" FROM table_4456 WHERE "Commissioned" = 'august 31, 1964'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_38916 ( "Position" text, "Name" text, "School" text, "Unanimous" text, "College Hall of Fame" text )
### Question ###
What is the unanimous result of the player from Michigan Dartmouth?
### Accurate SQL ###
|
SELECT "Unanimous" FROM table_38916 WHERE "School" = 'michigan dartmouth'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_32621 ( "Stage" text, "Date" text, "Route" text, "Terrain" text, "Length" text, "Winner" text )
### Question ###
What was the terrain for stage 10 of the tour?
### Accurate SQL ###
|
SELECT "Terrain" FROM table_32621 WHERE "Stage" = '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_name_69 ( year__ceremony_ VARCHAR, original_title VARCHAR )
### Question ###
What year was Zona Sur nominated?
### Accurate SQL ###
|
SELECT year__ceremony_ FROM table_name_69 WHERE original_title = "zona sur"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 (list_entry_number VARCHAR, name VARCHAR)
### Question ###
What is the entry number on the list for Fairfield Moravian Church?
### Accurate SQL ###
|
SELECT list_entry_number FROM table_name_13 WHERE name = "fairfield moravian church"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_43396 ( "Season" text, "Games" real, "Lost" real, "Points" real, "Pct %" real, "Goals for" real, "Goals against" real, "Playoffs" text )
### Question ###
What is the highest Pct %, when Goals Against is less than 229?
### Accurate SQL ###
|
SELECT MAX("Pct %") FROM table_43396 WHERE "Goals against" < '229'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_63027 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
### Question ###
What is the average silver that has a gold greater than 3, with soviet union (urs) as the nation, and a bronze greater than 26?
### Accurate SQL ###
|
SELECT AVG("Silver") FROM table_63027 WHERE "Gold" > '3' AND "Nation" = 'soviet union (urs)' AND "Bronze" > '26'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_1 ( away_team VARCHAR )
### Question ###
What is essendon's away team score?
### Accurate SQL ###
|
SELECT away_team AS score FROM table_name_1 WHERE away_team = "essendon"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar )
TABLE: CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int )
TABLE: CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int )
TABLE: CREATE TABLE ta ( campus_job_id int, student_id int, location varchar )
TABLE: CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar )
TABLE: CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int )
TABLE: CREATE TABLE gsi ( course_offering_id int, student_id int )
TABLE: CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar )
TABLE: CREATE TABLE semester ( semester_id int, semester varchar, year int )
TABLE: CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar )
TABLE: CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar )
TABLE: CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar )
TABLE: CREATE TABLE course_prerequisite ( pre_course_id int, course_id int )
TABLE: CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar )
TABLE: CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar )
TABLE: CREATE TABLE area ( course_id int, area varchar )
TABLE: CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int )
TABLE: CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar )
### Question ###
What are the PreMajor classes ?
### Accurate SQL ###
|
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_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 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 )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
### Question ###
look for the route of drug administration and primary disease of patient marilyn norvell.
### Accurate SQL ###
|
SELECT demographic.diagnosis, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Marilyn Norvell"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number )
TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text )
TABLE: CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number )
TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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 d_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
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 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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )
TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time )
### Question ###
when did patient 23061 have the first foley output until 10/25/2101.
### Accurate SQL ###
|
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23061)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'foley' AND d_items.linksto = 'outputevents') AND STRFTIME('%y-%m-%d', outputevents.charttime) <= '2101-10-25' ORDER BY outputevents.charttime LIMIT 1
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_55981 ( "Name" text, "Current version" text, "System" text, "Platform" text, "License" text )
### Question ###
What is the System when the Licence is gpl and the Current Version is 1.72?
### Accurate SQL ###
|
SELECT "System" FROM table_55981 WHERE "License" = 'gpl' AND "Current version" = '1.72'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_33756 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" real )
### Question ###
What is the attendance for week 11?
### Accurate SQL ###
|
SELECT "Attendance" FROM table_33756 WHERE "Week" = '11'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_27021001_1 (district VARCHAR, result VARCHAR)
### Question ###
What is the district with the result mac collins (r) unopposed?
### Accurate SQL ###
|
SELECT district FROM table_27021001_1 WHERE result = "Mac Collins (R) unopposed"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 (laps VARCHAR, year VARCHAR)
### Question ###
Name the total number of Laps for year of 1961
### Accurate SQL ###
|
SELECT COUNT(laps) FROM table_name_48 WHERE year = "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 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 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 )
### Question ###
what is the number of emergency room hospital admitted patients who were diagnosed with other malignant lymphomas, unspecified site, extranodal and solid organ sites?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Other malignant lymphomas, unspecified site, extranodal and solid organ sites"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_71154 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Pts." text )
### Question ###
What ist he entrant later than 1963 with an eagle MK1 chassis?
### Accurate SQL ###
|
SELECT "Entrant" FROM table_71154 WHERE "Year" > '1963' AND "Chassis" = 'eagle mk1'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_49 (crowd INTEGER, venue VARCHAR)
### Question ###
What was the crowd when the VFL played MCG?
### Accurate SQL ###
|
SELECT MIN(crowd) FROM table_name_49 WHERE venue = "mcg"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool )
TABLE: CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int )
TABLE: CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int )
### Question ###
A bar chart showing how many debates are held for each venue, and list how many venue in descending order.
### Accurate SQL ###
|
SELECT Venue, COUNT(Venue) FROM debate GROUP BY Venue ORDER BY COUNT(Venue) DESC
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_32 (date VARCHAR, result VARCHAR)
### Question ###
When was there a bye result?
### Accurate SQL ###
|
SELECT date FROM table_name_32 WHERE result = "bye"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 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 )
### Question ###
how many patients of black/african american ethnicity are under 79 years of age?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.age < "79"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Residents ( resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME, date_moved_out DATETIME, other_details VARCHAR(255) )
TABLE: CREATE TABLE Customer_Events ( Customer_Event_ID INTEGER, customer_id INTEGER, date_moved_in DATETIME, property_id INTEGER, resident_id INTEGER, thing_id INTEGER )
TABLE: CREATE TABLE Services ( service_id INTEGER, organization_id INTEGER, service_type_code CHAR(15), service_details VARCHAR(255) )
TABLE: CREATE TABLE Residents_Services ( resident_id INTEGER, service_id INTEGER, date_moved_in DATETIME, property_id INTEGER, date_requested DATETIME, date_provided DATETIME, other_details VARCHAR(255) )
TABLE: CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER, Customer_Event_ID INTEGER, service_type_code CHAR(15), resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME )
TABLE: CREATE TABLE Customers ( customer_id INTEGER, customer_details VARCHAR(255) )
TABLE: CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time DATETIME, Location_Code CHAR(15) )
TABLE: CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(255) )
TABLE: CREATE TABLE Things ( thing_id INTEGER, organization_id INTEGER, Type_of_Thing_Code CHAR(15), service_type_code CHAR(10), service_details VARCHAR(255) )
TABLE: CREATE TABLE Organizations ( organization_id INTEGER, parent_organization_id INTEGER, organization_details VARCHAR(255) )
TABLE: CREATE TABLE Timed_Status_of_Things ( thing_id INTEGER, Date_and_Date DATETIME, Status_of_Thing_Code CHAR(15) )
### Question ###
Please compare the frequency of the customer details using a bar chart.
### Accurate SQL ###
|
SELECT customer_details, COUNT(customer_details) FROM Customers GROUP BY customer_details
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 (player VARCHAR, position VARCHAR, school VARCHAR)
### Question ###
Who is the guard for Wisconsin?
### Accurate SQL ###
|
SELECT player FROM table_name_44 WHERE position = "guard" AND school = "wisconsin"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 (place VARCHAR, player VARCHAR)
### Question ###
Which Place has a Player of justin leonard?
### Accurate SQL ###
|
SELECT place FROM table_name_48 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 table_name_46 (score VARCHAR, opponents_in_the_final VARCHAR)
### Question ###
What is the Score of the match where Opponents in the Final was Vitalia Diatchenko Irena Pavlovic?
### Accurate SQL ###
|
SELECT score FROM table_name_46 WHERE opponents_in_the_final = "vitalia diatchenko irena pavlovic"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 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 date_day ( month_number int, day_number int, year int, 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 city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar )
TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text )
TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time 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 state ( state_code text, state_name text, country_name text )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id int )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code 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 food_service ( meal_code text, meal_number int, compartment text, meal_description varchar )
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 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 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 days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt 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 code_description ( code varchar, description text )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int )
TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )
### Question ###
does any airline offer DC10 service between DENVER and BOSTON
### Accurate SQL ###
|
SELECT DISTINCT airline.airline_code FROM aircraft, airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (aircraft.basic_type = 'DC10' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND equipment_sequence.aircraft_code = aircraft.aircraft_code AND flight.aircraft_code_sequence = equipment_sequence.aircraft_code_sequence AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND flight.airline_code = airline.airline_code AND flight.from_airport = AIRPORT_SERVICE_0.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 table_name_53 ( total_foreign_born__1000_ INTEGER, born_in_a_non_eu_state__1000_ VARCHAR, total_population__1000_ VARCHAR )
### Question ###
What is the highest Total Foreign-born (1000) from a non EU state (1000) of 685 and a population (1000) smaller than 10,666?
### Accurate SQL ###
|
SELECT MAX(total_foreign_born__1000_) FROM table_name_53 WHERE born_in_a_non_eu_state__1000_ = 685 AND total_population__1000_ > 10 OFFSET 666
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) )
TABLE: CREATE TABLE 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 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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) )
### Question ###
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the last_name , I want to show names in asc order.
### Accurate SQL ###
|
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_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_51832 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text, "Notes" text )
### Question ###
What was the notes of the 400 m event before 2004 with a position of 12th (h)?
### Accurate SQL ###
|
SELECT "Notes" FROM table_51832 WHERE "Event" = '400 m' AND "Year" < '2004' AND "Position" = '12th (h)'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_35935 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
### Question ###
What is the lowest round of Ed Smith, who had a pick lower than 19?
### Accurate SQL ###
|
SELECT MIN("Round") FROM table_35935 WHERE "Player" = 'ed smith' AND "Pick" > '19'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 (mayor VARCHAR, election VARCHAR, municipality VARCHAR)
### Question ###
What is the Mayor of Riva del Garda in 2010?
### Accurate SQL ###
|
SELECT mayor FROM table_name_37 WHERE election = 2010 AND municipality = "riva del garda"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 ( _percentage_gdp VARCHAR, income VARCHAR, expenditure VARCHAR, year VARCHAR )
### Question ###
Which % GDP has an Expenditure larger than 50.9, and a Year larger than 2009, and an Income of 39.3?
### Accurate SQL ###
|
SELECT _percentage_gdp FROM table_name_16 WHERE expenditure > 50.9 AND year > 2009 AND income = 39.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 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 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 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 vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
### Question ###
until 2104, what was the yearly minimum weight of patient 005-86645?
### Accurate SQL ###
|
SELECT MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-86645') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y', patient.unitadmittime) <= '2104' GROUP BY STRFTIME('%y', patient.unitadmittime)
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_1341930_10 ( first_elected INTEGER )
### Question ###
What year were the latest elections?
### Accurate SQL ###
|
SELECT MAX(first_elected) FROM table_1341930_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_78355 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text )
### Question ###
What is the result for rounds under 2 against D.J. Linderman?
### Accurate SQL ###
|
SELECT "Res." FROM table_78355 WHERE "Round" < '2' AND "Opponent" = 'd.j. linderman'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_49 ( id number, "city" text, "country" text, "iata" text, "icao" text, "airport" text, "commenced" number, "ended" text )
### Question ###
what are the number of times 2013 appears under the commenced column ?
### Accurate SQL ###
|
SELECT COUNT(*) FROM table_204_49 WHERE "commenced" = 2013
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_5 (population__1_july_2005_est_ INTEGER, population_density__per_km²_ VARCHAR)
### Question ###
What is the lowest Population (1 July 2005 est.), when Population density (per km²) is 0?
### Accurate SQL ###
|
SELECT MIN(population__1_july_2005_est_) FROM table_name_5 WHERE population_density__per_km²_ = 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 host ( host_id number, name text, nationality text, age text )
TABLE: CREATE TABLE party_host ( party_id number, host_id number, is_main_in_charge others )
TABLE: CREATE TABLE party ( party_id number, party_theme text, location text, first_year text, last_year text, number_of_hosts number )
### Question ###
What are the name and the nationality of the host of the highest age?
### Accurate SQL ###
|
SELECT name, nationality FROM host ORDER BY age 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 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 code_description ( code varchar, description 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 city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code 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 date_day ( month_number int, day_number int, year int, day_name varchar )
TABLE: CREATE TABLE month ( month_number int, month_name text )
TABLE: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
TABLE: CREATE TABLE compartment_class ( compartment varchar, class_type varchar )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description 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_fare ( flight_id int, fare_id int )
TABLE: CREATE TABLE days ( days_code varchar, day_name varchar )
TABLE: CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare 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 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 airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant 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 time_interval ( period text, begin_time int, end_time int )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight 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 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 )
TABLE: CREATE TABLE state ( state_code text, state_name text, country_name text )
### Question ###
what does S/ designate as a meal
### Accurate SQL ###
|
SELECT DISTINCT compartment, meal_code, meal_description, meal_number FROM food_service WHERE meal_code = 'S/'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 (manager VARCHAR, wpct VARCHAR, years VARCHAR, losses VARCHAR, wins VARCHAR)
### Question ###
Which manager had less than 287 losses, less than 80 wins, a win percentage of 0.296, and was employed in 1904?
### Accurate SQL ###
|
SELECT manager FROM table_name_96 WHERE losses < 287 AND wins < 80 AND years = "1904" AND wpct = 0.296
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_23938357_7 ( ws_points VARCHAR )
### Question ###
What is the smallest 08-09 GP/JGP 2nd value when WS points equals 3197?
### Accurate SQL ###
|
SELECT MIN(08 AS _09_gp_jgp_2nd) FROM table_23938357_7 WHERE ws_points = 3197
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_28 (round INTEGER, away_team VARCHAR)
### Question ###
What is the latest round for Pohang Steelers as the away team?
### Accurate SQL ###
|
SELECT MAX(round) FROM table_name_28 WHERE away_team = "pohang steelers"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
### Question ###
how many patients are born before 2056 and lab tested for pleural fluid?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2056" AND lab.fluid = "Pleural"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Enrolled_in ( StuID INTEGER, CID VARCHAR(7), Grade VARCHAR(2) )
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 Course ( CID VARCHAR(7), CName VARCHAR(40), Credits INTEGER, Instructor INTEGER, Days VARCHAR(5), Hours VARCHAR(11), DNO INTEGER )
TABLE: CREATE TABLE Member_of ( FacID INTEGER, DNO INTEGER, Appt_Type VARCHAR(15) )
TABLE: CREATE TABLE Department ( DNO INTEGER, Division VARCHAR(2), DName VARCHAR(25), Room VARCHAR(5), Building VARCHAR(13), DPhone INTEGER )
TABLE: CREATE TABLE Gradeconversion ( lettergrade VARCHAR(2), gradepoint FLOAT )
TABLE: CREATE TABLE Minor_in ( StuID INTEGER, DNO INTEGER )
TABLE: CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) )
### Question ###
Visualize a bar chart about the distribution of Days and the average of Credits , and group by attribute Days.
### Accurate SQL ###
|
SELECT Days, AVG(Credits) FROM Course GROUP BY Days ORDER BY Credits
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.