table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_75991 (
"Source" text,
"Date" text,
"Goberman" text,
"Loera" text,
"Merkley" text,
"Neville" text,
"Novick" text,
"Obrist" text,
"Other/ Undecided" text
) | Which Neville has a Novick of 23%? | SELECT "Neville" FROM table_75991 WHERE "Novick" = '23%' |
CREATE TABLE table_74820 (
"Rank" real,
"Name" text,
"Location" text,
"Height Metres / feet" text,
"Floors" text
) | Which Floors have a Location of ljubljana, and a Name of tr3? | SELECT "Floors" FROM table_74820 WHERE "Location" = 'ljubljana' AND "Name" = 'tr3' |
CREATE TABLE table_name_38 (
school_club_team VARCHAR,
round VARCHAR,
overall VARCHAR
) | What school/club team did the player who was drafted after round 13 with an overall rank of 384 play for? | SELECT school_club_team FROM table_name_38 WHERE round > 13 AND overall = 384 |
CREATE TABLE table_203_471 (
id number,
"#" number,
"date" text,
"opponent" text,
"score" text,
"site/stadium" text,
"win" text,
"loss" text,
"save" text,
"attendance" number,
"overall record" text,
"ncaat record" text
) | which opponent had the highest attendance after north carolina on june 21 ? | SELECT "opponent" FROM table_203_471 WHERE "date" > (SELECT "date" FROM table_203_471 WHERE "date" = 'june 21') ORDER BY "attendance" DESC LIMIT 1 |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what is the drug that was prescribed to patient 025-57841 in the same hospital visit after receiving head ct scan until 22 months ago? | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... |
CREATE TABLE table_48153 (
"!Simple Present/Future" text,
"Probable Future" text,
"Simple Past" text,
"Past Habitual" text,
"Injunctive" text,
"Imperative" text
) | What is the injunctive for the Simple Past of gar l 'I will (probably) do'? | SELECT "Injunctive" FROM table_48153 WHERE "Simple Past" = 'गरुँला garũlā ''i will (probably) do' |
CREATE TABLE table_72123 (
"Region" text,
"Operator" text,
"Licence award date" text,
"On air date" text,
"Closure date" text
) | What is the license award date for North East England? | SELECT "Licence award date" FROM table_72123 WHERE "Region" = 'North East England' |
CREATE TABLE table_250230_2 (
gearbox VARCHAR
) | What is the gearbox when the torque is torque? | SELECT gearbox FROM table_250230_2 WHERE "torque" = "torque" |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
... | How many active users are there?. | SELECT COUNT(*) FROM Users WHERE LastAccessDate >= DATEADD(dd, -30, GETDATE()) |
CREATE TABLE table_19789597_6 (
game INTEGER,
high_assists VARCHAR
) | What's the lowest number of a game where S. Johnson (3) did the most high assists? | SELECT MIN(game) FROM table_19789597_6 WHERE high_assists = "S. Johnson (3)" |
CREATE TABLE table_name_94 (
competition_description VARCHAR,
rank_qualifying VARCHAR,
apparatus VARCHAR
) | What competition had a Rank-Qualifying of 1st and a ball apparatus? | SELECT competition_description FROM table_name_94 WHERE rank_qualifying = "1st" AND apparatus = "ball" |
CREATE TABLE table_73097 (
"District" text,
"Location" text,
"Representative" text,
"Cook PVI" text,
"2012 election results" text,
"Median household income (2011)" text
) | What is the location that has the 12th district? | SELECT "Location" FROM table_73097 WHERE "District" = '12th' |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varcha... | For those employees who did not have any job in the past, show me about the distribution of hire_date and the average of manager_id bin hire_date by time in a bar chart, list by the Y-axis in asc. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) |
CREATE TABLE table_name_42 (
winning_team VARCHAR,
site VARCHAR,
date VARCHAR
) | Which winning team has Iowa city as the site, and december 3, 2006 as the date? | SELECT winning_team FROM table_name_42 WHERE site = "iowa city" AND date = "december 3, 2006" |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | give me the number of patients whose age is less than 70? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "70" |
CREATE TABLE table_80378 (
"Rank" text,
"Goals" text,
"Player" text,
"Club/Clubs" text,
"Career" text
) | Which player has 1299 goals? | SELECT "Player" FROM table_80378 WHERE "Goals" = '1299' |
CREATE TABLE table_2402209_1 (
no_of_barangays VARCHAR,
population__2010_ VARCHAR
) | How many different counts of tue number of Barangays are there for the municipality with 13824 citizens in 2010? | SELECT COUNT(no_of_barangays) FROM table_2402209_1 WHERE population__2010_ = 13824 |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDis... | Number of questions asked in an average day about Django. | SELECT DATEPART(hour, Posts.CreationDate) AS "daytime", COUNT(Posts.Id) AS "numanswers" FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId WHERE PostTags.TagId = 243 AND Posts.PostTypeId = 1 AND Posts.CreationDate > DATEADD(year, -1, GETDATE()) GROUP BY DATEPART(hour, Posts.CreationDate) |
CREATE TABLE table_38523 (
"Round" text,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | Who has a nationality of Czech Republic and a position of right wing? | SELECT "Player" FROM table_38523 WHERE "Position" = 'right wing' AND "Nationality" = 'czech republic' |
CREATE TABLE table_name_23 (
grand_prix VARCHAR,
pole_position VARCHAR
) | Name the Grand Prix for pole position of kimi r ikk nen | SELECT grand_prix FROM table_name_23 WHERE pole_position = "kimi räikkönen" |
CREATE TABLE table_40967 (
"Average population (x 1000)" real,
"Live births" real,
"Deaths" real,
"Natural change" real,
"Crude birth rate (per 1000)" real,
"Crude death rate (per 1000)" real,
"Natural change (per 1000)" real
) | What is the lowest Natural Change, when Natural Change (Per 1000) is 19.1, and when Crude Birth Rate (Per 1000) is less than 28.3? | SELECT MIN("Natural change") FROM table_40967 WHERE "Natural change (per 1000)" = '19.1' AND "Crude birth rate (per 1000)" < '28.3' |
CREATE TABLE table_75628 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | What is the average number of field goals scored by a right halfback who had more than 3 touchdowns? | SELECT AVG("Field goals") FROM table_75628 WHERE "Position" = 'right halfback' AND "Touchdowns" > '3' |
CREATE TABLE table_79152 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | How many strokes off par was the winner in 1978? | SELECT "To par" FROM table_79152 WHERE "Year(s) won" = '1978' |
CREATE TABLE table_16604 (
"Date" text,
"Founder" text,
"Extroversion Scales" text,
"People-task orientation scale" text,
"Introverted, Task-Oriented" text,
"Extroverted, Task-Oriented" text,
"Extroverted, Relationship-Oriented" text,
"Introverted, Relationship Oriented" text,
"Moder... | what's the extroverted, relationship-oriented where moderate is introverted sanguine | SELECT "Extroverted, Relationship-Oriented" FROM table_16604 WHERE "Moderate" = 'Introverted Sanguine' |
CREATE TABLE table_29997112_3 (
international_use VARCHAR,
flag_name VARCHAR
) | What is the international use of the 1 flag? | SELECT international_use FROM table_29997112_3 WHERE flag_name = "1 единица" |
CREATE TABLE table_5368 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" real,
"Time" text,
"Location" text
) | Who is the opponent of the submission (triangle choke) method of submission? | SELECT "Opponent" FROM table_5368 WHERE "Method" = 'submission (triangle choke)' |
CREATE TABLE member (
Member_ID text,
Name text,
Nationality text,
Role text
)
CREATE TABLE performance (
Performance_ID real,
Date text,
Host text,
Location text,
Attendance int
)
CREATE TABLE member_attendance (
Member_ID int,
Performance_ID int,
Num_of_Pieces int
) | Show different locations and the number of performances at each location Visualize by bar chart, I want to display from low to high by the x-axis. | SELECT Location, COUNT(*) FROM performance GROUP BY Location ORDER BY Location |
CREATE TABLE table_70539 (
"Frame size" text,
"Width" real,
"Height" real,
"Mpix" real,
"Aspect Ratio" text,
"Maximum fps" real,
"Maximum fps HDRx" real,
"least compression at 24 fps" text,
"least compression at maximum fps" text
) | What is the maximum fps HDRx with a height larger than 1080 with a compression at 24 fps of 6:1 with a compression at maximum fps of at least 7:1? | SELECT "Maximum fps HDRx" FROM table_70539 WHERE "Height" > '1080' AND "least compression at 24 fps" = '6:1' AND "least compression at maximum fps" = '7:1' |
CREATE TABLE table_59642 (
"Team" text,
"Driver" text,
"Class" text,
"Chassis" text,
"Engine" text,
"Rounds" text
) | What c class engine did philipp eng and team hs technik motorsport use? | SELECT "Engine" FROM table_59642 WHERE "Class" = 'c' AND "Team" = 'hs technik motorsport' AND "Driver" = 'philipp eng' |
CREATE TABLE table_name_10 (
week_12 VARCHAR,
week_9 VARCHAR
) | Who was the week 12 nomination when the week 9 nomination walked (day 11)? | SELECT week_12 FROM table_name_10 WHERE week_9 = "walked (day 11)" |
CREATE TABLE table_78220 (
"Stellar mass ( M\u2609 )" real,
"Planetary mass ( M\u2295 )" real,
"Lum. (L 0 )" text,
"Type" text,
"RHAB ( AU )" real,
"RV (cm/s)" real,
"Period (days)" real
) | What is the highest planetary mass having an RV (cm/s) of 65 and a Period (days) less than 21? | SELECT MAX("Planetary mass ( M\u2295 )") FROM table_78220 WHERE "RV (cm/s)" = '65' AND "Period (days)" < '21' |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Bar graph to show mean school id from different all home, sort y-axis in desc order. | SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(School_ID) DESC |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal bool... | My Posts By Post Length. All of my posts sorted by Body length | SELECT Id, Id AS "post_link", LENGTH(Body) AS "post_length", Score FROM Posts WHERE OwnerUserId = '##UserId##' ORDER BY 'post_length' DESC |
CREATE TABLE table_name_37 (
record VARCHAR,
date VARCHAR
) | What is the record for January 19? | SELECT record FROM table_name_37 WHERE date = "january 19" |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is date of birth and item id of subject name jerry deberry? | SELECT demographic.dob, lab.itemid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry" |
CREATE TABLE table_name_94 (
score VARCHAR,
competition VARCHAR,
result VARCHAR
) | What is the score of the event with a competition type of friendly and a result of 4-5? | SELECT score FROM table_name_94 WHERE competition = "friendly" AND result = "4-5" |
CREATE TABLE table_52820 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many people in total have attended games where carlton played as away? | SELECT COUNT("Crowd") FROM table_52820 WHERE "Away team" = 'carlton' |
CREATE TABLE round (
round_id number,
member_id number,
decoration_theme text,
rank_in_round number
)
CREATE TABLE member (
member_id number,
name text,
country text,
college_id number
)
CREATE TABLE college (
college_id number,
name text,
leader_name text,
college_loca... | Show the names of members and the decoration themes they have. | SELECT T1.name, T2.decoration_theme FROM member AS T1 JOIN round AS T2 ON T1.member_id = T2.member_id |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE m... | what was the five most frequent specimen tests that patients had within 2 months after they had been diagnosed with hyperglycemia - suspected since 3 years ago? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperglycemia - suspected' AND DATETIME(diag... |
CREATE TABLE table_12310814_1 (
song_choice VARCHAR,
original_artist VARCHAR
) | Which one of the songs was originally performed by Rickie Lee Jones? | SELECT song_choice FROM table_12310814_1 WHERE original_artist = "Rickie Lee Jones" |
CREATE TABLE table_11614581_3 (
area VARCHAR,
_in_thousands_of_km_2 VARCHAR,
name_in_russian VARCHAR
) | governs an area with what area (in thousand km 2)? | SELECT area, _in_thousands_of_km_2 FROM table_11614581_3 WHERE name_in_russian = "Плоцкая губерния" |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | the last year, when did patient 53089 go to the hospital for the first time? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 53089 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime LIMIT 1 |
CREATE TABLE table_2453243_3 (
production_code INTEGER,
no_in_season VARCHAR
) | What is the production code for episode 3 in the season? | SELECT MAX(production_code) FROM table_2453243_3 WHERE no_in_season = 3 |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | what was the total amount of i.v. that patient 035-17122 had received until 1621 days ago? | 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 = '035-17122')) AND intakeoutput.celllabel = 'i.v.'... |
CREATE TABLE pilot (
Name VARCHAR,
Age VARCHAR
) | List names of all pilot in descending order of age. | SELECT Name FROM pilot ORDER BY Age DESC |
CREATE TABLE table_28184 (
"Country" text,
"Name of bullion coin" text,
"Fineness" text,
"Denominations (Gold weight)" text,
"Years of mintage" text
) | What are all the denominations for China? | SELECT "Denominations (Gold weight)" FROM table_28184 WHERE "Country" = 'China' |
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,
... | give the number of patients whose procedure short title is cardiac rhythm conv nec. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Cardiac rhythm conv NEC" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | what was the daily minimum amount of saline flush (ml) in patient 002-41152's body the last month? | SELECT MIN(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 = '002-41152')) AND intakeoutput.celllabel = 'salin... |
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 inputevents_cv (
row_id number,
subject_id number,
... | what is the new prescription of patient 8116 today vs. the one yesterday? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE ... |
CREATE TABLE table_1641054_2 (
established INTEGER
) | Name the least established | SELECT MIN(established) FROM table_1641054_2 |
CREATE TABLE table_name_25 (
score VARCHAR,
opponent VARCHAR,
record VARCHAR
) | What was the score of the game against the Braves with a record of 41 27? | SELECT score FROM table_name_25 WHERE opponent = "braves" AND record = "41–27" |
CREATE TABLE table_75949 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
) | What is the biggest points when the grid is less than 13 and the time/retired is +7.538 secs? | SELECT MAX("Points") FROM table_75949 WHERE "Grid" < '13' AND "Time/Retired" = '+7.538 secs' |
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptroller text,
attorney_general text,
us_senate text
)
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE el... | Show the name of the party that has at least two records. | SELECT party FROM party GROUP BY party HAVING COUNT(*) >= 2 |
CREATE TABLE catalog_contents_additional_attributes (
catalog_entry_id number,
catalog_level_number number,
attribute_id number,
attribute_value text
)
CREATE TABLE catalog_structure (
catalog_level_number number,
catalog_id number,
catalog_level_name text
)
CREATE TABLE attribute_definiti... | Find the names of the products with length smaller than 3 or height greater than 5. | SELECT catalog_entry_name FROM catalog_contents WHERE length < 3 OR width > 5 |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is days of hospital stay and death status of subject name paul dunn? | SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.name = "Paul Dunn" |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
... | For the Other requirement which courses in Biomechanics for Engineering Students are satisfactory ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Biomechanics for Engineering Students%' OR course.description LIKE '%Biomechanics for Engineerin... |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | Show me the total number by country in a histogram | SELECT Country, COUNT(*) FROM stadium GROUP BY Country |
CREATE TABLE table_25777 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is every score for location attendance of Madison Square Garden 19,763 and game less than 80.0? | SELECT "Score" FROM table_25777 WHERE "Location Attendance" = 'Madison Square Garden 19,763' AND "Game" < '80.0' |
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 demographic ... | how many patients had the procedure called combined right and left heart angiocardiography? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Combined right and left heart angiocardiography" |
CREATE TABLE table_44352 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | For the year won of 2001, what is the To Par? | SELECT "To par" FROM table_44352 WHERE "Year(s) won" = '2001' |
CREATE TABLE table_48229 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Can you tell me the High assists that has the Date of november 25? | SELECT "High assists" FROM table_48229 WHERE "Date" = 'november 25' |
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
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 ... | Please compare the credit score of the customers who have some loans by a bar chart. | SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID |
CREATE TABLE table_18967 (
"Election date" real,
"Party leader" text,
"Number of votes received" real,
"Percentage of votes" text,
"Number of deputies" real
) | what's the number of deputies with number of votes received being smaller than 1549176.2765483726 and election date being 1969 | SELECT "Number of deputies" FROM table_18967 WHERE "Number of votes received" < '1549176.2765483726' AND "Election date" = '1969' |
CREATE TABLE table_name_10 (
team VARCHAR,
location_attendance VARCHAR,
score VARCHAR
) | Which team was the opponent that had a location of Madison Square Garden with a score of 87-83? | SELECT team FROM table_name_10 WHERE location_attendance = "madison square garden" AND score = "87-83" |
CREATE TABLE table_23803 (
"BSE Code" text,
"Company" text,
"City" text,
"GICS Sector" text,
"Free float" text,
"Index weighting (%" text
) | Which companies have a free float of 0.2726? | SELECT "Company" FROM table_23803 WHERE "Free float" = '0.2726' |
CREATE TABLE table_19230 (
"Country/Territory" text,
"Former pageant" text,
"Last competed" real,
"New pageant" text,
"Franchise since" real
) | which is the new pageant from spain? | SELECT "New pageant" FROM table_19230 WHERE "Country/Territory" = 'Spain' |
CREATE TABLE table_57449 (
"Name" text,
"Bodyweight" real,
"Snatch" real,
"Clean & jerk" real,
"Total (kg)" text
) | what is the average bodyweight when snatch is 80? | SELECT AVG("Bodyweight") FROM table_57449 WHERE "Snatch" = '80' |
CREATE TABLE table_name_64 (
pali VARCHAR,
tibetan VARCHAR
) | What is the pali word for phrag dog in tibetan? | SELECT pali FROM table_name_64 WHERE tibetan = "phrag dog" |
CREATE TABLE table_name_68 (
attendance VARCHAR,
venue VARCHAR
) | What is the number in attendance at Los Angeles Memorial Coliseum? | SELECT COUNT(attendance) FROM table_name_68 WHERE venue = "los angeles memorial coliseum" |
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
) | What are the names and the accumulated prices of all products in the store Plot them as a bar chart, I want to order by the Y in asc please. | SELECT Name, SUM(Price) FROM Products GROUP BY Name ORDER BY SUM(Price) |
CREATE TABLE table_19777 (
"Administrative division" text,
"Area (km\u00b2)" text,
"Population 2000 Census" real,
"Population (2010 Census)" real,
"Population density 2010 (/km\u00b2)" real
) | Name the number of area where population density 2010 for 514 | SELECT COUNT("Area (km\u00b2)") FROM table_19777 WHERE "Population density 2010 (/km\u00b2)" = '514' |
CREATE TABLE table_204_353 (
id number,
"no." number,
"date/time" text,
"aircraft" text,
"foe" text,
"result" text,
"location" text,
"notes" text
) | are there any other aircraft listed besides the nieuport 17 ? | SELECT "aircraft" FROM table_204_353 WHERE "aircraft" <> 'nieuport 17' |
CREATE TABLE table_name_76 (
reserved_for___sc___st__none_ VARCHAR,
constituency_number VARCHAR
) | What is the reserved for value for constituency number 132? | SELECT reserved_for___sc___st__none_ FROM table_name_76 WHERE constituency_number = "132" |
CREATE TABLE table_name_97 (
goals_against INTEGER,
lost INTEGER
) | What is the fewest goals against for teams with more than 27 losses? | SELECT MIN(goals_against) FROM table_name_97 WHERE lost > 27 |
CREATE TABLE table_203_46 (
id number,
"country" text,
"url" text,
"opening date" text,
"closing date" text
) | which country had the earliest opening date ? | SELECT "country" FROM table_203_46 ORDER BY "opening date" LIMIT 1 |
CREATE TABLE table_name_30 (
theme VARCHAR,
result VARCHAR,
week VARCHAR
) | What was the theme for Vegas Verdicts week with a result of Advanced? | SELECT theme FROM table_name_30 WHERE result = "advanced" AND week = "vegas verdicts" |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime tim... | when did patient 73075 have the maximum value of creatinine for the first time in 12/last year? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73075) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURR... |
CREATE TABLE table_40215 (
"Administrative Panel" real,
"Agricultural Panel" real,
"Cultural and Educational Panel" real,
"Industrial and Commercial Panel" real,
"Labour Panel" real,
"National University of Ireland" real,
"University of Dublin" real,
"Nominated by the Taoiseach" real,
... | Which Cultural and Educational Panel has a Labour Panel larger than 5, and an Industrial and Commercial Panel larger than 9? | SELECT COUNT("Cultural and Educational Panel") FROM table_40215 WHERE "Labour Panel" > '5' AND "Industrial and Commercial Panel" > '9' |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | how many hours have elapsed since patient 007-15837 was admitted to the icu currently? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '007-15837' AND patient.unitdischargetime IS NULL |
CREATE TABLE table_name_81 (
age_at_time_of_disaster VARCHAR,
date_of_birth VARCHAR
) | How old was the person born 24 September 1851 at the time of disaster? | SELECT age_at_time_of_disaster FROM table_name_81 WHERE date_of_birth = "24 september 1851" |
CREATE TABLE table_203_345 (
id number,
"name" text,
"party" text,
"took office" number,
"left office" number
) | which progressive party member took office after a liberal ? | SELECT "name" FROM table_203_345 WHERE "party" = 'progressive' AND id = (SELECT id FROM table_203_345 WHERE "party" = 'liberal') + 1 |
CREATE TABLE table_27994983_8 (
viewers INTEGER,
draw VARCHAR
) | How many viewers are the when the draw is 3? | SELECT MAX(viewers) FROM table_27994983_8 WHERE draw = 3 |
CREATE TABLE table_name_16 (
top_25 INTEGER,
top_10 VARCHAR,
events VARCHAR,
wins VARCHAR
) | What was the larger number of players that played in 4 events that 2 wins but were less than 6 in the top 10? | SELECT MAX(top_25) FROM table_name_16 WHERE events > 4 AND wins = 2 AND top_10 < 6 |
CREATE TABLE table_30294 (
"Vessel" text,
"Built" real,
"Max Speed" text,
"Length" text,
"Breadth" text,
"Flag" text,
"Propulsion" text
) | How many breadth entries are there when the vessel is marianarray? | SELECT COUNT("Breadth") FROM table_30294 WHERE "Vessel" = 'Marianarray' |
CREATE TABLE table_2562572_11 (
settlement VARCHAR,
cyrillic_name_other_names VARCHAR
) | How to you write with the latin alphabet? | SELECT settlement FROM table_2562572_11 WHERE cyrillic_name_other_names = "Плавна" |
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 CO... | Return a bar chart on how many departments are in each school?, I want to show from high to low by the X. | SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_NAME) FROM DEPARTMENT ORDER BY SCHOOL_CODE DESC |
CREATE TABLE table_203_469 (
id number,
"year" text,
"round" text,
"position" number,
"matches" number,
"wins" number,
"draws" number,
"losses" number,
"gf" number,
"ga" number
) | which year had a lower amount of losses , 1998 or 2006 ? | SELECT "year" FROM table_203_469 WHERE "year" IN (1998, 2006) ORDER BY "losses" LIMIT 1 |
CREATE TABLE table_name_3 (
win__percentage VARCHAR
) | What is the winning % for the 2010 QF? | SELECT win__percentage FROM table_name_3 WHERE 2010 = "qf" |
CREATE TABLE table_61558 (
"Draw" real,
"Artist" text,
"Song" text,
"Results" text,
"Place" text
) | What song has a draw more than 4 in 1st place? | SELECT "Song" FROM table_61558 WHERE "Draw" > '4' AND "Place" = '1st' |
CREATE TABLE table_16034882_3 (
draws INTEGER,
club VARCHAR
) | what is the highest number of draws for sveikata kybartai | SELECT MAX(draws) FROM table_16034882_3 WHERE club = "Sveikata Kybartai" |
CREATE TABLE table_name_18 (
erp_w VARCHAR,
frequency_mhz VARCHAR
) | What is the ERP W for the frequency of 91.3MHz? | SELECT erp_w FROM table_name_18 WHERE frequency_mhz = 91.3 |
CREATE TABLE table_25878 (
"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 most points in the game where the score was w 97 92 (ot)? | SELECT "High points" FROM table_25878 WHERE "Score" = 'W 97–92 (OT)' |
CREATE TABLE table_name_88 (
driver VARCHAR,
team VARCHAR
) | What is Driver, when Team is 'Romano Racing'? | SELECT driver FROM table_name_88 WHERE team = "romano racing" |
CREATE TABLE table_name_37 (
district VARCHAR,
incumbent VARCHAR
) | What is the district of the incumbent Thomas Larkin Thompson? | SELECT district FROM table_name_37 WHERE incumbent = "thomas larkin thompson" |
CREATE TABLE table_10040 (
"Name" text,
"Country" text,
"Transfer window" text,
"Transfer fee" text,
"Apps" real,
"Goals" real
) | how many times is the transfer fee 2,500,000? | SELECT COUNT("Goals") FROM table_10040 WHERE "Transfer fee" = '£2,500,000' |
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,
... | what is admission time and discharge time of subject id 53707? | SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.subject_id = "53707" |
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
)
... | report the icu stay id of patient with patient id 18112. | SELECT prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "18112" |
CREATE TABLE table_name_99 (
rank_by_average INTEGER,
average VARCHAR,
total VARCHAR
) | What was the lowest rank by average of a couple who had an average of 23 and a total of 115? | SELECT MIN(rank_by_average) FROM table_name_99 WHERE average = 23 AND total = 115 |
CREATE TABLE table_204_730 (
id number,
"date" text,
"place" text,
"disc." text,
"winner" text,
"second" text,
"third" text
) | which skier earned first place on 15 march 2006 in the 2006 alpine skiing world cup ? | SELECT "winner" FROM table_204_730 WHERE "date" = '15 march 2006' |
CREATE TABLE table_name_5 (
tournament VARCHAR,
opponent VARCHAR
) | In what tournament did Cipolla face Sergio Roitman? | SELECT tournament FROM table_name_5 WHERE opponent = "sergio roitman" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.