table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | had patient 007-6603 been diagnosed as traumatic injury to major vessels - r carotid artery in 2105? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-6603')) AND diagnosis.diagnosisname = 'traumatic injury to major vessels... |
CREATE TABLE table_69375 (
"Frame size" text,
"Width" real,
"Height" real,
"Mpix" real,
"Aspect Ratio" text,
"max. fps" real,
"max. fps HDRx" real,
"lowest possible REDCODE at 24 fps" text,
"lowest possible REDCODE at max. fps" text
) | What is the aspect ration when the max fps HDRx is 80? | SELECT "Aspect Ratio" FROM table_69375 WHERE "max. fps HDRx" = '80' |
CREATE TABLE table_46575 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the To par of the New Zealand Player? | SELECT "To par" FROM table_46575 WHERE "Country" = 'new zealand' |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | retrieve the top four most ordered drugs for patients also prescribed with cefepime at the same time? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'cefepime') AS t1 JOIN (SELECT admissions.subject_id, prescription... |
CREATE TABLE table_28281704_1 (
stadium VARCHAR,
city VARCHAR
) | Name the stadium for nizhny novgorod | SELECT stadium FROM table_28281704_1 WHERE city = "Nizhny Novgorod" |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistory (
Id number,
... | Users who commented on all theirs posts. | SELECT DisplayName FROM Users WHERE NOT EXISTS(SELECT * FROM Posts WHERE Posts.OwnerUserId = Users.Id AND NOT EXISTS(SELECT * FROM Comments WHERE Comments.PostId = Posts.Id AND Comments.UserId = Users.Id)) |
CREATE TABLE table_name_37 (
s_default_argument VARCHAR,
pseudorandom_number_generation VARCHAR,
eval_function VARCHAR
) | What is the s default argument without a pseudorandom number generation and no eval function? | SELECT s_default_argument FROM table_name_37 WHERE pseudorandom_number_generation = "no" AND eval_function = "no" |
CREATE TABLE table_name_88 (
tournament VARCHAR
) | What 2007 has wimbledon as the tournament? | SELECT 2007 FROM table_name_88 WHERE tournament = "wimbledon" |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | how long is the last hospital stay of patient 9038? | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 9038 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 |
CREATE TABLE table_12661 (
"Club" text,
"League" text,
"Sport" text,
"Established" text,
"Championships" real
) | Which Established has a League of ontario australian football league? | SELECT "Established" FROM table_12661 WHERE "League" = 'ontario australian football league' |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY... | For those employees who did not have any job in the past, find hire_date and the sum of employee_id bin hire_date by time, and visualize them by a bar chart. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
CREATE TABLE table_31710 (
"Outcome" text,
"Date" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | Tell me the total number of date for carpet | SELECT COUNT("Date") FROM table_31710 WHERE "Surface" = 'carpet' |
CREATE TABLE table_49868 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
) | What was the box core for the Melbourne Tigers? | SELECT "Box Score" FROM table_49868 WHERE "Home team" = 'melbourne tigers' |
CREATE TABLE table_204_834 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text
) | how many ranked swimmers were from the united states ? | SELECT COUNT(*) FROM table_204_834 WHERE "nationality" = 'united states' |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what was the last value of patient 12775's magnesium laboratory test since 11 months ago? | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-11 m... |
CREATE TABLE table_44804 (
"Year" real,
"Network" text,
"Play-by-play" text,
"Color commentator(s)" text,
"Pregame host" text
) | What network has a Play-by-play by Jack Edwards in 2000? | SELECT "Network" FROM table_44804 WHERE "Play-by-play" = 'jack edwards' AND "Year" = '2000' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | how many patients since 2101 were prescribed with tylenol during the same hospital encounter after they were diagnosed with hyponatremia? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyponatremia' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2101') AS t... |
CREATE TABLE table_38778 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Highest" real,
"Lowest" real,
"Average" real
) | Average larger than 2,279, and a Team of queen of the south, and a Capacity larger than 6,412 has what lowest of the sum? | SELECT SUM("Lowest") FROM table_38778 WHERE "Average" > '2,279' AND "Team" = 'queen of the south' AND "Capacity" > '6,412' |
CREATE TABLE table_74860 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | How many top 10s associated with 3 top 5s and under 22 cuts made? | SELECT MAX("Top-10") FROM table_74860 WHERE "Top-5" = '3' AND "Cuts made" < '22' |
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,
... | how many patients aged below 56 years were admitted to the hospital before year 2176? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "56" AND demographic.admityear < "2176" |
CREATE TABLE table_70232 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Which engine has a Chassis of lotus 44 f2? | SELECT "Engine" FROM table_70232 WHERE "Chassis" = 'lotus 44 f2' |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_i... | what were hospital admission times of patient 85169 in 2102? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 85169 AND STRFTIME('%y', admissions.admittime) = '2102' |
CREATE TABLE table_18578 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What district is eugene worley from? | SELECT "District" FROM table_18578 WHERE "Incumbent" = 'Eugene Worley' |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight i... | display all flights from SAN FRANCISCO to BOSTON on 8 8 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 8 AND date_day.month_number = 8 AND dat... |
CREATE TABLE table_7525 (
"Event" text,
"2006\u201307" text,
"2007\u201308" text,
"2008\u201309" text,
"2010\u201311" text
) | what kind of 2006 07 has a 2010 11 of n/a, and an Event of masters? | SELECT "2006\u201307" FROM table_7525 WHERE "2010\u201311" = 'n/a' AND "Event" = 'masters' |
CREATE TABLE table_31260 (
"Name" text,
"Number" real,
"Position" text,
"Height" text,
"Weight" real,
"Year" text,
"Hometown" text,
"Last School/College" text
) | what is the school for chris mcnamara? | SELECT "Last School/College" FROM table_31260 WHERE "Name" = 'Chris McNamara' |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid n... | calculate the number of times patient 14836 had a chest tube #1 since 506 days ago. | SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14836)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tube #1' AND... |
CREATE TABLE table_name_59 (
score_in_final VARCHAR,
date VARCHAR
) | What was the Score in Final on February 19, 1989? | SELECT score_in_final FROM table_name_59 WHERE date = "february 19, 1989" |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Na... | Top 20 Tags for downvotes I have. | SELECT TagName, COUNT(*) AS DownVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 3 WHERE Posts.OwnerUserId = @UserId GROUP BY TagName ORDER BY DownVotes DESC |
CREATE TABLE table_name_7 (
player VARCHAR,
position VARCHAR
) | Which player was the forward? | SELECT player FROM table_name_7 WHERE position = "forward" |
CREATE TABLE table_16864 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | Which player played the years for Jazz in 1995-2000, 2004-05 | SELECT "Player" FROM table_16864 WHERE "Years for Jazz" = '1995-2000, 2004-05' |
CREATE TABLE Ref_Characteristic_Types (
characteristic_type_code VARCHAR(15),
characteristic_type_description VARCHAR(80)
)
CREATE TABLE Ref_Product_Categories (
product_category_code VARCHAR(15),
product_category_description VARCHAR(80),
unit_of_measure VARCHAR(20)
)
CREATE TABLE Characteristics ... | What are the descriptions of the categories that products with product descriptions that contain the letter t are in, and count them by a bar chart, could you rank x axis from low to high order? | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description |
CREATE TABLE country (
Country_ID int,
Name text,
Population int,
Area int,
Languages text
)
CREATE TABLE roller_coaster (
Roller_Coaster_ID int,
Name text,
Park text,
Country_ID int,
Length real,
Height real,
Speed text,
Opened text,
Status text
) | Show the names of countries and the average speed of roller coasters from each country by a pie chart. | SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | what were the five most common microbiological tests for patients who received bronchodilator - beta-agonist earlier within 2 months? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'bronchodilator - beta-agonist') AS t1 JOIN (... |
CREATE TABLE table_42231 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the highest rebounds against detroit? | SELECT "High rebounds" FROM table_42231 WHERE "Team" = 'detroit' |
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
)
... | what is icu stay id and drug code of subject id 65652? | SELECT prescriptions.icustay_id, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.subject_id = "65652" |
CREATE TABLE table_203_397 (
id number,
"series" text,
"launch date" text,
"finale date" text,
"days" number,
"housemates" number,
"winner" text,
"main presenter" text,
"grand prize" text,
"liveshow\naudience\nmillions" number
) | which two winners of grande fratello won the most money ? | SELECT "winner" FROM table_203_397 WHERE "grand prize" = (SELECT MAX("grand prize") FROM table_203_397) |
CREATE TABLE table_name_66 (
crowd VARCHAR,
home_team VARCHAR
) | What was the attendance when St Kilda played as the home team? | SELECT COUNT(crowd) FROM table_name_66 WHERE home_team = "st kilda" |
CREATE TABLE table_name_39 (
country VARCHAR,
place VARCHAR
) | What is the Country of the Player in Place 1? | SELECT country FROM table_name_39 WHERE place = "1" |
CREATE TABLE table_50831 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text,
"Source" text
) | what is the transfer fee for evilasio? | SELECT "Transfer fee" FROM table_50831 WHERE "Name" = 'evilasio' |
CREATE TABLE table_name_15 (
tires VARCHAR,
team VARCHAR,
engine VARCHAR,
chassis VARCHAR
) | What tires did BFM Enterprises run on their Offy engine and manta chassis? | SELECT tires FROM table_name_15 WHERE engine = "offy" AND chassis = "manta" AND team = "bfm enterprises" |
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... | what is the number of patients whose admission type is elective and diagnoses short title is b-complex defic nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.short_title = "B-complex defic NEC" |
CREATE TABLE albums (
id number,
title text,
artist_id number
)
CREATE TABLE employees (
id number,
last_name text,
first_name text,
title text,
reports_to number,
birth_date time,
hire_date time,
address text,
city text,
state text,
country text,
postal_code... | How many milliseconds long is Fast As a Shark? | SELECT milliseconds FROM tracks WHERE name = "Fast As a Shark" |
CREATE TABLE table_24107 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Black Knights points" real,
"Opponents" real,
"Record" text
) | Name the opponents for game 5 | SELECT "Opponents" FROM table_24107 WHERE "Game" = '5' |
CREATE TABLE table_32322 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where was the game held when the home team scored 8.18 (66)? | SELECT "Venue" FROM table_32322 WHERE "Home team score" = '8.18 (66)' |
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 demographic (... | how many widowed patients had pericardiocentesis as their procedure long title. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.long_title = "Pericardiocentesis" |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | what's the average total cost of a hospital, including transferrin lab tests until 2102? | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'transferrin')) AND STRFTIME('%y', cost.chargetime) <= '2102' GROUP BY cost.hadm_id) AS t1 |
CREATE TABLE table_203_525 (
id number,
"car" text,
"engine" text,
"compression" text,
"power" text,
"torque" text,
"turbo" text,
"stock boost" text,
"turbine" text,
"compressor" text
) | which engine -lrb- s -rrb- has the least amount of power ? | SELECT "engine" FROM table_203_525 ORDER BY "power" LIMIT 1 |
CREATE TABLE table_65904 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the to par for Jiyai Shin in place t1? | SELECT "To par" FROM table_65904 WHERE "Place" = 't1' AND "Player" = 'jiyai shin' |
CREATE TABLE table_53667 (
"English" text,
"Scots" text,
"West Frisian" text,
"Afrikaans" text,
"Dutch" text,
"Dutch ( Limburgish )" text,
"Low German" text,
"Low German ( Groningen )" text,
"Middle German ( Luxemburgish )" text,
"German" text,
"Yiddish" text,
"Gothic" te... | What is the English word for twie? | SELECT "English" FROM table_53667 WHERE "Dutch ( Limburgish )" = 'twie' |
CREATE TABLE table_name_11 (
weeks_3_4 VARCHAR,
name VARCHAR
) | what week had a player named zach | SELECT weeks_3_4 FROM table_name_11 WHERE name = "zach" |
CREATE TABLE table_27756164_8 (
score VARCHAR,
team VARCHAR
) | What is the score when the team is Orlando? | SELECT COUNT(score) FROM table_27756164_8 WHERE team = "Orlando" |
CREATE TABLE table_name_85 (
name VARCHAR,
pos VARCHAR
) | What is the name when the position was fullback, hooker? | SELECT name FROM table_name_85 WHERE pos = "fullback, hooker" |
CREATE TABLE table_37681 (
"Category" text,
"Type" text,
"Attribute" text,
"Bubbles" text,
"Cancelable" text
) | Let's say Type is of datasetcomplete, what is the Attribute? | SELECT "Attribute" FROM table_37681 WHERE "Type" = 'datasetcomplete' |
CREATE TABLE table_name_69 (
party VARCHAR,
ipsos_6_3_09 VARCHAR
) | Who had an Ipsos of 27%? | SELECT party FROM table_name_69 WHERE ipsos_6_3_09 = "27%" |
CREATE TABLE table_15315816_1 (
dates VARCHAR,
country VARCHAR
) | What are all of the dates in the country of Canada? | SELECT dates FROM table_15315816_1 WHERE country = "Canada" |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | What are the wines that have prices lower than 50 and have appelations in Monterey county, and count them by a bar chart, and order in desc by the y axis. | SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY COUNT(Name) DESC |
CREATE TABLE table_name_59 (
name VARCHAR,
qual_1 VARCHAR
) | What was the Name of the person with a Qual 1 of 1:26.056? | SELECT name FROM table_name_59 WHERE qual_1 = "1:26.056" |
CREATE TABLE table_49137 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What country scored 67? | SELECT "Country" FROM table_49137 WHERE "Score" = '67' |
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 demographic (... | out of total number of patients admitted to trsf within this facility, how many of them had icd9 code 9671? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND procedures.icd9_code = "9671" |
CREATE TABLE table_name_40 (
location VARCHAR,
year VARCHAR
) | Where was the match played in 1998? | SELECT location FROM table_name_40 WHERE year = 1998 |
CREATE TABLE table_20133 (
"City of License /Market" text,
"Station" text,
"Channel TV ( DT )" text,
"Years owned" text,
"Current affiliation" text
) | Who currently affiliates in San Francisco - Oakland - San Jose? | SELECT "Current affiliation" FROM table_20133 WHERE "City of License /Market" = 'San Francisco - Oakland - San Jose' |
CREATE TABLE table_14389782_2 (
quarterback VARCHAR,
winning_pct VARCHAR
) | Who is the quarter back for a winning pct of .792 | SELECT quarterback FROM table_14389782_2 WHERE winning_pct = ".792" |
CREATE TABLE table_name_9 (
date_made VARCHAR,
type VARCHAR
) | What is the date of creation for the locomotive having a type of 0-4-2 | SELECT date_made FROM table_name_9 WHERE type = "0-4-2" |
CREATE TABLE table_204_145 (
id number,
"representative" text,
"state" text,
"district(s)" text,
"served" text,
"party" text,
"date of birth" text,
"date of death" text,
"age" text
) | how long did sala burton serve ? | SELECT "served" - "served" FROM table_204_145 WHERE "representative" = 'sala burton' |
CREATE TABLE table_53493 (
"Pick" real,
"Round" text,
"Player" text,
"Position" text,
"School" text
) | What was the pick number for the kicker in round 8? | SELECT COUNT("Pick") FROM table_53493 WHERE "Round" = 'round 8' AND "Position" = 'kicker' |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId numbe... | Answers with highest score in a given tag. | SELECT a.Id AS "post_link", a.Score, a.OwnerUserId AS "user_link" FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id WHERE (a.PostTypeId = 2) AND (q.PostTypeId = 1) AND (q.Tags LIKE '%<##Tagname##>%') ORDER BY Score DESC LIMIT 200 |
CREATE TABLE wedding (
YEAR VARCHAR
) | How many weddings are there in year 2016? | SELECT COUNT(*) FROM wedding WHERE YEAR = 2016 |
CREATE TABLE table_13714 (
"Year" real,
"MISS EARTH" text,
"Miss Air (1st Runner-up)" text,
"Miss Water (2nd Runner-up)" text,
"Miss Fire (3rd Runner-up)" text
) | Who won Miss Air (1st Runner-up) when Catherine Untalan was Miss Water (2nd Runner-up) earlier than 2007? | SELECT "Miss Air (1st Runner-up)" FROM table_13714 WHERE "Year" < '2007' AND "Miss Water (2nd Runner-up)" = 'catherine untalan' |
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 allergy (
allergy... | tell me the sex of patient 012-2739. | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '012-2739' |
CREATE TABLE table_24354 (
"Type of Record" text,
"Attendance" real,
"Date/Year" text,
"Stadium" text,
"Result/Games" text
) | how many records had result/games: 10 games (29,606 avg.) | SELECT COUNT("Type of Record") FROM table_24354 WHERE "Result/Games" = '10 games (29,606 avg.)' |
CREATE TABLE table_13527 (
"Frequency" text,
"Call sign" text,
"Branding" text,
"Format" text,
"Owner" text,
"Language/Rebroadcast" text
) | what is the format when the frequency is fm 94.5? | SELECT "Format" FROM table_13527 WHERE "Frequency" = 'fm 94.5' |
CREATE TABLE table_66321 (
"Producer" text,
"Product" text,
"Samples taken" real,
"Samples failed" real,
"Melamine content(mg/kg)" real
) | What's the most melamine content that has more than 1 samples failed and produced by Guangzhou Jinding Dairy Products Factory? | SELECT MAX("Melamine content(mg/kg)") FROM table_66321 WHERE "Producer" = 'guangzhou jinding dairy products factory' AND "Samples failed" > '1' |
CREATE TABLE table_name_82 (
position VARCHAR,
pick VARCHAR,
team VARCHAR
) | What is the position of the player with a pick less than 3 from team san diego? | SELECT position FROM table_name_82 WHERE pick < 3 AND team = "san diego" |
CREATE TABLE table_name_78 (
nationality VARCHAR,
year VARCHAR,
player VARCHAR
) | After 2009, what's the nationality of a player named Dwayne de Rosario Category:articles with hcards? | SELECT nationality FROM table_name_78 WHERE year > 2009 AND player = "dwayne de rosario category:articles with hcards" |
CREATE TABLE table_24168 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
) | what is all the broadcast date when viewers were 8.4 millions | SELECT COUNT("Broadcast date") FROM table_24168 WHERE "Viewers (in millions)" = '8.4' |
CREATE TABLE table_1506619_1 (
school_board VARCHAR,
number_of_elementary_schools VARCHAR
) | Where are all school boards associated with a number of elementary schools of 96? | SELECT school_board FROM table_1506619_1 WHERE number_of_elementary_schools = 96 |
CREATE TABLE culture_company (
company_name text,
type text,
incorporated_in text,
group_equity_shareholding number,
book_club_id text,
movie_id text
)
CREATE TABLE book_club (
book_club_id number,
year number,
author_or_editor text,
book_title text,
publisher text,
cate... | What categories have two or more corresponding books that were made after 1989? | SELECT category FROM book_club WHERE year > 1989 GROUP BY category HAVING COUNT(*) >= 2 |
CREATE TABLE table_6424 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
) | What was the Attendance at the Game with a Result of w 21 7? | SELECT AVG("Attendance") FROM table_6424 WHERE "Result" = 'w 21–7' |
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... | Get Response Data for a Given User's Questions. For a given User's ID, this query gets available data on answers, comments, and comments on answers for the User's Questions. | SELECT * FROM Comments LIMIT 10 |
CREATE TABLE table_name_87 (
date VARCHAR,
loan_expires VARCHAR,
position VARCHAR
) | What date has a loan expires date of end of the season, and a Position of mf? | SELECT date FROM table_name_87 WHERE loan_expires = "end of the season" AND position = "mf" |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,... | what was the drug that until 11/2104 patient 88573 had been prescribed two 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 = 88573) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2104-11' GROUP BY prescriptions.drug) AS t1 WHERE t1.c... |
CREATE TABLE table_47720 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
) | Which Away team has a Ground of gabba? | SELECT "Away team" FROM table_47720 WHERE "Ground" = 'gabba' |
CREATE TABLE table_39479 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What was the winning score when Steve Stricker was runner-up? | SELECT "Winning score" FROM table_39479 WHERE "Runner(s)-up" = 'steve stricker' |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Customers_Cards (
card_id INTEGER,
... | Show the number of cards in different card type code in a bar chart. | SELECT card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code |
CREATE TABLE table_203_462 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
) | what year was more successful , 2012 or 2007 ? | SELECT "year" FROM table_203_462 WHERE "year" IN (2012, 2007) ORDER BY "regular season" LIMIT 1 |
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 lab (
subject_id text,
hadm_id text,
... | how many patients whose year of birth is less than 2197 and procedure icd9 code is 309? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2197" AND procedures.icd9_code = "309" |
CREATE TABLE table_1637041_6 (
wins INTEGER,
starts VARCHAR
) | What is the maximum number of wins in the season with 22 starts? | SELECT MAX(wins) FROM table_1637041_6 WHERE starts = 22 |
CREATE TABLE table_19180 (
"Home (1st leg)" text,
"Home (2nd leg)" text,
"1st Leg" text,
"2nd leg" text,
"Aggregate" text
) | How many home (2nd leg) had a 1st leg 1-1? | SELECT COUNT("Home (2nd leg)") FROM table_19180 WHERE "1st Leg" = '1-1' |
CREATE TABLE table_name_86 (
opposing_teams VARCHAR,
against INTEGER
) | What is Opposing Teams, when Against is less than 6? | SELECT opposing_teams FROM table_name_86 WHERE against < 6 |
CREATE TABLE table_204_870 (
id number,
"product" text,
"main functionality" text,
"input format" text,
"output format" text,
"platform" text,
"license and cost" text,
"notes" text
) | what is the next product listed after egonet ? | SELECT "product" FROM table_204_870 WHERE id = (SELECT id FROM table_204_870 WHERE "product" = 'egonet') + 1 |
CREATE TABLE table_name_79 (
australian VARCHAR,
american VARCHAR
) | What is the Australian for the American ? | SELECT australian FROM table_name_79 WHERE american = "ɑ" |
CREATE TABLE table_name_56 (
attendance VARCHAR,
date VARCHAR,
kickoff_time VARCHAR,
week VARCHAR
) | How many people attended the game with a kickoff time of cbs 1:00pm, in a week earlier than 8, on September 15, 2002? | SELECT attendance FROM table_name_56 WHERE kickoff_time = "cbs 1:00pm" AND week < 8 AND date = "september 15, 2002" |
CREATE TABLE results (
resultId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
grid INTEGER,
position TEXT,
positionText TEXT,
positionOrder INTEGER,
points REAL,
laps TEXT,
time TEXT,
milliseconds TEXT,
fastestLap TEXT,
rank... | What are the names of all the Japanese constructors that have earned more than 5 points, and count them by a bar chart, and could you show how many name in desc order please? | SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY COUNT(name) DESC |
CREATE TABLE table_name_87 (
pre_race_host VARCHAR,
lap_by_lap VARCHAR,
year VARCHAR
) | Who was the Pre-Race Host when Mike Joy was the Lap-by-lap in the Year 2005? | SELECT pre_race_host FROM table_name_87 WHERE lap_by_lap = "mike joy" AND year = 2005 |
CREATE TABLE staff (
staff_id number,
staff_gender text,
staff_name text
)
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order_status_code text,
order_date time
)
CREATE TABLE product_suppliers (
product_id number,
supplier_id number,
date_supplied_from ti... | Give the product id for the product that was ordered most frequently. | SELECT product_id FROM order_items GROUP BY product_id ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_51127 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | Which Position has a Lost larger than 4, and a Played larger than 14? | SELECT AVG("Position") FROM table_51127 WHERE "Lost" > '4' AND "Played" > '14' |
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
)
... | how many patients whose language is span and religion is greek orthodox? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.religion = "GREEK ORTHODOX" |
CREATE TABLE table_9717 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the lowest Laps, when Rider is Sylvain Guintoli, and when Grid is less than 16? | SELECT MIN("Laps") FROM table_9717 WHERE "Rider" = 'sylvain guintoli' AND "Grid" < '16' |
CREATE TABLE table_35045 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | What score has nashville predators as the opponent? | SELECT "Score" FROM table_35045 WHERE "Opponent" = 'nashville predators' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.