table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
... | what did patient 3267 pay for their hospital stay until 2104? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3267) AND STRFTIME('%y', cost.chargetime) <= '2104' |
CREATE TABLE table_20107762_1 (
assists VARCHAR,
mins VARCHAR
) | What is the amount of assists when mins is 744:27? | SELECT assists FROM table_20107762_1 WHERE mins = "744:27" |
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 (
... | count the number of patients with procedure icd9 code 8949 who are less than 80 years of age. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "80" AND procedures.icd9_code = "8949" |
CREATE TABLE table_name_43 (
points INTEGER,
team VARCHAR,
chassis VARCHAR
) | What are the highest points for the team of marlboro brm with brm p180 as the chassis? | SELECT MAX(points) FROM table_name_43 WHERE team = "marlboro brm" AND chassis = "brm p180" |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
) | Return the average age of captains in each class, and rank Y-axis from low to high order please. | SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY AVG(age) |
CREATE TABLE table_name_48 (
gold VARCHAR,
silver VARCHAR
) | Who won the gold when Bertil Ahlin Sweden won the silver? | SELECT gold FROM table_name_48 WHERE silver = "bertil ahlin sweden" |
CREATE TABLE table_23124 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Name the college/junior club team for john campbell | SELECT "College/junior/club team" FROM table_23124 WHERE "Player" = 'John Campbell' |
CREATE TABLE table_name_50 (
director VARCHAR,
title VARCHAR
) | Who directed Tequila? | SELECT director FROM table_name_50 WHERE title = "tequila" |
CREATE TABLE table_40000 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
) | What is the lowest Overall for the wide receiver in a round less than 2? | SELECT MIN("Overall") FROM table_40000 WHERE "Position" = 'wide receiver' AND "Round" < '2' |
CREATE TABLE table_train_98 (
"id" int,
"mini_mental_state_examination_mmse" int,
"stroke" bool,
"lyperlipidemia_ldl" int,
"allergy_to_milk" bool,
"allergy_to_soy" bool,
"body_mass_index_bmi" float,
"NOUSE" float
) | mmse range: 10 to 28 | SELECT * FROM table_train_98 WHERE mini_mental_state_examination_mmse >= 10 AND mini_mental_state_examination_mmse <= 28 |
CREATE TABLE table_30120761_1 (
area__acres__ VARCHAR,
poor_law_union VARCHAR,
civil_parish VARCHAR
) | What are all the acreages of the townlands in the Macroom poor law union and Macroom civil parish? | SELECT area__acres__ FROM table_30120761_1 WHERE poor_law_union = "Macroom" AND civil_parish = "Macroom" |
CREATE TABLE table_60062 (
"Position" real,
"Club" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Points" real,
"Goal Difference" real
) | What is the number played by the team in place greater than 16? | SELECT AVG("Played") FROM table_60062 WHERE "Position" > '16' |
CREATE TABLE table_name_39 (
laps INTEGER,
time VARCHAR,
grid VARCHAR
) | What is the lowest number of Laps that have a Time of +24.440, and a Grid higher than 18? | SELECT MIN(laps) FROM table_name_39 WHERE time = "+24.440" AND grid > 18 |
CREATE TABLE table_67089 (
"Pick #" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Which team picked the player from the Toronto Marlboros (OHA) as Pick #32? | SELECT "NHL team" FROM table_67089 WHERE "College/junior/club team" = 'toronto marlboros (oha)' AND "Pick #" = '32' |
CREATE TABLE table_204_902 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
) | who is the only person to rank from jamaica ? | SELECT "name" FROM table_204_902 WHERE "nationality" = 'jamaica' |
CREATE TABLE table_name_40 (
city VARCHAR,
iata VARCHAR
) | Which city has the IATA SSG? | SELECT city FROM table_name_40 WHERE iata = "ssg" |
CREATE TABLE table_name_19 (
opponents_in_final VARCHAR,
score_in_final VARCHAR
) | Which Opponents in Final has a Score in Final of 7 5, 1 6 4 6? | SELECT opponents_in_final FROM table_name_19 WHERE score_in_final = "7–5, 1–6 4–6" |
CREATE TABLE table_15621965_14 (
player VARCHAR,
school_club_team VARCHAR
) | Name the player for seattle | SELECT player FROM table_15621965_14 WHERE school_club_team = "Seattle" |
CREATE TABLE table_name_45 (
discipline VARCHAR,
championship VARCHAR
) | In which discipline was non-championship under Championship? | SELECT discipline FROM table_name_45 WHERE championship = "non-championship" |
CREATE TABLE table_204_621 (
id number,
"no." number,
"date" text,
"tournament" text,
"winning score" text,
"margin\nof victory" text,
"runner(s)-up" text
) | which margin of victory was the largest ? | SELECT "margin\nof victory" FROM table_204_621 ORDER BY "margin\nof victory" DESC LIMIT 1 |
CREATE TABLE table_name_49 (
date VARCHAR,
record VARCHAR
) | What was the date of the Mariners game when they had a record of 53 17? | SELECT date FROM table_name_49 WHERE record = "53–17" |
CREATE TABLE table_name_55 (
thai_name VARCHAR,
transcription VARCHAR
) | WHich Thai name has a Transcription of wan phruehatsabodi? | SELECT thai_name FROM table_name_55 WHERE transcription = "wan phruehatsabodi" |
CREATE TABLE table_name_50 (
goals_scored VARCHAR,
pos VARCHAR,
years_active VARCHAR
) | How many goals were scored with a pos larger than 4 and active in 2001-? | SELECT goals_scored FROM table_name_50 WHERE pos > 4 AND years_active = "2001-" |
CREATE TABLE table_name_35 (
percentage___percentage_ VARCHAR,
males VARCHAR
) | What is the percentage where males equal 99? | SELECT percentage___percentage_ FROM table_name_35 WHERE males = "99" |
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 sum of manufacturer , and group by attribute name, and I want to order Y in ascending order. | 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.Manufacturer |
CREATE TABLE table_27213 (
"Player" text,
"Minutes" real,
"Field Goals" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
) | How many points does the player with 2 steals have? | SELECT "Points" FROM table_27213 WHERE "Steals" = '2' |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUser... | Past bounties with no answers between two dates. | SELECT p.Id AS "post_link", p.Score, p.OwnerUserId AS "user_link", p.Tags FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId WHERE v.VoteTypeId = 8 AND p.AnswerCount = 0 AND (v.CreationDate >= '##Date1?2016-01-01##') AND (v.CreationDate <= '##Date2?2016-06-01##') ORDER BY p.CreationDate |
CREATE TABLE table_name_51 (
rank INTEGER,
peak_name VARCHAR
) | What is the total number of ranks when the Peak Name is Red Shirt Table? | SELECT SUM(rank) FROM table_name_51 WHERE peak_name = "red shirt table" |
CREATE TABLE table_name_50 (
gold VARCHAR,
total VARCHAR,
bronze VARCHAR
) | Can you tell me the Gold that has the Total larger than 2, and the Bronze smaller than 1? | SELECT gold FROM table_name_50 WHERE total > 2 AND bronze < 1 |
CREATE TABLE table_17810099_3 (
writer_s_ VARCHAR,
episode__number VARCHAR
) | who wrote episode 14? | SELECT writer_s_ FROM table_17810099_3 WHERE episode__number = "14" |
CREATE TABLE table_204_207 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number,
"bye" text
) | last home opponent of the season | SELECT "opponent" FROM table_204_207 WHERE "opponent" = 'home' ORDER BY "week" DESC LIMIT 1 |
CREATE TABLE county (
Id VARCHAR
) | How many counties are there in total? | SELECT COUNT(*) FROM county |
CREATE TABLE table_name_54 (
spartak INTEGER,
played VARCHAR,
draw VARCHAR
) | what is the sum of spartak when played is 102 and draw is less than 19? | SELECT SUM(spartak) FROM table_name_54 WHERE played = 102 AND draw < 19 |
CREATE TABLE table_204_843 (
id number,
"volume" number,
"year" text,
"names" text,
"articles" number,
"pages" number,
"images" number,
"maps" number,
"number of copies" number
) | in what year were there the least number of images ? | SELECT "year" FROM table_204_843 ORDER BY "images" LIMIT 1 |
CREATE TABLE table_77197 (
"Entered office" text,
"Left office" text,
"Party" text,
"Election" text,
"Coalition" text
) | When did the party elected in jun. 1959 enter office? | SELECT "Entered office" FROM table_77197 WHERE "Election" = 'jun. 1959' |
CREATE TABLE table_name_7 (
series VARCHAR,
date VARCHAR
) | Which Series has a Date of may 2? | SELECT series FROM table_name_7 WHERE date = "may 2" |
CREATE TABLE table_name_67 (
opponent_in_the_final VARCHAR,
tournament VARCHAR,
outcome VARCHAR,
surface VARCHAR
) | What is Opponent In The Final, when Outcome is 'Winner', when Surface is 'Carpet (I)', and when Tournament is 'Lyon, France'? | SELECT opponent_in_the_final FROM table_name_67 WHERE outcome = "winner" AND surface = "carpet (i)" AND tournament = "lyon, france" |
CREATE TABLE table_203_562 (
id number,
"state" text,
"no. of candidates" number,
"no. of elected" number,
"total no. of seats in assembly" number,
"year of election" number
) | what state had only 30 seats in their assembly ? | SELECT "state" FROM table_203_562 WHERE "total no. of seats in assembly" = 30 |
CREATE TABLE table_name_38 (
try_bonus VARCHAR,
points_for VARCHAR
) | What's the try bonus that had 423 points? | SELECT try_bonus FROM table_name_38 WHERE points_for = "423" |
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 procedures (
... | what is admission type and death status of subject id 1121? | SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "1121" |
CREATE TABLE table_name_36 (
total INTEGER,
to_par VARCHAR
) | Can you tell me the average Total that has the To par of 15? | SELECT AVG(total) FROM table_name_36 WHERE to_par = 15 |
CREATE TABLE table_name_9 (
player VARCHAR,
position VARCHAR,
year VARCHAR
) | What player played center in 2010? | SELECT player FROM table_name_9 WHERE position = "center" AND year = 2010 |
CREATE TABLE diagnoses (
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
)
C... | what is the number of patients whose diagnoses long title is unspecified essential hypertension? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Unspecified essential hypertension" |
CREATE TABLE table_name_7 (
attendance VARCHAR,
date VARCHAR
) | What is the Attendance of the game on November 6, 1966? | SELECT attendance FROM table_name_7 WHERE date = "november 6, 1966" |
CREATE TABLE table_2448 (
"Round" real,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Team" text
) | What is the winning team at Oulton Park when Max Chilton held the pole position? | SELECT "Winning Team" FROM table_2448 WHERE "Pole Position" = 'Max Chilton' AND "Circuit" = 'Oulton Park' |
CREATE TABLE table_204_311 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what was the total number of medals won by all the teams combined ? | SELECT SUM("total") FROM table_204_311 |
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,... | show me flights from DENVER to PHILADELPHIA arriving after 2100 | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.arrival_time > 2100 AND flight.to_airport = AIRPORT_SERVICE_1.ai... |
CREATE TABLE diagnoses (
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,
... | provide me the number of patients with chest pain primary disease who have procedure icd9 code 3521. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "CHEST PAIN" AND procedures.icd9_code = "3521" |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
t... | Which courses for Arrian satisfy the MDE specifications ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Arrian%' OR course.description LIKE '%Arrian%' OR course.name LIKE '%Arrian%') AND program_cours... |
CREATE TABLE table_7083 (
"Team" text,
"Match" real,
"Points" real,
"Draw" real,
"Lost" real
) | What is the average number of draws for teams with more than 10 matches? | SELECT AVG("Draw") FROM table_7083 WHERE "Match" > '10' |
CREATE TABLE table_47498 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | What is T8 Place Player Scott Hoch's Score? | SELECT "Score" FROM table_47498 WHERE "Place" = 't8' AND "Player" = 'scott hoch' |
CREATE TABLE table_60372 (
"Nation" text,
"Distance" text,
"Athlete" text,
"Venue" text,
"Date" text
) | What is Athlete, when Nation is 'Nigeria'? | SELECT "Athlete" FROM table_60372 WHERE "Nation" = 'nigeria' |
CREATE TABLE table_64857 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"# / County" text
) | Which IHSAA Football Class has a School of whitko? | SELECT "IHSAA Football Class" FROM table_64857 WHERE "School" = 'whitko' |
CREATE TABLE table_52424 (
"School" text,
"Location" text,
"Enrolment" real,
"Founded" real,
"Denomination" text,
"Day/Boarding" text,
"School Colors" text
) | Is mt lawley day or boarding? | SELECT "Day/Boarding" FROM table_52424 WHERE "Location" = 'mt lawley' |
CREATE TABLE table_name_76 (
silver INTEGER,
nation VARCHAR
) | What is the most silver won by Norway? | SELECT MAX(silver) FROM table_name_76 WHERE nation = "norway" |
CREATE TABLE table_14604 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Name the score for 26 may 1997 | SELECT "Score" FROM table_14604 WHERE "Date" = '26 may 1997' |
CREATE TABLE table_204_980 (
id number,
"name" text,
"type" text,
"elevation\n(ground station)" number,
"elevation\n(mountain station)" number,
"slope length" number,
"capacity\n(persons/hour)" number,
"construction year" number
) | what is the only cable car with a 2937 slope length ? | SELECT "name" FROM table_204_980 WHERE "type" = 'cable car' AND "slope length" = 2937 |
CREATE TABLE table_27539535_7 (
record VARCHAR,
opponent VARCHAR
) | What was the teams record when they played the ottawa senators? | SELECT record FROM table_27539535_7 WHERE opponent = "Ottawa Senators" |
CREATE TABLE table_27458 (
"Rank" real,
"Rider" text,
"Sat 29 May" text,
"Mon 31 May" text,
"Tues 1 June" text,
"Wed 2 June" text,
"Thurs 3 June" text,
"Fri 4 June" text
) | If Tuesday 1 June is 21' 05.27 107.351mph, what is the rider total number? | SELECT COUNT("Rider") FROM table_27458 WHERE "Tues 1 June" = '21'' 05.27 107.351mph' |
CREATE TABLE table_name_53 (
nba_draft VARCHAR,
player VARCHAR
) | What was the nba draft for al-farouq aminu? | SELECT nba_draft FROM table_name_53 WHERE player = "al-farouq aminu" |
CREATE TABLE table_name_91 (
avg_finish INTEGER,
year VARCHAR,
starts VARCHAR
) | in 2007, what is the avg finish that had a start less than 1? | SELECT SUM(avg_finish) FROM table_name_91 WHERE year = 2007 AND starts < 1 |
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Documents (
Document_... | How many document type for different document type description? Visualize with a bar chart, show Y-axis from high to low order. | SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types GROUP BY Document_Type_Description ORDER BY COUNT(Document_Type_Description) DESC |
CREATE TABLE table_65538 (
"Match" text,
"Date" text,
"Location" text,
"Lineup" text,
"Result" text,
"Competition" text
) | What was her place in the lineup on match 2? | SELECT "Lineup" FROM table_65538 WHERE "Match" = '2' |
CREATE TABLE table_40945 (
"Season" text,
"Round" text,
"Opponents" text,
"Home leg" text,
"Away leg" text,
"Aggregate" text
) | What is the round with ajax opponents | SELECT "Round" FROM table_40945 WHERE "Opponents" = 'ajax' |
CREATE TABLE table_204_284 (
id number,
"jurisdiction" text,
"adherents" number,
"bishops" number,
"priests" number,
"monastics" number,
"monasteries" number,
"parishes" number
) | how many jurisdictions are listed in the chart ? | SELECT COUNT("jurisdiction") FROM table_204_284 |
CREATE TABLE table_56214 (
"Candidate" text,
"Money Raised, 3Q" text,
"Loans Received, 3Q" text,
"Money Spent, 3Q" text,
"Total Receipts" text,
"Cash On Hand" text,
"After Debt" text
) | What is the amount of cash on hand that has an after debt of $327,094 | SELECT "Cash On Hand" FROM table_56214 WHERE "After Debt" = '$327,094' |
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID int,
Type text,
Market_ID int,
Year int
)
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE market (
Mar... | List the studios of each film and the number of films produced by that studio. Show bar chart. | SELECT Studio, COUNT(*) FROM film GROUP BY Studio |
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)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of hire_date and the average of employee_id bin hire_date by weekday in a bar chart. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
CREATE TABLE table_name_3 (
points INTEGER,
played INTEGER
) | What is the average Points, when Played is greater than 126? | SELECT AVG(points) FROM table_name_3 WHERE played > 126 |
CREATE TABLE table_name_20 (
attendance VARCHAR,
score VARCHAR
) | What is the total attendance at games with a score of 4-2? | SELECT COUNT(attendance) FROM table_name_20 WHERE score = "4-2" |
CREATE TABLE table_58485 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was South Melbourne's away team opponents? | SELECT "Away team" FROM table_58485 WHERE "Home team" = 'south melbourne' |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Documen... | How many documents for different location code? Plot a bar chart to show the proportion, and order y-axis in ascending order please. | SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(Location_Code) |
CREATE TABLE table_44454 (
"Season" text,
"Races" real,
"Wins" real,
"Podiums" real,
"Poles" real
) | What is Poles, when Races is less than 16? | SELECT "Poles" FROM table_44454 WHERE "Races" < '16' |
CREATE TABLE table_name_63 (
year INTEGER,
position VARCHAR
) | Which Year has a Position of 9th? | SELECT AVG(year) FROM table_name_63 WHERE position = "9th" |
CREATE TABLE table_49143 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | The tko (doctor stoppage) method was used in a loss against which opponent? | SELECT "Opponent" FROM table_49143 WHERE "Method" = 'tko (doctor stoppage)' AND "Res." = 'loss' |
CREATE TABLE table_30770 (
"Episode air date" text,
"Audition city" text,
"Date" text,
"Venue" text,
"Callback date" text,
"Callback venue" text,
"Golden tickets" real
) | Where is the audition city when the venue is upi convention center? | SELECT "Audition city" FROM table_30770 WHERE "Venue" = 'UPI Convention Center' |
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Guests (
gues... | How many bookings does each booking status have? List the booking status code and the number of corresponding bookings with a bar chart, and show by the the total number in desc please. | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY COUNT(*) DESC |
CREATE TABLE table_11832 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the Score with a Team with @ houston? | SELECT "Score" FROM table_11832 WHERE "Team" = '@ houston' |
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(... | Find the total credits of courses provided by different department. Plot them as bar chart. | SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name |
CREATE TABLE table_69744 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Which Record has a Score of 0 2? | SELECT "Record" FROM table_69744 WHERE "Score" = '0–2' |
CREATE TABLE table_57046 (
"Tournament" text,
"Winner" text,
"Runner-up" text,
"Score" text,
"Third Place" text
) | Who is the winner for the Tournament in Hong Kong with a third place winner named Mikael Pernfors? | SELECT "Winner" FROM table_57046 WHERE "Third Place" = 'mikael pernfors' AND "Tournament" = 'hong kong' |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password... | Bar chart of how many date of enrolment from each date of enrolment, and could you rank by the y-axis in desc? | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) DESC |
CREATE TABLE table_name_45 (
loses VARCHAR,
points_for VARCHAR,
points_against VARCHAR,
club VARCHAR
) | How many losses have points against greater than 592, with high park demons as the club, and points for greater than 631? | SELECT COUNT(loses) FROM table_name_45 WHERE points_against > 592 AND club = "high park demons" AND points_for > 631 |
CREATE TABLE table_name_42 (
city_of_license VARCHAR,
erp_w VARCHAR,
call_sign VARCHAR
) | What is City of License, when ERP W is greater than 3, and when Call Sign is K218DZ? | SELECT city_of_license FROM table_name_42 WHERE erp_w > 3 AND call_sign = "k218dz" |
CREATE TABLE table_name_78 (
crowd INTEGER,
home_team VARCHAR
) | What is the average crowd size of Fitzroy's home team? | SELECT AVG(crowd) FROM table_name_78 WHERE home_team = "fitzroy" |
CREATE TABLE table_64835 (
"Japanese Title" text,
"English Title" text,
"Year" real,
"First publisher" text,
"ISBN" text
) | What is the ISBN of Japanese Title of (kiri no h monsha)? | SELECT "ISBN" FROM table_64835 WHERE "Japanese Title" = '霧の訪問者 (kiri no hōmonsha)' |
CREATE TABLE table_34095 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | How many were in attendance at Griffith Stadium with Philadelphia Eagles as an opponent? | SELECT "Attendance" FROM table_34095 WHERE "Game site" = 'griffith stadium' AND "Opponent" = 'philadelphia eagles' |
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... | New users than me with more reputation. | SELECT Them.Id AS "user_link", * FROM Users AS Them, Users AS Me WHERE Me.Id = '##userid##' AND Them.Reputation > Me.Reputation AND Them.CreationDate >= Me.CreationDate ORDER BY Them.Reputation |
CREATE TABLE table_204_811 (
id number,
"year" number,
"ring name\n(birth name)" text,
"inducted by" text,
"inducted for" text,
"notes" text
) | who was the only person to be inducted for wrestling and managing ? | SELECT "ring name\n(birth name)" FROM table_204_811 WHERE "inducted for" = 'wrestling and managing' |
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
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is the number of patients whose ethnicity is black/african american and drug type is base? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND prescriptions.drug_type = "BASE" |
CREATE TABLE table_65268 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
) | What is the sum of the 2010 population with a latitude greater than 47.710905, a longitude of -101.79876, and less than 35.695 sq mi of land? | SELECT SUM("Pop. (2010)") FROM table_65268 WHERE "Latitude" > '47.710905' AND "Longitude" = '-101.79876' AND "Land ( sqmi )" < '35.695' |
CREATE TABLE market (
Number_cities INTEGER
) | How many markets have number of cities smaller than 300? | SELECT COUNT(*) FROM market WHERE Number_cities < 300 |
CREATE TABLE aircraft (
Aircraft_ID int,
Order_Year int,
Manufacturer text,
Model text,
Fleet_Series text,
Powertrain text,
Fuel_Propulsion text
)
CREATE TABLE pilot_record (
Record_ID int,
Pilot_ID int,
Aircraft_ID int,
Date text
)
CREATE TABLE pilot (
Pilot_ID int,
... | Bar chart of the number of position from each position, rank by the Y from high to low please. | SELECT Position, COUNT(Position) FROM pilot GROUP BY Position ORDER BY COUNT(Position) DESC |
CREATE TABLE table_14067 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
) | Rank 6 has what notes? | SELECT "Notes" FROM table_14067 WHERE "Rank" = '6' |
CREATE TABLE table_52627 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the average crowd size when the home team score was 8.11 (59)? | SELECT AVG("Crowd") FROM table_52627 WHERE "Home team score" = '8.11 (59)' |
CREATE TABLE table_27155678_2 (
genus_species VARCHAR,
accession_number VARCHAR
) | Name the genus/species of accession number bx897699.1 | SELECT genus_species FROM table_27155678_2 WHERE accession_number = "BX897699.1" |
CREATE TABLE table_56689 (
"Route Name" text,
"Direction" text,
"Termini" text,
"Junctions" text,
"Length" text,
"Population Area" text
) | What termini does the route with a population Area of aguilares have? | SELECT "Termini" FROM table_56689 WHERE "Population Area" = 'aguilares' |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | how much is the changing of patient 14154 in heart rate last measured on the last icu visit compared to the second to last value measured on the last icu visit? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14154) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... |
CREATE TABLE table_34191 (
"Name" text,
"Term" text,
"Games" real,
"Record (W\u2013L\u2013T / OTL)" text,
"Points" real,
"Win percentage" real
) | Which Name has Games of 105? | SELECT "Name" FROM table_34191 WHERE "Games" = '105' |
CREATE TABLE table_1354805_6 (
average VARCHAR,
number_of_dances VARCHAR
) | tell the competitions where the mean is 1 | SELECT average FROM table_1354805_6 WHERE number_of_dances = 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.