table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | Show Questions With Questions as their Accepted Answer. | SELECT A.* FROM Posts AS Q INNER JOIN Posts AS A ON (Q.AcceptedAnswerId = A.Id) WHERE A.PostTypeId = 1 |
CREATE TABLE table_68961 (
"Episode" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | What song was chosen for the episode with the top 8? | SELECT "Song choice" FROM table_68961 WHERE "Episode" = 'top 8' |
CREATE TABLE match_season (
season number,
player text,
position text,
country number,
team number,
draft_pick_number number,
draft_class text,
college text
)
CREATE TABLE team (
team_id number,
name text
)
CREATE TABLE player (
player_id number,
player text,
years_... | Show the country name and capital of all countries. | SELECT country_name, capital FROM country |
CREATE TABLE table_61501 (
"Tournament" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | What's the 2011 result when 2010 is 2r and 2013 is w? | SELECT "2011" FROM table_61501 WHERE "2010" = '2r' AND "2013" = 'w' |
CREATE TABLE Course (
CID VARCHAR(7),
CName VARCHAR(40),
Credits INTEGER,
Instructor INTEGER,
Days VARCHAR(5),
Hours VARCHAR(11),
DNO INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER... | A bar chart shows the distribution of Days and the average of Credits , and group by attribute Days. | SELECT Days, AVG(Credits) FROM Course GROUP BY Days ORDER BY Credits |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | what's the drug patient 022-47232 was prescribed two times on the first hospital encounter? | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022... |
CREATE TABLE table_53805 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text,
"Arena" text,
"Points" real
) | How many attended the game against the sharks with over 86 points? | SELECT AVG("Attendance") FROM table_53805 WHERE "Points" > '86' AND "Opponent" = 'sharks' |
CREATE TABLE table_49291 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | Which Player has a To par of 1? | SELECT "Player" FROM table_49291 WHERE "To par" = '–1' |
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
)
... | give me the number of patients whose procedure short title is contr cerebr arteriogram? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Contr cerebr arteriogram" |
CREATE TABLE table_train_134 (
"id" int,
"mini_mental_state_examination_mmse" int,
"geriatric_depression_scale_gds" int,
"alzheimer_disease_ad" bool,
"rosen_modified_hachinski_ischemic_score" int,
"clinical_dementia_rating_cdr" float,
"NOUSE" float
) | global clinical dementia rating ( cdr ) scale >= 0.5 or greater with cdr memory >= 0.5 or greater | SELECT * FROM table_train_134 WHERE clinical_dementia_rating_cdr >= 0.5 OR clinical_dementia_rating_cdr >= 0.5 |
CREATE TABLE table_60412 (
"Year" real,
"Name of Tournament" text,
"Champions" text,
"Runners-up" text,
"Score" text
) | What were the Runners-up prior to 1990 when Ivan Lendl was Champion in the Seiko Super Tennis Tournament? | SELECT "Runners-up" FROM table_60412 WHERE "Champions" = 'ivan lendl' AND "Name of Tournament" = 'seiko super tennis' AND "Year" < '1990' |
CREATE TABLE table_67160 (
"Date" text,
"Visiting team" text,
"Final score" text,
"Host team" text,
"Stadium" text
) | What date did the New York Giants play as a visiting team? | SELECT "Date" FROM table_67160 WHERE "Visiting team" = 'new york giants' |
CREATE TABLE farm (
Farm_ID int,
Year int,
Total_Horses real,
Working_Horses real,
Total_Cattle real,
Oxen real,
Bulls real,
Cows real,
Pigs real,
Sheep_and_Goats real
)
CREATE TABLE competition_record (
Competition_ID int,
Farm_ID int,
Rank int
)
CREATE TABLE city ... | weekday , list in desc by the y axis. | SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID ORDER BY COUNT(Year) DESC |
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points number,
horizontal_bar_points number,
total_points number
)
CREATE TABLE people (
people_id number,
name text,
a... | What are the hometowns of gymnasts and the corresponding number of gymnasts? | SELECT T2.hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id GROUP BY T2.hometown |
CREATE TABLE table_47312 (
"Year" text,
"Indians admitted" real,
"Pakistanis admitted" real,
"Sri Lankans admitted" real,
"Bangladeshis admitted" real,
"Nepalis admitted" real
) | How many Sri Lankans were admitted in 2004 when more than 594 Nepalis were admitted? | SELECT SUM("Sri Lankans admitted") FROM table_47312 WHERE "Year" = '2004' AND "Nepalis admitted" > '594' |
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE loan (
loan_ID varchar(3),
loan_type varchar(15),
cust_ID varchar(3),
branch_ID varchar(3),
amount int
)
CREATE TABLE customer (
cust_ID varchar(3),... | What are the names and account balances of customers with the letter a in their names, order by the x-axis in descending. | SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY cust_name DESC |
CREATE TABLE table_28020 (
"Agency" text,
"Route Number" text,
"North/East Terminal" text,
"South/West Terminal" text,
"More Information" text
) | Name the route number for rincon valley | SELECT "Route Number" FROM table_28020 WHERE "South/West Terminal" = 'Rincon Valley' |
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... | Tags for Posts By Date. | SELECT * FROM (SELECT OwnerUserId AS id, MAX(Tags) AS tags FROM Posts WHERE CreationDate > '1/1/2015' AND LENGTH(Tags) > 0 GROUP BY OwnerUserId) AS x WHERE LENGTH(Tags) > 50 LIMIT 50000 |
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 (... | give me the number of patients whose drug type is main and lab test name is reticulocyte count, manual? | 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.drug_type = "MAIN" AND lab.label = "Reticulocyte Count, Manual" |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | what is the ingesting method of k phos mono-sod phos di & mono 155-852-130 mg po tabs? | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'k phos mono-sod phos di & mono 155-852-130 mg po tabs' |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
... | For each city, return the highest latitude among its stations Show bar chart, I want to sort by the Y-axis in desc please. | SELECT city, MAX(lat) FROM station GROUP BY city ORDER BY MAX(lat) DESC |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY... | For those employees who do not work in departments with managers that have ids between 100 and 200, find first_name and commission_pct , and visualize them by a bar chart, list from high to low by the Y. | SELECT FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT DESC |
CREATE TABLE basketball_match (
school_id VARCHAR
) | How many schools are in the basketball match? | SELECT COUNT(DISTINCT school_id) FROM basketball_match |
CREATE TABLE table_25773116_2 (
pole_position VARCHAR,
fastest_lap VARCHAR,
location VARCHAR
) | Who had pole position for the races in Braselton, Georgia where Victor Carbone had fastest lap? | SELECT pole_position FROM table_25773116_2 WHERE fastest_lap = "Victor Carbone" AND location = "Braselton, Georgia" |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | how much is the minimum hospital bill that includes mal neo lower 3rd esoph until 2 years ago? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'mal neo lower 3rd esoph')) AND DATETIME(cost.chargetime) <= DAT... |
CREATE TABLE table_172 (
"Country/Region" text,
"Show Title" text,
"Languages" text,
"Host" text,
"Channel" text,
"Premiere" text,
"Seasons" text,
"Status" text
) | Which premiere had languages in danish? | SELECT "Premiere" FROM table_172 WHERE "Languages" = 'Danish' |
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 treatment (
treat... | what are the ways to consume potassium chloride 40 meq/100 ml iv piggy back 100 ml bag? | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'potassium chloride 40 meq/100 ml iv piggy back 100 ml bag' |
CREATE TABLE table_name_82 (
channel VARCHAR,
studio_analysts VARCHAR,
play_by_play VARCHAR,
studio_host VARCHAR
) | which channel will have play by play commentator Paul Sunderland, Studio Host Bill Macdonald and Studi Analysty Jack Haley? | SELECT channel FROM table_name_82 WHERE play_by_play = "paul sunderland" AND studio_host = "bill macdonald" AND studio_analysts = "jack haley" |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE writes (
paperid int,
... | What is the most cited paper by ali farhadi ? | SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'ali farhadi' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC |
CREATE TABLE table_16859758_1 (
release_date VARCHAR,
title VARCHAR
) | When was 'Tell You When' released? | SELECT release_date FROM table_16859758_1 WHERE title = "Tell You When" |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
... | Does the 'Informed' badge affect post score?. | SELECT p.Score AS "Score", SUM(CASE WHEN b.Id IS NULL THEN 1 ELSE 0 END) AS "Not Informed", SUM(CASE WHEN b.Id IS NULL THEN 0 ELSE 1 END) AS "Informed" FROM Posts AS p LEFT OUTER JOIN Badges AS b ON b.UserId = p.OwnerUserId AND b.Name = 'Informed' WHERE p.PostTypeId = 2 GROUP BY p.Score ORDER BY p.Score |
CREATE TABLE table_64189 (
"2005/ 06" text,
"2006/ 07" text,
"2007/ 08" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
) | Which 2005/ 06 has a 2011/ 12 of ranking tournaments | SELECT "2005/ 06" FROM table_64189 WHERE "2011/ 12" = 'ranking tournaments' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | inform me about the number of patients born before 2168 who were diagnosed with unspecified hepatitis. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2168" AND diagnoses.long_title = "Hepatitis, unspecified" |
CREATE TABLE table_name_6 (
dates VARCHAR,
rally_hq VARCHAR
) | Which dates have a Rally HQ of kingscliff? | SELECT dates FROM table_name_6 WHERE rally_hq = "kingscliff" |
CREATE TABLE table_name_50 (
date VARCHAR,
site VARCHAR
) | What date was the Site michigan stadium ann arbor, mi? | SELECT date FROM table_name_50 WHERE site = "michigan stadium • ann arbor, mi" |
CREATE TABLE table_12398 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What was the score for Nick Faldo? | SELECT AVG("Score") FROM table_12398 WHERE "Player" = 'nick faldo' |
CREATE TABLE table_name_36 (
lost VARCHAR,
drawn INTEGER
) | How many losses have draw values under 1? | SELECT COUNT(lost) FROM table_name_36 WHERE drawn < 1 |
CREATE TABLE table_name_60 (
series VARCHAR,
saturday VARCHAR
) | In what series did Alice Levine Jamie East give a presentation on Saturday? | SELECT series FROM table_name_60 WHERE saturday = "alice levine jamie east" |
CREATE TABLE table_10946 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | I want the lowest Grid for David Coulthard | SELECT MIN("Grid") FROM table_10946 WHERE "Driver" = 'david coulthard' |
CREATE TABLE table_203_496 (
id number,
"pos" number,
"country" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many more medals did italy win than the soviet union ? | SELECT (SELECT "total" FROM table_203_496 WHERE "country" = 'italy') - (SELECT "total" FROM table_203_496 WHERE "country" = 'soviet union') |
CREATE TABLE table_204_487 (
id number,
"home team" text,
"score" text,
"visiting team" text,
"location" text,
"venue" text,
"door" text,
"surface" text
) | how many teams won by a margin of two or more points ? | SELECT COUNT(*) FROM table_204_487 WHERE ABS("score" - "score") >= 2 |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total... | To declare a major in THTREMUS which courses are required ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%THTREMUS%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id |
CREATE TABLE table_name_43 (
year INTEGER,
entrant VARCHAR,
engine VARCHAR
) | How many years did Barclay Nordica Arrows BMW enter with Cosworth v8 engine? | SELECT SUM(year) FROM table_name_43 WHERE entrant = "barclay nordica arrows bmw" AND engine = "cosworth v8" |
CREATE TABLE table_name_36 (
goals INTEGER,
name VARCHAR,
rank VARCHAR
) | How many goals were there for Johan Cruyff when the rank's less than 3? | SELECT SUM(goals) FROM table_name_36 WHERE name = "johan cruyff" AND rank < 3 |
CREATE TABLE table_1342331_18 (
district VARCHAR,
incumbent VARCHAR
) | What district has Riley Joseph Wilson as the incumbent? | SELECT district FROM table_1342331_18 WHERE incumbent = "Riley Joseph Wilson" |
CREATE TABLE table_name_33 (
number VARCHAR,
language VARCHAR
) | What Number has a Language listed as other? | SELECT number FROM table_name_33 WHERE language = "other" |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE dorm ... | Find the name of the dorm with the largest capacity. | SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1 |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | What is the number of each allergie the girl named Lisa has? Plot them as bar chart, rank X in descending order. | SELECT T1.Allergy, COUNT(T1.Allergy) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" GROUP BY T1.Allergy ORDER BY T1.Allergy DESC |
CREATE TABLE table_train_37 (
"id" int,
"severe_sepsis" bool,
"mechanical_ventilation" bool,
"surgery" bool,
"receiving_vasopressor" bool,
"sepsis" bool,
"organ_failure" bool,
"septic_shock" bool,
"age" float,
"NOUSE" float
) | age < 18 years old | SELECT * FROM table_train_37 WHERE age < 18 |
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... | among patients on urgent admission, calculate the average age of those who remained admitted in hospital for 4 days. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.days_stay = "4" |
CREATE TABLE table_name_36 (
score VARCHAR,
date VARCHAR
) | What is the score on December 1? | SELECT score FROM table_name_36 WHERE date = "december 1" |
CREATE TABLE table_22951646_1 (
number_of_contestants INTEGER
) | Name the most number of contestants | SELECT MAX(number_of_contestants) FROM table_22951646_1 |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text... | i need a flight from MILWAUKEE to INDIANAPOLIS leaving monday before 900 | SELECT DISTINCT flight_id FROM flight WHERE (((departure_time < 900 AND flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0.month_number = 2 AND DATE_DAYal... |
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 average age of patients whose gender is f and primary disease is angioedema? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "ANGIOEDEMA" |
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 was hired before 2002-06-21, draw a line chart about the change of commission_pct over hire_date , list X-axis in asc order. | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE |
CREATE TABLE table_204_946 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | greg moore was from the same team as what other 9th place driver ? | SELECT "driver" FROM table_204_946 WHERE "pos" = 9 |
CREATE TABLE table_46204 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | What is Player, when Total is greater than 148, and when To Par is '12'? | SELECT "Player" FROM table_46204 WHERE "Total" > '148' AND "To par" = '12' |
CREATE TABLE table_66519 (
"Original NFL team" text,
"Player" text,
"Pos." text,
"College" text,
"Conf." text
) | What conference did the player originally from the denver broncos play in? | SELECT "Conf." FROM table_66519 WHERE "Original NFL team" = 'denver broncos' |
CREATE TABLE table_4189 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" real,
"Position" text
) | How many poles does the European F3 Open series have? | SELECT "Poles" FROM table_4189 WHERE "Series" = 'European F3 Open' |
CREATE TABLE table_25751274_2 (
rank__night_ INTEGER,
rating VARCHAR
) | What is the lowest rank of an episode with a rating/share (18-49) of 1.3/4? | SELECT MIN(rank__night_) FROM table_25751274_2 WHERE rating / SHARE(18 - 49) = 1.3 / 4 |
CREATE TABLE table_name_80 (
round VARCHAR,
winning_driver VARCHAR,
circuit VARCHAR
) | Which round had a winning driver of Uwe Alzen, at the Sepang International circuit? | SELECT round FROM table_name_80 WHERE winning_driver = "uwe alzen" AND circuit = "sepang international circuit" |
CREATE TABLE table_39037 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" real,
"Time" text,
"Jockey" text,
"Winner/2nd" text
) | What group has 1200 m as the distance? | SELECT "Group" FROM table_39037 WHERE "Distance" = '1200 m' |
CREATE TABLE table_31425 (
"Prefix class" text,
"Type and usage" text,
"Example" text,
"Equivalent" text,
"Reference" text
) | What is every prefix class for the equivalent of NTE160? | SELECT "Prefix class" FROM table_31425 WHERE "Equivalent" = 'NTE160' |
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 the number of patients who are diagnosed with presence of cerebrospinal fluid drainage device and the lab test result is abnormal. | 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 = "Presence of cerebrospinal fluid drainage device" AND lab.flag = "abnormal" |
CREATE TABLE table_60115 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue #" text
) | What is the format of catalog number 886973273913 (gowow012) in the United Kingdom? | SELECT "Format" FROM table_60115 WHERE "Country" = 'united kingdom' AND "Catalogue #" = '886973273913 (gowow012)' |
CREATE TABLE table_50390 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | What is the date of the match with arnaud di pasquale as the opponent in the final? | SELECT "Date" FROM table_50390 WHERE "Opponent in the final" = 'arnaud di pasquale' |
CREATE TABLE table_19494 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
) | what's the player with college being penn state | SELECT "Player" FROM table_19494 WHERE "College" = 'Penn State' |
CREATE TABLE table_67887 (
"City" text,
"Province/Region" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | What is the ICAO of Nakashibetsu? | SELECT "ICAO" FROM table_67887 WHERE "City" = 'nakashibetsu' |
CREATE TABLE table_22875 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | state the number of surface where championship is australian open and score in the final is 6 3, 4 6, 11 9 | SELECT COUNT("Surface") FROM table_22875 WHERE "Championship" = 'Australian Open' AND "Score in the final" = '6–3, 4–6, 11–9' |
CREATE TABLE table_1463383_1 (
left_bloc VARCHAR,
social_democratic VARCHAR
) | How many percentages of Left Bloc correspond to a 32.1% Social Democratic? | SELECT COUNT(left_bloc) FROM table_1463383_1 WHERE social_democratic = "32.1%" |
CREATE TABLE ship (
ship_id number,
name text,
type text,
built_year number,
class text,
flag text
)
CREATE TABLE captain (
captain_id number,
name text,
ship_id number,
age text,
class text,
rank text
) | Find the name, type, and flag of the ship that is built in the most recent year. | SELECT name, type, flag FROM ship ORDER BY built_year DESC LIMIT 1 |
CREATE TABLE table_56050 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | On what date was there a competition in which the home team was the Suns? | SELECT "Date" FROM table_56050 WHERE "Home" = 'suns' |
CREATE TABLE table_10696 (
"Party" text,
"1999 Election" real,
"2003 Election" real,
"2007 Election" real,
"May 2010" real,
"2011 Election" real,
"May 2012" real
) | What is the total of the 2003 election but also had 5 in May 2010 and also less than 6 in 1999? | SELECT SUM("2003 Election") FROM table_10696 WHERE "May 2010" = '5' AND "1999 Election" < '6' |
CREATE TABLE table_204_538 (
id number,
"pos." number,
"driver" text,
"co-driver" text,
"car" text,
"time" text
) | who finished sooner , freitas or camacho ? | SELECT "driver" FROM table_204_538 WHERE "driver" IN ('filipe freitas', 'jose camacho') ORDER BY "pos." LIMIT 1 |
CREATE TABLE table_38746 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | What College team has 8 rounds? | SELECT "College/Junior/Club Team (League)" FROM table_38746 WHERE "Round" = '8' |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description... | Question Body length percentile and statistics. | WITH cte AS (SELECT Id, NTILE(100) OVER (ORDER BY LENGTH(Body)) AS percentile FROM Posts WHERE PostTypeId = 1) SELECT cte.percentile, MIN(LENGTH(p.Body)) AS LengthStart, MAX(LENGTH(p.Body)) AS LengthStop, AVG(p.Score) AS avgScore, AVG(p.AnswerCount) AS AvgAnswerCount, AVG(p.ViewCount) AS AvgViewCount, AVG(p.CommentCoun... |
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state varchar(20)
)
CREATE TABLE loan (
loan_ID varchar(3),
loan_type varchar(15),
cust_ID varchar(3),
branch_ID varchar(3)... | Return a bar chart on what are the names of the different bank branches, and what are their total loan amounts?, and rank x axis from low to high order please. | SELECT bname, SUM(amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.bname ORDER BY bname |
CREATE TABLE table_60712 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the total number of bronzes that is less than 1 in total? | SELECT COUNT("Bronze") FROM table_60712 WHERE "Total" < '1' |
CREATE TABLE Student_Addresses (
student_id INTEGER,
address_id INTEGER,
date_address_from DATETIME,
date_address_to DATETIME,
monthly_rental DECIMAL(19,4),
other_details VARCHAR(255)
)
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(120),
line_2 VARCHAR(120),
line_3... | Return a pie chart about the proportion of other_details and the sum of monthly_rental. | SELECT other_details, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC |
CREATE TABLE table_name_31 (
pinnacle_height VARCHAR,
name VARCHAR
) | What is Pinnacle height of chimney of orot rabin? | SELECT pinnacle_height FROM table_name_31 WHERE name = "chimney of orot rabin" |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | what was the name of the drug prescribed during their first hospital visit to patient 30171 two or more times? | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30171 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) GROUP BY prescriptions.drug) A... |
CREATE TABLE table_68389 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | The To par of +14 was won in what year(s)? | SELECT "Year(s) won" FROM table_68389 WHERE "To par" = '+14' |
CREATE TABLE table_71636 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | How many losses did the club with 47 points have ? | SELECT "Lost" FROM table_71636 WHERE "Points" = '47' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | what was the last value of an creatinine lab test in patient 002-41152 the previous month? | SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41152')) AND lab.labname = 'creatinine' AND DATETIME(lab.labresulttime, 'start of m... |
CREATE TABLE table_1666 (
"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 lowest game number when the team is Houston? | SELECT MIN("Game") FROM table_1666 WHERE "Team" = 'Houston' |
CREATE TABLE table_13867 (
"Date" text,
"Season" text,
"Playing for" text,
"Opponent" text,
"Final score" text
) | what is the final score when the opponent is platense? | SELECT "Final score" FROM table_13867 WHERE "Opponent" = 'platense' |
CREATE TABLE table_204_573 (
id number,
"#" number,
"title" text,
"performer(s)" text,
"film" text,
"length" text
) | how many songs are more than four minutes long ? | SELECT COUNT("title") FROM table_204_573 WHERE "length" >= 4 |
CREATE TABLE table_79841 (
"Title" text,
"Album" text,
"Country" text,
"Peak position" real,
"Weeks on chart" real
) | What is the title of the single with the peak position of 10 and weeks on chart is less than 19? | SELECT "Title" FROM table_79841 WHERE "Peak position" = '10' AND "Weeks on chart" < '19' |
CREATE TABLE table_30717 (
"First air date" text,
"Reward" text,
"Immunity" text,
"Eliminated" text,
"Vote" text,
"Finish" text
) | What is the vote number when immunity listed as David and reward is listed as none? | SELECT "Vote" FROM table_30717 WHERE "Immunity" = 'David' AND "Reward" = 'None' |
CREATE TABLE table_278229_1 (
no_of_counties INTEGER,
commandery VARCHAR
) | When yidu is the commandery what is the lowest number of countries? | SELECT MIN(no_of_counties) FROM table_278229_1 WHERE commandery = "Yidu 宜都" |
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 diagnoses (
... | count the number of patients with medicare insurance who underwent opn/oth rep aort vlv-tis. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.short_title = "Opn/oth rep aort vlv-tis" |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | when patient 006-133605 systemicdiastolic first measured during yesterday? | 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 = '006-133605')) AND NOT vitalperiodic.systemicdiastol... |
CREATE TABLE table_27033 (
"\u2116" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | Who wrote the episode with 8.61 million U.S. viewers? | SELECT "Written by" FROM table_27033 WHERE "U.S. viewers (million)" = '8.61' |
CREATE TABLE table_name_69 (
time VARCHAR,
round VARCHAR,
opponent VARCHAR
) | What was the time of round 2 against Taylor Mccorriston? | SELECT time FROM table_name_69 WHERE round = "2" AND opponent = "taylor mccorriston" |
CREATE TABLE table_203_570 (
id number,
"#" number,
"title" text,
"tpb isbn" text,
"tpb release date" text,
"tpb page number" number,
"collected material" text
) | which collection made the top of the list ? | SELECT "title" FROM table_203_570 WHERE id = 1 |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | did patient 025-44495 have any results from the microbiology of the sputum, tracheal specimen this month? | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, tracheal specimen' AND DATETIME(m... |
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 female patients have been suffering from chest pain primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "CHEST PAIN" |
CREATE TABLE table_61343 (
"Name" text,
"Number" real,
"Position" text,
"Height" text,
"Year" text,
"Hometown" text
) | What is Guard Kerri Shields Hometown? | SELECT "Hometown" FROM table_61343 WHERE "Position" = 'guard' AND "Name" = 'kerri shields' |
CREATE TABLE table_name_41 (
score VARCHAR,
game VARCHAR,
record VARCHAR
) | What is the Score of the game earlier than 69 with a record of 4 56? | SELECT score FROM table_name_41 WHERE game < 69 AND record = "4–56" |
CREATE TABLE table_62320 (
"Country" text,
"Builder" text,
"Location" text,
"Ship" text,
"Class / type" text
) | What is Builder, when Country is 'United Kingdom', and when Location is 'Chatham, Kent'? | SELECT "Builder" FROM table_62320 WHERE "Country" = 'united kingdom' AND "Location" = 'chatham, kent' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.