table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_16252 (
"Season" text,
"Series" text,
"Team Name" text,
"Races" real,
"Poles" real,
"Wins" real,
"Points" real,
"Position" text
) | what is the least number of poles? | SELECT MIN("Poles") FROM table_16252 |
CREATE TABLE table_31268 (
"Season" real,
"Apocalypstix" text,
"Denim Demons" text,
"Sake Tuyas" text,
"Toxic Shocks" text
) | What place did the Sake Tuyas come in when the Denim Demons were 4th? | SELECT "Sake Tuyas" FROM table_31268 WHERE "Denim Demons" = '4th' |
CREATE TABLE table_name_53 (
result VARCHAR,
captain_1 VARCHAR,
date VARCHAR
) | Which Result has a Captain 1 of louis burger, and a Date of 30 october 2 november? | SELECT result FROM table_name_53 WHERE captain_1 = "louis burger" AND date = "30 october–2 november" |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphr... | list papers published in cvpr | SELECT DISTINCT paper.paperid FROM paper, venue WHERE venue.venueid = paper.venueid AND venue.venuename = 'cvpr' |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city v... | Show me the difficulty for all of the CS-LSA courses . | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE program_course.course_id = course.course_id AND program.name LIKE 'CS-LSA' AND program.program_id = program_course.program_id |
CREATE TABLE table_25256 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
) | When Princeton was the regular season winner, who was the tournament winner? | SELECT "Tournament Winner" FROM table_25256 WHERE "Regular Season Winner" = 'Princeton' |
CREATE TABLE table_552 (
"English Title/Translation" text,
"Japanese Title" text,
"Developer" text,
"Publisher" text,
"Genre" text,
"Console(s)" text,
"Initial Release Date" text
) | What's the genre of Fever Ranma : Hot Springs Athletic Chapter? | SELECT "Genre" FROM table_552 WHERE "English Title/Translation" = 'Fever Ranma ½: Hot Springs Athletic Chapter' |
CREATE TABLE table_name_81 (
title VARCHAR,
director VARCHAR
) | On what title was Stephen Fossatti the director of? | SELECT title FROM table_name_81 WHERE director = "stephen fossatti" |
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,
... | when patient 19175 had intake for the first time on last month/02? | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19175)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT_TIME(), ... |
CREATE TABLE table_203_102 (
id number,
"event" text,
"performance" text,
"athlete" text,
"nation" text,
"place" text,
"date" text
) | what is the number of world records that were recorded in august ? | SELECT COUNT(*) FROM table_203_102 WHERE "date" = 8 |
CREATE TABLE table_name_82 (
frequency VARCHAR,
destination VARCHAR
) | What is the frequency of the train to Bangalore? | SELECT frequency FROM table_name_82 WHERE destination = "bangalore" |
CREATE TABLE table_name_67 (
played INTEGER,
team VARCHAR,
place VARCHAR
) | Name the sum of played for c.d. luis ngel firpo and place more than 3 | SELECT SUM(played) FROM table_name_67 WHERE team = "c.d. luis ángel firpo" AND place > 3 |
CREATE TABLE table_8397 (
"Name" text,
"Country of Origin" text,
"Position" text,
"Elected" real,
"Term" real
) | What is the lowest term from the 2007 election with the position of chairperson? | SELECT MIN("Term") FROM table_8397 WHERE "Elected" = '2007' AND "Position" = 'chairperson' |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,... | For those employees who was hired before 2002-06-21, find job_id and the sum of department_id , and group by attribute job_id, and visualize them by a bar chart, display by the total number of department id from high to low. | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) DESC |
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 t... | give me the number of patients on main type drug prescription who have cerebral embolism with cerebral infarction diagnoses. | 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 = "Crbl emblsm w infrct" AND prescriptions.drug_type = "MAIN" |
CREATE TABLE table_61152 (
"7:00 am" text,
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"4:00 pm" text,
"4:30 pm" text,
"5:00 pm" ... | What is 8:00 am, when 11:00 am is 'Local Programs'? | SELECT "8:00 am" FROM table_61152 WHERE "11:00 am" = 'local programs' |
CREATE TABLE table_71784 (
"Date" text,
"Region" text,
"Label" text,
"Catalogue" text,
"Format" text
) | Which catalogue has essential, castle music as it's label? | SELECT "Catalogue" FROM table_71784 WHERE "Label" = 'essential, castle music' |
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE appellations (
no numbe... | Give the names of wines with prices above any wine produced in 2006. | SELECT name FROM wine WHERE price > (SELECT MAX(price) FROM wine WHERE year = 2006) |
CREATE TABLE table_name_74 (
round INTEGER,
team VARCHAR
) | How many players were drafted from the Boston Cannons in the round? | SELECT SUM(round) FROM table_name_74 WHERE team = "boston cannons" |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 pat... | how many patients got a microbiological blood culture - neonate test? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'blood culture - neonate') |
CREATE TABLE table_22486 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
) | What is the water area (sqmi) for the township at latitude 48.423224? | SELECT "Water (sqmi)" FROM table_22486 WHERE "Latitude" = '48.423224' |
CREATE TABLE table_55312 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which Crowd has an Away team score of 17.11 (113)? | SELECT SUM("Crowd") FROM table_55312 WHERE "Away team score" = '17.11 (113)' |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | tell me the total amount of input that patient 017-74752 has received since 06/25/2102? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-74752')) AND intakeoutput.cellpath LIKE '%in... |
CREATE TABLE table_3906 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
) | What number in the season was 'Burning Down the House'? | SELECT MAX("No. in season") FROM table_3906 WHERE "Title" = 'Burning Down the House' |
CREATE TABLE table_11734041_3 (
school_club_team_country VARCHAR,
years_for_rockets VARCHAR
) | Which school, club team, or country played for the rockets in the years 2000-01? | SELECT school_club_team_country FROM table_11734041_3 WHERE years_for_rockets = "2000-01" |
CREATE TABLE table_27882867_9 (
location_attendance VARCHAR,
high_points VARCHAR
) | What was the location and attendance when d. wilkins (29) had the high points? | SELECT location_attendance FROM table_27882867_9 WHERE high_points = "D. Wilkins (29)" |
CREATE TABLE table_2359 (
"Round" real,
"Choice" real,
"Player" text,
"Position" text,
"Height" text,
"Weight" text,
"College" text
) | How many positions have round 3? | SELECT COUNT("Position") FROM table_2359 WHERE "Round" = '3' |
CREATE TABLE table_23495048_2 (
represent VARCHAR,
height__mtr_ VARCHAR
) | Which country had a contestant that was 1.76 meters tall? | SELECT represent FROM table_23495048_2 WHERE height__mtr_ = "1.76" |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE PR... | Find the max gpa of all students in each department with a pie chart. | SELECT DEPT_CODE, MAX(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE |
CREATE TABLE table_name_88 (
engine VARCHAR,
team VARCHAR
) | Tell me the engine for dhg tom's racing | SELECT engine FROM table_name_88 WHERE team = "dhg tom's racing" |
CREATE TABLE table_train_130 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"right_bundle_branch_block" bool,
"space_occupying_cerebral_lesion" bool,
"huntington_disease" bool,
"psychiatric_disease" bool,
"mental_illness" bool,
"treatment_regimen" bool,
"psychoti... | blood pressure greater than 160 / 100 mmhg. subjects with elevated bp will be allowed at the discretion of the principal investigator. individuals with hypertension must have been stabilized to the current treatment regimen for at least 6 weeks prior to screening and not need adjustments to their treatment regimen duri... | SELECT * FROM table_train_130 WHERE systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 100 OR hypertension = 1 OR treatment_regimen = 1 |
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE domain_conference (
cid int,
did int
)
CREATE TABLE domain_journal (
did int,
jid int
)
CREATE TABLE writes (
aid int... | return me the authors who have the most number of papers in PVLDB . | SELECT author.name FROM author, journal, publication, writes WHERE journal.name = 'PVLDB' AND publication.jid = journal.jid AND writes.aid = author.aid AND writes.pid = publication.pid GROUP BY author.name ORDER BY COUNT(DISTINCT (publication.title)) DESC LIMIT 1 |
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, find headquarter and the average of manufacturer , and group by attribute headquarter, and visualize them by a bar chart, and could you order in descending by the X? | SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC |
CREATE TABLE table_51602 (
"Track" real,
"Title" text,
"Translation" text,
"Composer" text,
"Recorded" text
) | Name the total number of tracks for of the fallen angel | SELECT COUNT("Track") FROM table_51602 WHERE "Translation" = 'the fallen angel' |
CREATE TABLE genre (
g_name text,
rating text,
most_popular_in text
)
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats text
)
CREATE TABLE artist (
artist_name text,
country text,
gender text,
preferred_genre text
)
CREATE TABL... | What are the names and countries of origin for the artists who produced the top three highly rated songs. | SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3 |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | find out how many patients were discharged from the hospital. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_gradu... | For ULCS , which MEDADM classes can be counted ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department LIKE '%MEDADM%' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | Find the number of rooms with king bed for each decor type, I want to order the total number in asc order. | SELECT decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor ORDER BY COUNT(*) |
CREATE TABLE table_51768 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was Melbourne's away team opponent? | SELECT "Away team" FROM table_51768 WHERE "Home team" = 'melbourne' |
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 t... | how many patients are diagnosed with full incontinence-feces and followed the procedure int insert dual-cham dev? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE diagnoses.short_title = "Full incontinence-feces" AND procedures.short_title = "Int insert dual-cham dev" |
CREATE TABLE table_name_65 (
weight VARCHAR,
series VARCHAR,
reverse VARCHAR
) | How much did the Modern Pentathlon III Series coin weigh? | SELECT weight FROM table_name_65 WHERE series = "iii series" AND reverse = "modern pentathlon" |
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,
... | Calculate the average age of male patients who were divorcees | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.gender = "M" |
CREATE TABLE table_18327 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What district did the Democratic party incumbent Stephen J. Solarz get first elected to in 1974? | SELECT "District" FROM table_18327 WHERE "Party" = 'Democratic' AND "First elected" = '1974' AND "Incumbent" = 'Stephen J. Solarz' |
CREATE TABLE table_name_85 (
altitude__mslm_ INTEGER,
density__inhabitants_km_2__ VARCHAR,
rank VARCHAR
) | Which Altitude (mslm) has a Density (inhabitants/km 2) smaller than 1233, and a Rank of 9th? | SELECT SUM(altitude__mslm_) FROM table_name_85 WHERE density__inhabitants_km_2__ < 1233 AND rank = "9th" |
CREATE TABLE table_name_87 (
engine VARCHAR,
year INTEGER
) | What engine was used after 1984? | SELECT engine FROM table_name_87 WHERE year > 1984 |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local... | Compute the number of services by services and then split by local authorities Show the result with a stacked bar graph, show by the X-axis from low to high. | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY services, local_authority ORDER BY local_authority |
CREATE TABLE table_54023 (
"Rank" real,
"Name" text,
"City" text,
"Height (m)" real,
"Height (ft)" real,
"Floors" real
) | what is the total of floors when the name is k lntriangle and rank is less thank 63? | SELECT SUM("Floors") FROM table_54023 WHERE "Name" = 'kölntriangle' AND "Rank" < '63' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | give me the number of patients whose diagnoses short title is stevens-johnson-ten syn and drug route is id? | 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 = "Stevens-Johnson-TEN syn" AND prescriptions.route = "ID" |
CREATE TABLE table_46129 (
"First Vice President" text,
"Second Vice President" text,
"Third Vice president" text,
"Inaugurated" text,
"Left Office" text
) | What is Second Vice President, when Inaugurated is '26 March 1928'? | SELECT "Second Vice President" FROM table_46129 WHERE "Inaugurated" = '26 march 1928' |
CREATE TABLE table_name_66 (
cost___us$__ VARCHAR,
open_source VARCHAR
) | What is the cost of an Open Source that is no? | SELECT cost___us$__ FROM table_name_66 WHERE open_source = "no" |
CREATE TABLE table_33212 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
) | What was Dan Selznick best time? | SELECT "Best" FROM table_33212 WHERE "Name" = 'dan selznick' |
CREATE TABLE table_77798 (
"Player" text,
"Club" text,
"League" real,
"Play-offs" real,
"FA Cup" real,
"FA Trophy" real,
"Total" real
) | Which of the lowest leagues had Aldershot town as a club when the play-offs number was less than 0? | SELECT MIN("League") FROM table_77798 WHERE "Club" = 'aldershot town' AND "Play-offs" < '0' |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
Ta... | All questions tagged with three tags, formatted for copying out links. | SELECT q.Id AS "Id", 'http://chemistry.stackexchange.com/q/' + CAST(q.Id AS TEXT(15)) AS "Link" FROM Posts AS q WHERE q.PostTypeId = 1 AND q.Tags LIKE '%<' + @Tag1 + '>%' AND q.Tags LIKE '%<' + @Tag2 + '>%' AND q.Tags LIKE '%<' + @Tag3 + '>%' ORDER BY q.Id |
CREATE TABLE table_23248967_10 (
high_points VARCHAR,
game VARCHAR
) | Who scored the high points in game 78? | SELECT high_points FROM table_23248967_10 WHERE game = 78 |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Most Cassandra Questions answered for the year. | SELECT Users.DisplayName, COUNT(*) AS questions FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Tags.Id = 34113 AND Posts.CreationDate > '2015-01-01 00:00:00' GROUP BY Users.DisplayName ORDER BY questio... |
CREATE TABLE table_54978 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | In the game on 11 March 2008 with a visiting team of Bucks, who was the home team? | SELECT "Home" FROM table_54978 WHERE "Visitor" = 'bucks' AND "Date" = '11 march 2008' |
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
) | Give me a bar chart for the total number of each class, and order x axis in asc order. | SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY Class |
CREATE TABLE table_56857 (
"Name" text,
"City" text,
"Height (m)" real,
"Height (ft)" real,
"Floors" real,
"Years as tallest" text
) | For a height less than 122 meters, what is the greatest height in feet? | SELECT MAX("Height (ft)") FROM table_56857 WHERE "Height (m)" < '122' |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents ... | what is the amount of patient 72909's hospital bill during their stay on the current hospital visit? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72909 AND admissions.dischtime IS NULL) |
CREATE TABLE table_name_8 (
operator VARCHAR,
ship VARCHAR
) | What operator has a ship costa pacifica? | SELECT operator FROM table_name_8 WHERE ship = "costa pacifica" |
CREATE TABLE table_59906 (
"Season" text,
"Date Released" text,
"# Of Episodes" real,
"# Of Discs" real,
"Special Features" text
) | What Date Released, when # Of Discs is greater than 4? | SELECT "Date Released" FROM table_59906 WHERE "# Of Discs" > '4' |
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,
... | count the number of patients whose discharge location is short term hospital and procedure long title is combined right and left heart cardiac catheterization? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.long_title = "Combined right and left heart cardiac catheterization" |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Draw a scatterplot of acc percent vs all_games_percent where acc percent is on the x-axis and points are colored by ACC_Road | SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_Road |
CREATE TABLE Documents (
document_id VARCHAR,
document_name VARCHAR
) | Show the ids and names of all documents. | SELECT document_id, document_name FROM Documents |
CREATE TABLE table_name_12 (
country VARCHAR,
debt_as__percentage_of_value VARCHAR,
_percentage_change_on_year VARCHAR
) | Name the country where % change on year is 21 and value is less than 86 | SELECT country FROM table_name_12 WHERE debt_as__percentage_of_value < 86 AND _percentage_change_on_year = "21" |
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
)
... | give the number of patients whose admission type is urgent and lab test name is amylase, ascites | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Amylase, Ascites" |
CREATE TABLE table_name_95 (
date VARCHAR,
record VARCHAR
) | What was the date of the game where the indians record was 37-44? | SELECT date FROM table_name_95 WHERE record = "37-44" |
CREATE TABLE table_name_98 (
college VARCHAR,
pick VARCHAR
) | What college did pick 33 attend? | SELECT college FROM table_name_98 WHERE pick = 33 |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
... | how many patients were during the previous year in the 49 ward. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 49 AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) |
CREATE TABLE people (
country VARCHAR,
age INTEGER
) | Show the country where people older than 30 and younger than 25 are from. | SELECT country FROM people WHERE age < 25 INTERSECT SELECT country FROM people WHERE age > 30 |
CREATE TABLE table_5257 (
"Episode" real,
"Title" text,
"Airdate (Canada)" text,
"Airdate (USA)" text,
"CBS airdate" text
) | What is the total number of episodes aired in Canada on 22 October 2004? | SELECT COUNT("Episode") FROM table_5257 WHERE "Airdate (Canada)" = '22 october 2004' |
CREATE TABLE table_22834834_12 (
year VARCHAR,
earnings__$_ VARCHAR
) | How many years had a total earnings amount of 2254598? | SELECT COUNT(year) FROM table_22834834_12 WHERE earnings__$_ = 2254598 |
CREATE TABLE table_30120555_1 (
barony VARCHAR,
area__acres__ VARCHAR
) | Which barony contains a townland with an area 24 acres? | SELECT barony FROM table_30120555_1 WHERE area__acres__ = 24 |
CREATE TABLE table_43709 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"FCC info" text
) | What is average frequency MHZ when is in portales, new mexico? | SELECT AVG("Frequency MHz") FROM table_43709 WHERE "City of license" = 'portales, new mexico' |
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 diagnosed with malignant neoplasm of other sites of tongue who had abnormal lab test status. | 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.long_title = "Malignant neoplasm of other sites of tongue" AND lab.flag = "abnormal" |
CREATE TABLE table_70744 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | How many years did John Player Lotus used Cosworth v8? | SELECT SUM("Year") FROM table_70744 WHERE "Engine" = 'cosworth v8' AND "Entrant" = 'john player lotus' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | in a day before, when was the first time that the respiration of patient 021-95970 was less than 32.0? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-95970')) AND vitalperiodic.respiration < 32.0 A... |
CREATE TABLE table_16795394_3 (
team__number1 VARCHAR,
team__number2 VARCHAR
) | If team two is San Lorenzo, how many were on team one? | SELECT COUNT(team__number1) FROM table_16795394_3 WHERE team__number2 = "San Lorenzo" |
CREATE TABLE table_name_50 (
hdtv VARCHAR,
content VARCHAR
) | What is the HDTV when the content is general television? | SELECT hdtv FROM table_name_50 WHERE content = "general television" |
CREATE TABLE table_203_8 (
id number,
"player" text,
"rec." number,
"yards" number,
"avg." number,
"td's" number,
"long" number
) | which player 's average is higher than ira gooch 's ? | SELECT "player" FROM table_203_8 WHERE "avg." > (SELECT "avg." FROM table_203_8 WHERE "player" = 'ira gooch') |
CREATE TABLE table_5115 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
) | What was the last year that they had less than 16 points in class 500cc? | SELECT MAX("Year") FROM table_5115 WHERE "Points" < '16' AND "Class" = '500cc' |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0... | For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the average of manager_id bin hire_date by time in a bar chart. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' |
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFloor INTEGER,
BlockCode INTEGER,
OnCallStart DATETIME,
OnCallEnd DATETIME
)
CREATE TABLE Physician (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
SSN INTEGER
)
CREATE TABLE Appointment (
AppointmentID INTEGER,
Patie... | Find the number of medications prescribed for each brand. Plot them as bar chart. | SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand |
CREATE TABLE table_18481791_3 (
title VARCHAR,
no_in_series VARCHAR
) | What is the title of series 23? | SELECT title FROM table_18481791_3 WHERE no_in_series = 23 |
CREATE TABLE table_49327 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Can you tell me the Time that has the Opponent of phil baroni? | SELECT "Time" FROM table_49327 WHERE "Opponent" = 'phil baroni' |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Pr... | Show the relationship between accout id and account name for all accounts by the customer with first name 'Meaghan' in a scatter chart. | SELECT account_id, account_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' |
CREATE TABLE table_44048 (
"Class" text,
"Wheel arrangement" text,
"Manufacturer" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text
) | What is Quantity Made, when Manufacturer is 'Baldwin'? | SELECT "Quantity made" FROM table_44048 WHERE "Manufacturer" = 'baldwin' |
CREATE TABLE table_74064 (
"Total #" real,
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | How many different episode numbers does the episode written by Sheri Elwood and directed by Jim Allodi have? | SELECT COUNT("Total #") FROM table_74064 WHERE "Written by" = 'Sheri Elwood' AND "Directed by" = 'Jim Allodi' |
CREATE TABLE table_name_96 (
name VARCHAR,
decile VARCHAR,
area VARCHAR
) | Which name has a Decile of 5, and an Area of tauranga? | SELECT name FROM table_name_96 WHERE decile = 5 AND area = "tauranga" |
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... | what is maximum age of patients whose gender is m and year of death is less than 2168? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.dod_year < "2168.0" |
CREATE TABLE table_204_107 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what are the total number of gold medals italy earned ? | SELECT "gold" FROM table_204_107 WHERE "nation" = 'italy' |
CREATE TABLE table_name_13 (
copaxone VARCHAR,
mitoxantrone VARCHAR,
betaseron__beta_1b_ VARCHAR
) | Name the copaxone with mitoxantrone of no and betaseron (beta-1b) of no | SELECT copaxone FROM table_name_13 WHERE mitoxantrone = "no" AND betaseron__beta_1b_ = "no" |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | count the number of patients whose age is less than 86 and drug code is levobase2? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "86" AND prescriptions.formulary_drug_cd = "LEVOBASE2" |
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 t... | how many patients whose primary disease is ruq pain and admission year is less than 2131? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.admityear < "2131" |
CREATE TABLE table_75475 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | How many games have a record of 30 25 9 and more points than 69? | SELECT COUNT("Game") FROM table_75475 WHERE "Record" = '30–25–9' AND "Points" > '69' |
CREATE TABLE table_name_37 (
name VARCHAR,
games VARCHAR,
medal VARCHAR
) | Which Name had a Games of 2008 beijing, and a Medal of gold? | SELECT name FROM table_name_37 WHERE games = "2008 beijing" AND medal = "gold" |
CREATE TABLE table_56550 (
"Year" text,
"Type" text,
"Nos." text,
"GSWR Class" real,
"GSWR Nos." text,
"GSR Class" text,
"Inchicore Class" text,
"Withdrawn" text
) | What is withdrawn with a GSR Class of 296? | SELECT "Withdrawn" FROM table_56550 WHERE "GSR Class" = '296' |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | Return a histogram on what is the average number of stars that each reviewer awards for a movie?, and display in ascending by the x axis please. | SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY name |
CREATE TABLE table_68589 (
"Terminal" text,
"Operator" text,
"Depth (m)" text,
"Berths" real,
"Quay cranes" real
) | Name the operator with berths more than 1 and depth of 12.5-15.5 | SELECT "Operator" FROM table_68589 WHERE "Berths" > '1' AND "Depth (m)" = '12.5-15.5' |
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
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the average of manufacturer , and group by attribute founder, I want to sort in descending by the X-axis please. | SELECT Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.