text
stringlengths 432
6.49k
| target
stringlengths 2
4.44k
|
|---|---|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_81 ( title VARCHAR, director VARCHAR, production_number VARCHAR )
### Question ###
What is the name of the title that was directed by Friz Freleng and has a production number of 443?
### Accurate SQL ###
|
SELECT title FROM table_name_81 WHERE director = "friz freleng" AND production_number = "443"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_31 (golden_point_s__scorer VARCHAR, venue VARCHAR)
### Question ###
What Golden point(s) has the Venue Allianz Stadium?
### Accurate SQL ###
|
SELECT golden_point_s__scorer FROM table_name_31 WHERE venue = "allianz stadium"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostTypes ( Id number, Name text )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean )
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 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 SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number )
TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId 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 ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )
### Question ###
Cassandra question count by day.
### Accurate SQL ###
|
SELECT TIME_TO_STR(Posts.CreationDate, '%YEAR') AS Year, TIME_TO_STR(Posts.CreationDate, '%-mONT%-H') AS Month, COUNT(Posts.Id), COUNT(Posts.AnswerCount), COUNT(Posts.CommentCount) FROM Tags, PostTags, Posts WHERE Tags.TagName = 'cassandra' AND Tags.Id = PostTags.TagId AND PostTags.PostId = Posts.Id AND Posts.CreationDate < '2016-10-01' AND Posts.CreationDate > '2015-01-01' GROUP BY TIME_TO_STR(Posts.CreationDate, '%YEAR'), TIME_TO_STR(Posts.CreationDate, '%-mONT%-H') ORDER BY Year, Month
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_67985 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
### Question ###
What chassis type does a scuderia ferrari with more than 1 point have?
### Accurate SQL ###
|
SELECT "Chassis" FROM table_67985 WHERE "Entrant" = 'scuderia ferrari' AND "Points" > '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_44178 ( "Pos." text, "Class" text, "Entrant" text, "Drivers" text, "Laps" real )
### Question ###
What was the highest amount of laps when the class was v8 and the entrant was diet-coke racing?
### Accurate SQL ###
|
SELECT MAX("Laps") FROM table_44178 WHERE "Class" = 'v8' AND "Entrant" = 'diet-coke 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 table_name_49 (total__kg_ VARCHAR, snatch VARCHAR, clean_ VARCHAR, _jerk VARCHAR)
### Question ###
What is the total associated with a Clean & jerk of 135, and a Snatch of 115?
### Accurate SQL ###
|
SELECT total__kg_ FROM table_name_49 WHERE clean_ & _jerk = 135 AND snatch = 115
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
### Question ###
find the number of patients whose diagnoses short title is crbl art ocl nos w infrc and lab test result is abnormal.
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Crbl art ocl NOS w infrc" AND lab.flag = "abnormal"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_38416 ( "Pick #" real, "MLS Team" text, "Player" text, "Position" text, "Affiliation" text )
### Question ###
How many picks involved the player Joe Germanese?
### Accurate SQL ###
|
SELECT SUM("Pick #") FROM table_38416 WHERE "Player" = 'joe germanese'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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_52 ( district VARCHAR, incumbent VARCHAR )
### Question ###
What district has benjamin eggleston for incumbent?
### Accurate SQL ###
|
SELECT district FROM table_name_52 WHERE incumbent = "benjamin eggleston"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_83 (ratings VARCHAR, host VARCHAR, viewers VARCHAR)
### Question ###
What were the ratings for host Chris Economaki who had 12.3 million viewers?
### Accurate SQL ###
|
SELECT ratings FROM table_name_83 WHERE host = "chris economaki" AND viewers = "12.3 million"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
### Question ###
how many patients whose discharge location is home health care and days of hospital stay is greater than 15?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.days_stay > "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_10226 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
### Question ###
Where was the game played when the crowd was more than 14,534 and the home team scored 13.22 (100)?
### Accurate SQL ###
|
SELECT "Venue" FROM table_10226 WHERE "Crowd" > '14,534' AND "Home team score" = '13.22 (100)'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_40229 ( "Season" text, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "Podiums" real, "Points" real, "Position" text )
### Question ###
What is the points sum of the series with less than 0 poles?
### Accurate SQL ###
|
SELECT SUM("Points") FROM table_40229 WHERE "Poles" < '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 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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )
TABLE: CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int )
TABLE: CREATE TABLE flight_fare ( flight_id int, fare_id 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 )
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 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 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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar )
TABLE: CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int )
TABLE: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int )
TABLE: CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text )
TABLE: CREATE TABLE state ( state_code text, state_name text, country_name 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 date_day ( month_number int, day_number int, year int, day_name 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 code_description ( code varchar, description text )
TABLE: CREATE TABLE time_interval ( period text, begin_time int, end_time int )
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 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 month ( month_number int, month_name text )
### Question ###
list flights from DETROIT to SAN DIEGO on thursday
### Accurate SQL ###
|
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DETROIT' 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_1682026_2 (company VARCHAR, profits__billion_$_ VARCHAR)
### Question ###
Which company had profits of 26.9?
### Accurate SQL ###
|
SELECT company FROM table_1682026_2 WHERE profits__billion_$_ = "26.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_train_46 ( "id" int, "bleeding" int, "active_infection" bool, "hypotension" bool, "burn_injury" int, "hypertension" bool, "age" float, "NOUSE" float )
### Question ###
10 % of body surface area acute burn injury
### Accurate SQL ###
|
SELECT * FROM table_train_46 WHERE burn_injury > 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_51 (staffel_d VARCHAR, staffel_e VARCHAR, season VARCHAR)
### Question ###
What is the Staffel D in the season 1983-84 with a Staffel E of Motor Suhl?
### Accurate SQL ###
|
SELECT staffel_d FROM table_name_51 WHERE staffel_e = "motor suhl" AND season = "1983-84"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE college ( cname text, state text, enr number )
TABLE: CREATE TABLE player ( pid number, pname text, ycard text, hs number )
TABLE: CREATE TABLE tryout ( pid number, cname text, ppos text, decision text )
### Question ###
What are the names of all colleges with a larger enrollment than the largest college in Florida?
### Accurate SQL ###
|
SELECT cname FROM college WHERE enr > (SELECT MAX(enr) FROM college WHERE state = 'FL')
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_26 ( power__mw_ INTEGER, voltage__kv_ VARCHAR, country VARCHAR )
### Question ###
Which Power (MW) has a Voltage (kV) of 500, and a Country of argentina?
### Accurate SQL ###
|
SELECT AVG(power__mw_) FROM table_name_26 WHERE voltage__kv_ = 500 AND country = "argentina"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_5 ( distance VARCHAR, stage VARCHAR )
### Question ###
Name the distance for stage of 2
### Accurate SQL ###
|
SELECT distance FROM table_name_5 WHERE stage = "2"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_6 ( airport VARCHAR, icao VARCHAR )
### Question ###
Name the airport for ICAO of flls
### Accurate SQL ###
|
SELECT airport FROM table_name_6 WHERE icao = "flls"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_47 ( assembled VARCHAR, elected VARCHAR )
### Question ###
What is the assembled date of the parliament elected in 1620/21?
### Accurate SQL ###
|
SELECT assembled FROM table_name_47 WHERE elected = "1620/21"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text )
TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )
TABLE: CREATE TABLE 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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
TABLE: CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number )
TABLE: CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod 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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text )
TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE 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 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 )
### Question ###
is patient 92846 ever prescribed miconazole 2% cream in 12/2105?
### Accurate SQL ###
|
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92846) AND prescriptions.drug = 'miconazole 2% cream' AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-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_25548 ( "Year" real, "Dates" text, "Champion" text, "Country" text, "Score" text, "Margin of victory" text, "Tournament location" text, "Purse ( $ )" real, "Winners share ($)" real )
### Question ###
What was the score in 1978?
### Accurate SQL ###
|
SELECT "Score" FROM table_25548 WHERE "Year" = '1978'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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 (year_s__of_manufacture VARCHAR, quantity VARCHAR, axle_arrangement___uic__ VARCHAR)
### Question ###
What year was the b n2t axle arrangement, which has a quantity of 31, manufactured?
### Accurate SQL ###
|
SELECT year_s__of_manufacture FROM table_name_74 WHERE quantity = 31 AND axle_arrangement___uic__ = "b n2t"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_17920 ( "Position" real, "Club" text, "Played" real, "Won" real, "Drawn" real, "Lost" real, "Pts For" real, "Pts Agst" real, "B.P." real, "Points" real )
### Question ###
What is the number of played when points against 645?
### Accurate SQL ###
|
SELECT COUNT("Played") FROM table_17920 WHERE "Pts Agst" = '645'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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 (party VARCHAR, result VARCHAR, incumbent VARCHAR)
### Question ###
What party was re-elected as an incumbent of robert p. Kennedy?
### Accurate SQL ###
|
SELECT party FROM table_name_69 WHERE result = "re-elected" AND incumbent = "robert p. kennedy"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_18328569_1 ( new_entries_this_round VARCHAR, round VARCHAR )
### Question ###
How many new entries started in the quarter finals?
### Accurate SQL ###
|
SELECT new_entries_this_round FROM table_18328569_1 WHERE round = "Quarter finals"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_7093 ( "Episode" real, "Title" text, "Story" text, "Adapted by" text, "Director" text, "Airdate" text, "Exists?" text )
### Question ###
What is the Exists when Ray Jenkins is the director?
### Accurate SQL ###
|
SELECT "Exists?" FROM table_7093 WHERE "Director" = 'ray jenkins'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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 ( opponent VARCHAR, type_of_game VARCHAR, results¹ VARCHAR )
### Question ###
Which opponent played a 1990 wcq type of game, where the results were 0:0?
### Accurate SQL ###
|
SELECT opponent FROM table_name_99 WHERE type_of_game = "1990 wcq" AND results¹ = "0: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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE 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 )
### Question ###
provide the number of patients whose admission type is emergency and diagnoses icd9 code is 5609?
### 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.icd9_code = "5609"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_64260 ( "Class" text, "Railway number(s)" text, "Quantity" text, "Year(s) of manufacture" text, "Type" text )
### Question ###
What is the quantity of the aw class?
### Accurate SQL ###
|
SELECT "Quantity" FROM table_64260 WHERE "Class" = 'aw'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE mountain ( Country VARCHAR )
### Question ###
List the countries that have more than one mountain.
### Accurate SQL ###
|
SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 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_37086 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Series" text )
### Question ###
Which opponent was present on April 14?
### Accurate SQL ###
|
SELECT "Opponent" FROM table_37086 WHERE "Date" = 'april 14'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_70059 ( "Rank" real, "Circuit" text, "Headquarters" text, "Screens" real, "Sites" real )
### Question ###
what is the rank of the cinema when the number of sites is more than 62 and the circuit is cineplex entertainment?
### Accurate SQL ###
|
SELECT SUM("Rank") FROM table_70059 WHERE "Sites" > '62' AND "Circuit" = 'cineplex entertainment'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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_70 (branding VARCHAR, frequency VARCHAR)
### Question ###
What is the Branding of Frequency 00 94.5?
### Accurate SQL ###
|
SELECT branding FROM table_name_70 WHERE frequency = "00 94.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_14260687_3 (blackberry_os VARCHAR, symbian VARCHAR)
### Question ###
How many millions of Blackberry OS smartphones were shipped when 10.4 million Symbian smartphones were shipped?
### Accurate SQL ###
|
SELECT blackberry_os FROM table_14260687_3 WHERE symbian = "10.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_20 ( position VARCHAR, played VARCHAR, points VARCHAR, lost VARCHAR )
### Question ###
What is the total number of positions having points over 2, more than 4 losses, and under 10 matches played?
### Accurate SQL ###
|
SELECT COUNT(position) FROM table_name_20 WHERE points > 2 AND lost > 4 AND played < 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_64972 ( "Governor" text, "Took office" text, "Left office" text, "Party" text, "Lieutenant Governor" text, "Terms" text )
### Question ###
Who was lieutenant governor to the governor that left office on October 16, 2000?
### Accurate SQL ###
|
SELECT "Lieutenant Governor" FROM table_64972 WHERE "Left office" = 'october 16, 2000'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME )
TABLE: CREATE TABLE Product_Suppliers ( product_id INTEGER, supplier_id INTEGER, date_supplied_from DATETIME, date_supplied_to DATETIME, total_amount_purchased VARCHAR(80), total_value_purchased DECIMAL(19,4) )
TABLE: CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(10), order_date DATETIME )
TABLE: CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) )
TABLE: CREATE TABLE Departments ( department_id INTEGER, dept_store_id INTEGER, department_name VARCHAR(80) )
TABLE: CREATE TABLE Staff ( staff_id INTEGER, staff_gender VARCHAR(1), staff_name VARCHAR(80) )
TABLE: CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(10), customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) )
TABLE: CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) )
TABLE: CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80) )
TABLE: CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) )
TABLE: CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, department_id INTEGER, date_assigned_from DATETIME, job_title_code VARCHAR(10), date_assigned_to DATETIME )
TABLE: CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME )
TABLE: CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) )
TABLE: CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER )
### Question ###
Give the minimum product price for each product type in a pie chart.
### Accurate SQL ###
|
SELECT product_type_code, MIN(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_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_49345 ( "Municipalities of the city" text, "Area km\u00b2" text, "Population censo 2007(hab)" text, "Population under 1 year-old Censo 2007(hab)" text, "Households (2007)" text, "Density (hab/ km\u00b2 )" text, "Elevation msnm" text )
### Question ###
What is the density (hab/km ) with a population under 1 year-old censo 2007(hab) of * data from the census taken by the Inei?
### Accurate SQL ###
|
SELECT "Density (hab/ km\u00b2 )" FROM table_49345 WHERE "Population under 1 year-old Censo 2007(hab)" = '* data from the census taken by the inei'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE body_builder ( body_builder_id number, people_id number, snatch number, clean_jerk number, total number )
TABLE: CREATE TABLE people ( people_id number, name text, height number, weight number, birth_date text, birth_place text )
### Question ###
How many body builders are there?
### Accurate SQL ###
|
SELECT COUNT(*) FROM body_builder
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_79429 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
### Question ###
What country is ranked larger than 4?
### Accurate SQL ###
|
SELECT "Country" FROM table_79429 WHERE "Rank" > '4'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_15 (result VARCHAR, extra VARCHAR, year VARCHAR)
### Question ###
what is the result when extra is 4 x 100 m relay and the year is later than 1971?
### Accurate SQL ###
|
SELECT result FROM table_name_15 WHERE extra = "4 x 100 m relay" AND year > 1971
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_23338693_1 (races VARCHAR, season VARCHAR, podiums VARCHAR)
### Question ###
How many races in 2012 season have 0 podiums?
### Accurate SQL ###
|
SELECT COUNT(races) FROM table_23338693_1 WHERE season = 2012 AND podiums = 0
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_33463 ( "Network" text, "Origin of Programming" text, "Language" text, "Genre" text, "Service" text )
### Question ###
What genre is Set Max's Hindi programming?
### Accurate SQL ###
|
SELECT "Genre" FROM table_33463 WHERE "Language" = 'hindi' AND "Network" = 'set max'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE stadium ( id number, name text, capacity number, city text, country text, opening_year number )
TABLE: CREATE TABLE event ( id number, name text, stadium_id number, year text )
TABLE: CREATE TABLE record ( id number, result text, swimmer_id number, event_id number )
TABLE: CREATE TABLE swimmer ( id number, name text, nationality text, meter_100 number, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, time text )
### Question ###
Find the names of the swimmers who have both 'win' and 'loss' results in the record.
### Accurate SQL ###
|
SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE result = 'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE result = 'Loss'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time )
TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time )
TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time )
TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time )
TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time )
TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text )
TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )
TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number )
TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )
TABLE: CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text )
### Question ###
how many hours have elapsed since patient 035-2205's last procedure of during their current hospital visit?
### Accurate SQL ###
|
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2205' AND patient.hospitaldischargetime IS NULL)) ORDER BY treatment.treatmenttime DESC LIMIT 1
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text )
### Question ###
what is average age of patients whose admission type is emergency and year of birth is greater than 2074?
### Accurate SQL ###
|
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year > "2074"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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 ( visitor VARCHAR, date VARCHAR )
### Question ###
Who is the visitor team of the game on March 2, 2008?
### Accurate SQL ###
|
SELECT visitor FROM table_name_19 WHERE date = "march 2, 2008"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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_17 ( combined_elapsed_time VARCHAR, skipper VARCHAR )
### Question ###
Which Combined elapsed time has a Skipper of stephen wilkins?
### Accurate SQL ###
|
SELECT combined_elapsed_time FROM table_name_17 WHERE skipper = "stephen wilkins"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_78970 ( "Name" text, "Code" text, "Capacity" text, "Configuration" text, "Power" text, "Torque" text, "Top speed" text, "Acceleration 0\u2013100km/h (0\u201362mph)" text )
### Question ###
What is the capacity of code f4r?
### Accurate SQL ###
|
SELECT "Capacity" FROM table_78970 WHERE "Code" = 'f4r'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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_35 ( fcc_info VARCHAR, state VARCHAR, city_of_license VARCHAR )
### Question ###
What is the FCC info for the radio station in West Lafayette, Indiana?
### Accurate SQL ###
|
SELECT fcc_info FROM table_name_35 WHERE state = "indiana" AND city_of_license = "west lafayette"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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_18 (round INTEGER, player VARCHAR, pick VARCHAR)
### Question ###
What is the earliest round that Donald Mason had a pick larger than 114?
### Accurate SQL ###
|
SELECT MIN(round) FROM table_name_18 WHERE player = "donald mason" AND pick > 114
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text )
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 ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text )
TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text )
TABLE: CREATE TABLE PostTags ( PostId number, TagId number )
TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text )
TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number )
TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text )
TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number )
TABLE: CREATE TABLE VoteTypes ( Id number, Name text )
TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text )
TABLE: CREATE TABLE 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 CloseReasonTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number )
TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number )
TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text )
TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number )
TABLE: CREATE TABLE 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 FlagTypes ( Id number, Name text, Description text )
TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number )
TABLE: CREATE TABLE 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 Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number )
TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time )
TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId 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 PostTypes ( Id number, Name text )
TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text )
### Question ###
Number of first posts which get closed (per month).
### Accurate SQL ###
|
WITH firstpostids_cte AS (SELECT MIN(Id) AS MinId, OwnerUserId FROM Posts WHERE PostTypeId = 1 GROUP BY OwnerUserId), firstpostsclosed_cte AS (SELECT p.Id, p.CreationDate AS cre, p.ClosedDate AS clo FROM firstpostids_cte AS fp JOIN Posts AS p ON fp.MinId = p.Id) SELECT LAST_DATE_OF_MONTH(cre), COUNT(clo), COUNT(*), ROUND((COUNT(clo)) * 100.0 / (COUNT(*)), 2) AS percentage FROM firstpostsclosed_cte GROUP BY LAST_DATE_OF_MONTH(cre) ORDER BY LAST_DATE_OF_MONTH(cre)
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_37905 ( "Celebrity" text, "Famous for" text, "Entered" text, "Exited" text, "Finished" text )
### Question ###
Who entered on day 1 and exited on day 20?
### Accurate SQL ###
|
SELECT "Celebrity" FROM table_37905 WHERE "Entered" = 'day 1' AND "Exited" = 'day 20'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) )
TABLE: CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) )
TABLE: CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) )
TABLE: CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) )
TABLE: CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) )
TABLE: CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) )
TABLE: CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) )
### Question ###
What are the ids and details of all accounts. Show scatter chart.
### Accurate SQL ###
|
SELECT Account_ID, Account_Details FROM Accounts
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_49272 ( "Name" text, "Type" text, "Themed area" text, "Manufacturer" text, "Opened" text )
### Question ###
What is the name of the dreamworks experience from Ferrari?
### Accurate SQL ###
|
SELECT "Name" FROM table_49272 WHERE "Themed area" = 'dreamworks experience' AND "Manufacturer" = 'ferrari'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Web_client_accelerator ( id int, name text, Operating_system text, Client text, Connection text )
TABLE: CREATE TABLE accelerator_compatible_browser ( accelerator_id int, browser_id int, compatible_since_year int )
TABLE: CREATE TABLE browser ( id int, name text, market_share real )
### Question ###
Draw a pie chart for what are the ids and names of the web accelerators that are compatible with two or more browsers?
### Accurate SQL ###
|
SELECT name, id FROM Web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.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_23015396_1 (year VARCHAR, driver VARCHAR)
### Question ###
Name the number of year for mark martin
### Accurate SQL ###
|
SELECT COUNT(year) FROM table_23015396_1 WHERE driver = "Mark Martin"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_4653 ( "Race Name" text, "Circuit" text, "City/Location" text, "Date" text, "Pole position" text, "Winning driver" text, "Winning team" text, "Report" text )
### Question ###
For the race Champion Spark Plug 300, what is the report?
### Accurate SQL ###
|
SELECT "Report" FROM table_4653 WHERE "Race Name" = 'champion spark plug 300'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_57 (debut_in_europe INTEGER, player VARCHAR, games VARCHAR)
### Question ###
When was the latest debut in Europe for Henrik Larsson, with less than 108 games?
### Accurate SQL ###
|
SELECT MAX(debut_in_europe) FROM table_name_57 WHERE player = "henrik larsson" AND games < 108
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 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) )
### Question ###
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time, and order by the y-axis in desc.
### Accurate SQL ###
|
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(DEPARTMENT_ID) DESC
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int )
TABLE: CREATE TABLE domain_journal ( did int, jid int )
TABLE: CREATE TABLE journal ( homepage varchar, jid int, name varchar )
TABLE: CREATE TABLE domain_conference ( cid int, did int )
TABLE: CREATE TABLE domain_publication ( did int, pid int )
TABLE: CREATE TABLE author ( aid int, homepage varchar, name varchar, oid int )
TABLE: CREATE TABLE domain_author ( aid int, did int )
TABLE: CREATE TABLE organization ( continent varchar, homepage varchar, name varchar, oid int )
TABLE: CREATE TABLE domain_keyword ( did int, kid int )
TABLE: CREATE TABLE domain ( did int, name varchar )
TABLE: CREATE TABLE publication_keyword ( kid int, pid int )
TABLE: CREATE TABLE cite ( cited int, citing int )
TABLE: CREATE TABLE keyword ( keyword varchar, kid int )
TABLE: CREATE TABLE conference ( cid int, homepage varchar, name varchar )
TABLE: CREATE TABLE writes ( aid int, pid int )
### Question ###
return me the number of papers in PVLDB after 2000 in ' University of Michigan ' .
### Accurate SQL ###
|
SELECT COUNT(DISTINCT (publication.title)) FROM author, journal, organization, publication, writes WHERE journal.name = 'PVLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.jid = journal.jid AND publication.year > 2000 AND writes.aid = author.aid AND writes.pid = publication.pid
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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_348 ( id number, "number" number, "name" text, "team" text, "position" text, "years with franchise" text, "note" text )
### Question ###
what team appears on this table the most ?
### Accurate SQL ###
|
SELECT "team" FROM table_203_348 GROUP BY "team" 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_39407 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
### Question ###
What is cornell's lowest pick number?
### Accurate SQL ###
|
SELECT MIN("Pick #") FROM table_39407 WHERE "College" = 'cornell'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_1499791_2 ( santee_sisseton VARCHAR, english_gloss VARCHAR )
### Question ###
Name the santee sisseton for morning
### Accurate SQL ###
|
SELECT santee_sisseton FROM table_1499791_2 WHERE english_gloss = "morning"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE activity ( actid number, activity_name text )
TABLE: CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text )
TABLE: CREATE TABLE participates_in ( stuid number, actid number )
TABLE: CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text )
TABLE: CREATE TABLE faculty_participates_in ( facid number, actid number )
### Question ###
Show the ids for all the faculty members who have at least 2 students.
### Accurate SQL ###
|
SELECT T1.facid FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor GROUP BY T1.facid HAVING COUNT(*) >= 2
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE Student ( StuID VARCHAR, sex VARCHAR, sportname VARCHAR )
TABLE: CREATE TABLE Sportsinfo ( StuID VARCHAR, sex VARCHAR, sportname VARCHAR )
### Question ###
Show all male student ids who don't play football.
### Accurate SQL ###
|
SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = "Football"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_dev_54 ( "id" int, "ogtt" int, "anemia" bool, "gender" string, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "hematocrit_hct" float, "body_mass_index_bmi" float, "igt" bool, "fasting_glucose" int, "age" float, "NOUSE" float )
### Question ###
hemoglobin < 12 g / dl for male , < 11 g / dl for female
### Accurate SQL ###
|
SELECT * FROM table_dev_54 WHERE (hemoglobin_a1c_hba1c < 12 AND gender = 'male') OR (hemoglobin_a1c_hba1c < 11 AND gender = 'female')
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text )
TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text )
TABLE: CREATE TABLE 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 )
### Question ###
count the number of patients whose age is less than 49 and procedure icd9 code is 92?
### Accurate SQL ###
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "49" AND procedures.icd9_code = "92"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_35842 ( "Name" text, "Date" text, "Goals" real, "Assists" real, "Team" text, "Venue" text, "Opponent" text, "Competition" text, "Total Goals" real, "Total Assists" real )
### Question ###
Who was the opponent at the competition held at Jeonju?
### Accurate SQL ###
|
SELECT "Opponent" FROM table_35842 WHERE "Venue" = 'jeonju'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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 ( average_attendance INTEGER, _number_of_home_games VARCHAR )
### Question ###
What was the Average Attendance during the Year in which there were 9 Home Games?
### Accurate SQL ###
|
SELECT MAX(average_attendance) FROM table_name_12 WHERE _number_of_home_games = 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_name_63 (d_41 VARCHAR, d_43 VARCHAR)
### Question ###
Tell me the D 41 for D 43 of d 18
### Accurate SQL ###
|
SELECT d_41 FROM table_name_63 WHERE d_43 = "d 18"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text )
TABLE: CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
### Question ###
Show the total number from each flag, and order from high to low by the X.
### Accurate SQL ###
|
SELECT Flag, COUNT(*) FROM Ship GROUP BY Flag ORDER BY Flag 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_29 ( home_city VARCHAR, stadium VARCHAR )
### Question ###
what is the home city for the stadion src mladost?
### Accurate SQL ###
|
SELECT home_city FROM table_name_29 WHERE stadium = "stadion src mladost"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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 (date VARCHAR, home_team VARCHAR)
### Question ###
When did Reading play at home?
### Accurate SQL ###
|
SELECT date FROM table_name_2 WHERE home_team = "reading"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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 ( grid INTEGER, laps INTEGER )
### Question ###
What is the grid sum with more than 50 laps?
### Accurate SQL ###
|
SELECT SUM(grid) FROM table_name_16 WHERE laps > 50
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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_17 ( year INTEGER, venue VARCHAR )
### Question ###
What year is the venue in budapest, hungary?
### Accurate SQL ###
|
SELECT SUM(year) FROM table_name_17 WHERE venue = "budapest, hungary"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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 ( byes VARCHAR, benalla_dfl VARCHAR, losses VARCHAR )
### Question ###
When Benalla DFL is swanpool with less than 16 losses, what is the sum of Byes?
### Accurate SQL ###
|
SELECT COUNT(byes) FROM table_name_39 WHERE benalla_dfl = "swanpool" AND losses < 16
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_13 (type VARCHAR, date VARCHAR, satellite VARCHAR)
### Question ###
What is the type of the gps iif-10 satellite with an unknown date?
### Accurate SQL ###
|
SELECT type FROM table_name_13 WHERE date = "unknown" AND satellite = "gps iif-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_42786 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
### Question ###
What is the Tie no when the away team was Burnley?
### Accurate SQL ###
|
SELECT "Tie no" FROM table_42786 WHERE "Away team" = 'burnley'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE organizations ( organization_id number, date_formed time, organization_name text, uk_vat_number text )
TABLE: CREATE TABLE organization_contact_individuals ( individual_id number, organization_id number, date_contact_from time, date_contact_to time )
TABLE: CREATE TABLE addresses ( address_id number, line_1_number_building text, town_city text, zip_postcode text, state_province_county text, country text )
TABLE: CREATE TABLE individuals ( individual_id number, individual_first_name text, individual_middle_name text, inidividual_phone text, individual_email text, individual_address text, individual_last_name text )
TABLE: CREATE TABLE party_addresses ( party_id number, address_id number, date_address_from time, address_type_code text, date_address_to time )
TABLE: CREATE TABLE party_forms ( party_id number, form_id number, date_completion_started time, form_status_code text, date_fully_completed time )
TABLE: CREATE TABLE party_services ( booking_id number, customer_id number, service_id number, service_datetime time, booking_made_date time )
TABLE: CREATE TABLE parties ( party_id number, payment_method_code text, party_phone text, party_email text )
TABLE: CREATE TABLE services ( service_id number, service_type_code text, service_name text, service_descriptio text )
TABLE: CREATE TABLE forms ( form_id number, form_type_code text, service_id number, form_number text, form_name text, form_description text )
### Question ###
Find the payment method and phone of the party with email 'enrico09@example.com'.
### Accurate SQL ###
|
SELECT payment_method_code, party_phone FROM parties WHERE party_email = "enrico09@example.com"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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 ( week_15__final__dec_3 VARCHAR, week_12_nov_13 VARCHAR )
### Question ###
What was Week 15 when Week 12 was Washington (9-1)?
### Accurate SQL ###
|
SELECT week_15__final__dec_3 FROM table_name_69 WHERE week_12_nov_13 = "washington (9-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 manager ( Name VARCHAR, Age VARCHAR )
### Question ###
What is the name of the oldest manager?
### Accurate SQL ###
|
SELECT Name FROM manager 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 table_name_26 ( round INTEGER, college VARCHAR )
### Question ###
Which Round has a College of arizona?
### Accurate SQL ###
|
SELECT MIN(round) FROM table_name_26 WHERE college = "arizona"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_80 (date VARCHAR, score VARCHAR, home VARCHAR, venue VARCHAR)
### Question ###
What date were Romania at Home at the Bucharest Venue with a Score of 13-19?
### Accurate SQL ###
|
SELECT date FROM table_name_80 WHERE home = "romania" AND venue = "bucharest" AND score = "13-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_23210 ( "Further Cities" text, "County, Oblast or State" text, "Country" text, "Distance" text, "Direction" text )
### Question ###
Name the further cities for east romania
### Accurate SQL ###
|
SELECT "Further Cities" FROM table_23210 WHERE "Direction" = 'East' AND "Country" = 'Romania'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_10254 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real )
### Question ###
What is the greatest capacity when the largest number in attendance is 6,192?
### Accurate SQL ###
|
SELECT MAX("Capacity") FROM table_10254 WHERE "Highest" > '6,192'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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_77 ( circuit VARCHAR, date VARCHAR )
### Question ###
Which circuit is on July 24?
### Accurate SQL ###
|
SELECT circuit FROM table_name_77 WHERE date = "july 24"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_1342359_17 ( candidates VARCHAR, first_elected VARCHAR )
### Question ###
How many people were elected in 1929
### Accurate SQL ###
|
SELECT COUNT(candidates) FROM table_1342359_17 WHERE first_elected = 1929
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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_64 (overall INTEGER, nationality VARCHAR)
### Question ###
For the player from Finland, what is the highest overall pick rank?
### Accurate SQL ###
|
SELECT MAX(overall) FROM table_name_64 WHERE nationality = "finland"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use 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_11 (name VARCHAR, presentation_of_credentials VARCHAR)
### Question ###
Who presented their credentials at an unknown date?
### Accurate SQL ###
|
SELECT name FROM table_name_11 WHERE presentation_of_credentials = "unknown"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_71041 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
### Question ###
Which record has a Date of april 25?
### Accurate SQL ###
|
SELECT "Record" FROM table_71041 WHERE "Date" = 'april 25'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_44220 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
### Question ###
WHAT IS THE ROUND FROM MICHIGAN COLLEGE, AND OVERALL LARGER THAN 37?
### Accurate SQL ###
|
SELECT SUM("Round") FROM table_44220 WHERE "College" = 'michigan' AND "Overall" > '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_4254 ( "Name" text, "Family name" text, "Receptor" text, "Coreceptor" text, "Property" text, "Chromosomal location" text )
### Question ###
What are the coreceptors of the chromosomes in that location 11q22.2-q22.3?
### Accurate SQL ###
|
SELECT "Coreceptor" FROM table_4254 WHERE "Chromosomal location" = '11q22.2-q22.3'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_32361 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
### Question ###
Which Away team has a Home team of Collingwood?
### Accurate SQL ###
|
SELECT "Away team" FROM table_32361 WHERE "Home team" = 'collingwood'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_64323 ( "Name" text, "Career" text, "Matches" real, "Overs" real, "Maidens" real, "Runs" real, "Wickets" real, "Average" real, "Best" text )
### Question ###
What are the fewest wickets when player's career spanned 1946-1960 and maidens were more than 419?
### Accurate SQL ###
|
SELECT MIN("Wickets") FROM table_64323 WHERE "Career" = '1946-1960' AND "Maidens" > '419'
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.
### Tables ###
TABLE: CREATE TABLE table_name_58 ( champion VARCHAR, city VARCHAR )
### Question ###
Which player from Tucson, Arizona won the Championship?
### Accurate SQL ###
|
SELECT champion FROM table_name_58 WHERE city = "tucson, arizona"
|
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only 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_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number )
TABLE: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number )
TABLE: CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number )
TABLE: CREATE TABLE 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 patients ( row_id number, subject_id number, gender text, dob time, dod time )
TABLE: CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text )
TABLE: CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time )
TABLE: CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text )
TABLE: CREATE TABLE d_labitems ( row_id number, itemid number, label text )
TABLE: CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text )
TABLE: CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name 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 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 )
### Question ###
has patient 12775 had any kind of diagnosis in this year?
### Accurate SQL ###
|
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.