table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | calculate the maximum age of patients with abdominal pain primary disease who were admitted to hospital for 43 days. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.days_stay = "43" |
CREATE TABLE table_name_91 (
chinese_title VARCHAR,
premiere VARCHAR
) | What is the Chinese title with a premiere rating of 31? | SELECT chinese_title FROM table_name_91 WHERE premiere = 31 |
CREATE TABLE table_71991 (
"Rank" real,
"Mountain Peak" text,
"Province" text,
"Mountain Range" text,
"Location" text
) | Which mountain range includes Mount Hubbard? | SELECT "Mountain Range" FROM table_71991 WHERE "Mountain Peak" = 'mount hubbard' |
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
)
CREATE TABLE aircraft (
... | what flights are available friday from PHILADELPHIA to OAKLAND | 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 = 'OAKLAND' AND date_day.day_number = 25 AND date_day.month_number = 6 AND d... |
CREATE TABLE table_name_23 (
opponent_in_the_final VARCHAR,
date VARCHAR
) | Final that has a Date of january 10, 2004 had what opponent? | SELECT opponent_in_the_final FROM table_name_23 WHERE date = "january 10, 2004" |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | What are the numbers of wines for different grapes Plot them as bar chart, sort by the bar in desc. | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape DESC |
CREATE TABLE table_11235 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | Who was the visiting team at Lincoln Financial Field when the final score was 24-14? | SELECT "Visiting Team" FROM table_11235 WHERE "Stadium" = 'lincoln financial field' AND "Final Score" = '24-14' |
CREATE TABLE services (
service_id number,
service_type_code text,
workshop_group_id number,
product_description text,
product_name text,
product_price number,
other_product_service_details text
)
CREATE TABLE performers (
performer_id number,
address_id number,
customer_name te... | How many customers do we have? | SELECT COUNT(*) FROM customers |
CREATE TABLE table_37329 (
"Unit" text,
"Russian" text,
"Translation" text,
"Ratio" real,
"Metric value" text,
"Avoirdupois value" text,
"Ordinary value" text
) | What unit has an Avoirdupois value of 57.602 gr.? | SELECT "Unit" FROM table_37329 WHERE "Avoirdupois value" = '57.602 gr.' |
CREATE TABLE table_11636213_7 (
date VARCHAR,
result VARCHAR
) | What date was the result 6 2, 4 6, 6 4? | SELECT date FROM table_11636213_7 WHERE result = "6–2, 4–6, 6–4" |
CREATE TABLE table_19215 (
"Team" text,
"First Played" real,
"Played" real,
"Win" real,
"Draw" real,
"Loss" real,
"Points For" real,
"Ponts Against" real,
"Last Meeting" real
) | How many teams scored exactly 38 points | SELECT COUNT("Team") FROM table_19215 WHERE "Points For" = '38' |
CREATE TABLE table_204_742 (
id number,
"release date" text,
"single title" text,
"uk singles chart\nposition" number,
"french\ncharts" number,
"german\ncharts" number,
"irish\ncharts" number,
"various" text
) | was hot love released before run to me ? | SELECT (SELECT "release date" FROM table_204_742 WHERE "single title" = '"hot love"') < (SELECT "release date" FROM table_204_742 WHERE "single title" = '"run to me"') |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | the previous year, what were the five most common input events? | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY intakeoutput.celllabel) AS ... |
CREATE TABLE table_40634 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | When the regular season of 2nd, Northeast and the year was less than 2008 what was the total number of Division? | SELECT COUNT("Division") FROM table_40634 WHERE "Regular Season" = '2nd, northeast' AND "Year" < '2008' |
CREATE TABLE table_78226 (
"Tie no" real,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
) | Who was the away team in a tie no larger than 16 with forest green rovers at home? | SELECT "Away team" FROM table_78226 WHERE "Tie no" > '16' AND "Home team" = 'forest green rovers' |
CREATE TABLE table_30622 (
"Position" text,
"Player" text,
"Period" text,
"Teams" text,
"Consecutive starts" real,
"Playoffs" real,
"Total" real
) | What is the largest number of consecutive starts for jason gildon? | SELECT MAX("Consecutive starts") FROM table_30622 WHERE "Player" = 'Jason Gildon' |
CREATE TABLE table_77731 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What's the record when the attendance was 41,573? | SELECT "Record" FROM table_77731 WHERE "Attendance" = '41,573' |
CREATE TABLE table_train_27 (
"id" int,
"bone_marrow_transplant" bool,
"antimicrobial_therapy" bool,
"immune_suppression" bool,
"hiv_infection" bool,
"autoimmune_disease" bool,
"hepatitis_b_infection" bool,
"renal_disease" bool,
"total_parenteral_nutrition" bool,
"surgery" bool,
... | sepsis induced immunosuppression | SELECT * FROM table_train_27 WHERE immune_suppression = 1 |
CREATE TABLE table_79409 (
"play" text,
"author" text,
"company" text,
"base" text,
"country" text
) | what is the play when the company is cyprus theatre organisation? | SELECT "play" FROM table_79409 WHERE "company" = 'cyprus theatre organisation' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | Give me the number of unmarried patients who were ordered a transferrin lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Transferrin" |
CREATE TABLE table_name_25 (
opponent VARCHAR,
result VARCHAR
) | Can you tell me the Opponent that has the Result of w 37-14? | SELECT opponent FROM table_name_25 WHERE result = "w 37-14" |
CREATE TABLE table_77998 (
"Round" text,
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text
) | What is the Date with a Opponent with wimbledon, and a Result of won 2-0? | SELECT "Date" FROM table_77998 WHERE "Opponent" = 'wimbledon' AND "Result" = 'won 2-0' |
CREATE TABLE table_1557974_1 (
career_and_other_notes VARCHAR,
birthplace VARCHAR
) | How many wrestlers were born in nara, and have a completed 'career and other notes' section? | SELECT COUNT(career_and_other_notes) FROM table_1557974_1 WHERE birthplace = "Nara" |
CREATE TABLE table_60473 (
"English name" text,
"Thai name" text,
"Abbr." text,
"Transcription" text,
"Sanskrit word" text,
"Zodiac sign" text
) | What is the zodiac sign for the English March? | SELECT "Zodiac sign" FROM table_60473 WHERE "English name" = 'march' |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)... | show me all the flights between OAKLAND and DENVER | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER... |
CREATE TABLE table_204_373 (
id number,
"wager" text,
"winner" text,
"loser" text,
"location" text,
"date" text
) | only opponent to defeat mocho cota in 1994 | SELECT "winner" FROM table_204_373 WHERE "loser" = 'mocho cota' AND "date" = 1994 |
CREATE TABLE table_53070 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When was the game where the home team score was 8.9 (57)? | SELECT "Date" FROM table_53070 WHERE "Home team score" = '8.9 (57)' |
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
)
CRE... | Top 150 users from China. Top 150 SO users from China | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%sweden%' OR UPPER(Location) LIKE '%SWEDEN%' OR Location LIKE '%SWEDEN%' AND Reputation >= 0 ORDER BY Reputation DESC LIMIT 150 |
CREATE TABLE table_25067 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | When was the successor who got his seat because of 'until august 2, 1813' seated? | SELECT "Date successor seated" FROM table_25067 WHERE "Reason for change" = 'Until August 2, 1813' |
CREATE TABLE table_28628309_6 (
team VARCHAR,
category VARCHAR
) | Who was the team when the category is field goal percentage? | SELECT team FROM table_28628309_6 WHERE category = "Field goal percentage" |
CREATE TABLE table_21068 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | how many points scored by sportivo luque o | SELECT COUNT("Points") FROM table_21068 WHERE "Team" = 'Sportivo Luqueño' |
CREATE TABLE table_68487 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the competition type of the event with a result of 3-2 and a score of 2-1? | SELECT "Competition" FROM table_68487 WHERE "Result" = '3-2' AND "Score" = '2-1' |
CREATE TABLE table_18328569_1 (
new_entries_this_round VARCHAR,
winners_from_previous_round VARCHAR
) | How many new entries started in the round where winners from the previous round is 32? | SELECT new_entries_this_round FROM table_18328569_1 WHERE winners_from_previous_round = "32" |
CREATE TABLE table_18173916_8 (
friday VARCHAR,
monday VARCHAR
) | which episode was Transmitted on friday if the episode of '515 the adventures of tintin' was transmitted on monday? | SELECT friday FROM table_18173916_8 WHERE monday = "515 The Adventures of Tintin" |
CREATE TABLE table_name_77 (
league_cup INTEGER,
total VARCHAR,
fa_cup VARCHAR,
premier_league VARCHAR
) | What is the highest league cup with more than 0 FA cups, a premier league less than 34 and a total of 11? | SELECT MAX(league_cup) FROM table_name_77 WHERE fa_cup > 0 AND premier_league < 34 AND total = 11 |
CREATE TABLE table_16187 (
"Institution" text,
"Location" text,
"Mens Nickname" text,
"Womens Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" text
) | What is the year the institution Tougaloo College joined? | SELECT "Joined" FROM table_16187 WHERE "Institution" = 'Tougaloo College' |
CREATE TABLE table_11142 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | Who had Pole position for the French Grand Prix? | SELECT "Pole position" FROM table_11142 WHERE "Race" = 'french grand prix' |
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_... | show me the airlines that fly from DENVER to SAN FRANCISCO | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na... |
CREATE TABLE table_21460 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the record for verizon center 20,173 | SELECT "Record" FROM table_21460 WHERE "Location Attendance" = 'Verizon Center 20,173' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is the number of patients whose drug code is eryt250 and lab test fluid is cerebrospinal fliuid (csf)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "ERYT250" AND lab.fluid = "Cerebrospinal Fluid (CSF)" |
CREATE TABLE table_25360865_1 (
height VARCHAR,
_number VARCHAR
) | Name the total number of height for number 32 | SELECT COUNT(height) FROM table_25360865_1 WHERE _number = 32 |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | Compare the total number of each fate with a bar chart, show from high to low by the x axis. | SELECT Fate, COUNT(Fate) FROM mission GROUP BY Fate ORDER BY Fate DESC |
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
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | what were the new prescriptions of patient 97395 today compared to the prescription they received yesterday? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97395) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE... |
CREATE TABLE table_name_6 (
best VARCHAR,
qual_1 VARCHAR
) | What is the best time for a team with a first-qualifying time of 59.448? | SELECT best FROM table_name_6 WHERE qual_1 = "59.448" |
CREATE TABLE table_19417244_2 (
written_by VARCHAR,
us_viewers__millions_ VARCHAR
) | who write the episode that have 14.39 million viewers | SELECT written_by FROM table_19417244_2 WHERE us_viewers__millions_ = "14.39" |
CREATE TABLE table_name_40 (
long INTEGER,
name VARCHAR,
gain VARCHAR
) | When Thomas Clayton had a gain less than 71, what was the highest long value? | SELECT MAX(long) FROM table_name_40 WHERE name = "thomas clayton" AND gain < 71 |
CREATE TABLE table_26313243_1 (
gdp__ppp__per_capita___intl_$___2011 VARCHAR,
country VARCHAR
) | Name the gdp per capita for haiti | SELECT gdp__ppp__per_capita___intl_$___2011 FROM table_26313243_1 WHERE country = "Haiti" |
CREATE TABLE table_21283 (
"Official Name" text,
"Status" text,
"Area km 2" text,
"Population" real,
"Census Ranking" text
) | What is the total number of population in the land with an area of 149.32 km2? | SELECT COUNT("Population") FROM table_21283 WHERE "Area km 2" = '149.32' |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | Proportion of users who've asked no questions. Counts the number of users with Rep>=1000 who've asked no questions, and the total number of users with Rep>=1000. | SELECT (SELECT COUNT(u.DisplayName) FROM Users AS u WHERE u.Reputation >= 1000) AS "significant_users", (SELECT COUNT(u.DisplayName) FROM Users AS u WHERE u.Id NOT IN (SELECT DISTINCT OwnerUserId FROM Posts WHERE PostTypeId = 1 AND OwnerUserId != '') AND u.Reputation >= 94000) AS "with_no_questions" |
CREATE TABLE table_name_40 (
player VARCHAR,
money___$__ VARCHAR,
score VARCHAR
) | What is Player, when Money ( $ ) is less than 387, and when Score is '73-76-74-72=295'? | SELECT player FROM table_name_40 WHERE money___$__ < 387 AND score = 73 - 76 - 74 - 72 = 295 |
CREATE TABLE table_29854 (
"English" text,
"Predecessor" text,
"Ekavian" text,
"Ikavian" text,
"Ijekavian" text,
"Ijekavian development" text
) | What's the ijekavian translation of the ikavian word grijati? | SELECT "Ijekavian" FROM table_29854 WHERE "Ikavian" = 'grijati' |
CREATE TABLE table_name_22 (
re_entered_service__p_ VARCHAR,
entered_service__t_ VARCHAR,
pre_conversion VARCHAR
) | What date did the T328 that entered service on 18 June 1956 re-enter service? | SELECT re_entered_service__p_ FROM table_name_22 WHERE entered_service__t_ = "18 june 1956" AND pre_conversion = "t328" |
CREATE TABLE table_15887683_6 (
country VARCHAR,
television_service VARCHAR
) | Name the country for sky primafila 7 hd | SELECT country FROM table_15887683_6 WHERE television_service = "Sky Primafila 7 HD" |
CREATE TABLE table_15380 (
"Category" text,
"Film" text,
"Director(s)" text,
"Country" text,
"Nominating Festival" text
) | Which nominating festival nominated Iao Lethem's film? | SELECT "Nominating Festival" FROM table_15380 WHERE "Director(s)" = 'iao lethem' |
CREATE TABLE table_11772 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
) | What is the largest number of Games Played with Losses of 3, and more Wins than 5? | SELECT MAX("Games Played") FROM table_11772 WHERE "Losses" = '3' AND "Wins" > '5' |
CREATE TABLE table_63746 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Football Class" text,
"Primary Conference" text,
"County" text
) | What county has an IHSAA Football Class of A, and a Mascot of royals? | SELECT "County" FROM table_63746 WHERE "IHSAA Football Class" = 'a' AND "Mascot" = 'royals' |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
... | what is during the first hospital encounter maximum neutrophils value of patient 99647? | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99647 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = '... |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense... | Overlap between a given tag and related ones. | SELECT *, CAST(100.0 * without_tag / (without_tag + with_tag) AS FLOAT(18, 2)) AS perc_not_tag FROM (SELECT COUNT(p.Id) AS post_count, t.TagName, SUM(CASE WHEN p.Tags LIKE '%<##Tag##>%' THEN 1 ELSE 0 END) AS with_tag, SUM(CASE WHEN NOT p.Tags LIKE '%<##Tag##>%' THEN 1 ELSE 0 END) AS without_tag FROM Posts AS p JOIN Pos... |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | Give me a bar chart to show the revenue of the company that earns the highest revenue in each headquarter city. | SELECT Headquarter, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter |
CREATE TABLE table_name_10 (
grid INTEGER,
time VARCHAR,
laps VARCHAR,
manufacturer VARCHAR
) | What is the lowest Grid, when Laps is 21, when Manufacturer is Yamaha, and when Time is +18.802? | SELECT MIN(grid) FROM table_name_10 WHERE laps = 21 AND manufacturer = "yamaha" AND time = "+18.802" |
CREATE TABLE table_62894 (
"Driver" text,
"Entrant" text,
"Constructor" text,
"Time/Retired" text,
"Grid" real
) | What's the lowest grid with and entrant of fred saunders? | SELECT MIN("Grid") FROM table_62894 WHERE "Entrant" = 'fred saunders' |
CREATE TABLE table_9427 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text
) | What name was proposed on 12/30/1982 in rockingham county with a CERCLIS ID of nhd062004569? | SELECT "Name" FROM table_9427 WHERE "Proposed" = '12/30/1982' AND "County" = 'rockingham' AND "CERCLIS ID" = 'nhd062004569' |
CREATE TABLE table_12834315_4 (
stock VARCHAR,
colt_model_no VARCHAR
) | Name the stock for colt model mt6601 | SELECT stock FROM table_12834315_4 WHERE colt_model_no = "MT6601" |
CREATE TABLE table_36871 (
"Club" text,
"Sport" text,
"League" text,
"Venue" text,
"Established" real,
"Championships" real
) | What year was the West Coast League established than the championships are greater than 0? | SELECT "Established" FROM table_36871 WHERE "Championships" > '0' AND "League" = 'west coast league' |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
... | Show the name of each party and the corresponding number of delegates from that party Plot them as bar chart, sort by the x axis from low to high please. | SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party |
CREATE TABLE table_57777 (
"Rocket launch" text,
"Launch Date" text,
"Mission" text,
"Institutional authority" text,
"Launch Site" text,
"Outcomes" text,
"Derivatives" text
) | Which Institutional authority has a Rocket launch of rehnuma-10? | SELECT "Institutional authority" FROM table_57777 WHERE "Rocket launch" = 'rehnuma-10' |
CREATE TABLE table_name_49 (
high_points VARCHAR,
team VARCHAR
) | What are Utah's high points? | SELECT high_points FROM table_name_49 WHERE team = "utah" |
CREATE TABLE table_21281 (
"Country" text,
"Preliminary" text,
"Interview" text,
"Swimsuit" text,
"Evening Gown" text,
"Average" text
) | Give swimsuit scores of participants 8.847 in preliminary | SELECT "Swimsuit" FROM table_21281 WHERE "Preliminary" = '8.847' |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
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_req... | i want a flight on CO from BOSTON to SAN FRANCISCO | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... |
CREATE TABLE table_8574 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | The Catalog of ilps 9153 is from what region? | SELECT "Region" FROM table_8574 WHERE "Catalog" = 'ilps 9153' |
CREATE TABLE table_name_48 (
february VARCHAR,
opponent VARCHAR,
game VARCHAR
) | What is the February number of the game with the Vancouver Canucks as the opponent and a game number greater than 55? | SELECT COUNT(february) FROM table_name_48 WHERE opponent = "vancouver canucks" AND game > 55 |
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
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
d... | what was the name of the drug, which patient 52898 was last prescribed via right ear route since 02/2105? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898) AND prescriptions.route = 'right ear' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-02' ORDER BY prescriptions.startdate DESC LIMIT 1 |
CREATE TABLE table_10504 (
"Grid" real,
"Constructor" text,
"Qual" real,
"Rank" real,
"Laps" real,
"Time/retired" text
) | What is the average rank of one who is at 76 laps? | SELECT AVG("Rank") FROM table_10504 WHERE "Laps" = '76' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose diagnoses short title is atrial fibrillation and drug route is tp? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Atrial fibrillation" AND prescriptions.route = "TP" |
CREATE TABLE table_name_10 (
country VARCHAR,
music VARCHAR
) | What country is the film that has music of nino oliviero? | SELECT country FROM table_name_10 WHERE music = "nino oliviero" |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varc... | When can I take 421 ? | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 421 AND course_offering.semester = semester.semester_id AND semester.semester_id > (SELECT SEMESTERalias1.semester_id FROM semeste... |
CREATE TABLE School (
School_id text,
School_name text,
Location text,
Mascot text,
Enrollment int,
IHSAA_Class text,
IHSAA_Football_Class text,
County text
)
CREATE TABLE endowment (
endowment_id int,
School_id int,
donator_name text,
amount real
)
CREATE TABLE budget ... | Show the relationship between the number of schools in each county and total enrollment in each county by a scatter plot. | SELECT COUNT(*), SUM(Enrollment) FROM School GROUP BY County |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, I want to show by the X in desc. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC |
CREATE TABLE table_14312471_7 (
home_team VARCHAR,
away_team VARCHAR
) | Who played Richmond at home? | SELECT home_team FROM table_14312471_7 WHERE away_team = "Richmond" |
CREATE TABLE table_53217 (
"Year" real,
"Tracks" text,
"Title" text,
"Format, Special Notes" text,
"Label" text
) | What label is after 2004? | SELECT "Label" FROM table_53217 WHERE "Year" > '2004' |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airline (
airline_code... | how many seats in a 734 | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = '734' |
CREATE TABLE table_63371 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
) | what is the name when the constituency number is 150? | SELECT "Name" FROM table_63371 WHERE "Constituency number" = '150' |
CREATE TABLE table_name_48 (
place VARCHAR,
score VARCHAR
) | WHAT PLACE WAS A SCORE 67-70=137? | SELECT place FROM table_name_48 WHERE score = 67 - 70 = 137 |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | mention the discharge time and diagnosis icd9 code of subject id 42820. | SELECT demographic.dischtime, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "42820" |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of job_id and department_id , and could you rank names from high to low order? | SELECT JOB_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID DESC |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | provide the number of patients whose primary disease is ruq pain and year of birth is less than 2112? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.dob_year < "2112" |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | How many patients are with discharge location short term hospital and below age 67? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.age < "67" |
CREATE TABLE table_59057 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" text,
"Location of the Church" text
) | When was the church in Arnafjord built? | SELECT "Year Built" FROM table_59057 WHERE "Location of the Church" = 'arnafjord' |
CREATE TABLE table_59320 (
"Date" text,
"Time" text,
"Opponent#" text,
"Rank #" text,
"Result" text,
"Attendance" text
) | What was the result of the game that had 56,500 in attendance? | SELECT "Result" FROM table_59320 WHERE "Attendance" = '56,500' |
CREATE TABLE table_name_91 (
round INTEGER,
school_club_team VARCHAR
) | How many rounds have School/club team of pan american? | SELECT SUM(round) FROM table_name_91 WHERE school_club_team = "pan american" |
CREATE TABLE table_77393 (
"Game" real,
"Date" text,
"Score" text,
"Location" text,
"Time" text,
"Attendance" real
) | What is the number of people in attendance when the time is 3:00? | SELECT "Attendance" FROM table_77393 WHERE "Time" = '3:00' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | what is the number of patients whose admission type is elective and diagnoses long title is drug induced neutropenia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Drug induced neutropenia" |
CREATE TABLE table_47467 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | Which Place has a Country of united states, and Money ($) larger than 145,000, and a To par of 2, and a Score of 70-66-73-69=278? | SELECT "Place" FROM table_47467 WHERE "Country" = 'united states' AND "Money ( $ )" > '145,000' AND "To par" = '–2' AND "Score" = '70-66-73-69=278' |
CREATE TABLE performance (
Performance_ID real,
Date text,
Host text,
Location text,
Attendance int
)
CREATE TABLE member (
Member_ID text,
Name text,
Nationality text,
Role text
)
CREATE TABLE member_attendance (
Member_ID int,
Performance_ID int,
Num_of_Pieces int
) | Show different locations and the number of performances at each location Visualize by bar chart, and sort x axis in desc order. | SELECT Location, COUNT(*) FROM performance GROUP BY Location ORDER BY Location DESC |
CREATE TABLE table_80411 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What team played against Al-Ismaily (team 1)? | SELECT "Team 2" FROM table_80411 WHERE "Team 1" = 'al-ismaily' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | Among patients with alzheimer's disease, how many of them had a lab test for abnormal status of delta? | 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 = "Alzheimer's disease" AND lab.flag = "delta" |
CREATE TABLE table_name_41 (
chassis VARCHAR,
entrant VARCHAR,
driver VARCHAR
) | Which chassis did Aguri Suzuki drive with an entrant of Larrousse F1? | SELECT chassis FROM table_name_41 WHERE entrant = "larrousse f1" AND driver = "aguri suzuki" |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
... | Visualize a bar chart for how many students are in each department?, and could you sort y axis in descending order? | SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC |
CREATE TABLE table_name_39 (
venue VARCHAR,
extra VARCHAR
) | What is Venue, when Extra is Pentathlon? | SELECT venue FROM table_name_39 WHERE extra = "pentathlon" |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
... | what was the name of the lab test that patient 20801 last got in 04/last year. | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20801) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.