table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_94 (
team VARCHAR,
pick VARCHAR
) | What team picked 80? | SELECT team FROM table_name_94 WHERE pick = 80 |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,... | what are the three most frequent drugs that were prescribed to female patients of the 50s within 2 months after having been diagnosed with drug-induced delirium? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... |
CREATE TABLE table_73969 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Patient Portrayer" text,
"Original air date" text,
"Production code" real
) | Who directed the episode with production code 177605? | SELECT "Directed by" FROM table_73969 WHERE "Production code" = '177605' |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password... | How many enrolment students in each month? Return a bar chart binning date of enrolment by month interval, and I want to order in asc by the y-axis. | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) |
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... | how much does norepinephrine 4 mg/250 ml ns cost to take? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'norepinephrine 4 mg/250 ml ns') |
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 me the number of patients whose primary disease is liver transplant and days of hospital stay is greater than 8? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.days_stay > "8" |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId numb... | R/A Flags Before and After HNQ. | SELECT COUNT(*) FROM Votes WHERE VoteTypeId = 4 AND CreationDate > '2018-10-18 00:00:00.000' |
CREATE TABLE table_68002 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What was the margin of victory for the Mississippi Gulf Resort Classic? | SELECT "Margin of victory" FROM table_68002 WHERE "Tournament" = 'mississippi gulf resort classic' |
CREATE TABLE table_204_741 (
id number,
"rank" number,
"name" text,
"nationality" text,
"1,62" text,
"1,67" text,
"1,72" text,
"1,75" text,
"notes" text
) | who was the last ranked competitor in group a ? | SELECT "name" FROM table_204_741 ORDER BY "rank" DESC LIMIT 1 |
CREATE TABLE table_38401 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | How many events resulted in a top-25 less than 2? | SELECT COUNT("Events") FROM table_38401 WHERE "Top-25" < '2' |
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats text
)
CREATE TABLE genre (
g_name text,
rating text,
most_popular_in text
)
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id number,
genre_is text,
... | What are the names of all genres in alphabetical order, combined with its ratings? | SELECT g_name, rating FROM genre ORDER BY g_name |
CREATE TABLE table_57940 (
"Year" text,
"Driver" text,
"Constructor" text,
"Category" text,
"Location" text,
"Report" text
) | What is the name of the driver in 1955? | SELECT "Driver" FROM table_57940 WHERE "Year" = '1955' |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | until 09/2103 has patient 3118 had any drain out #1 jackson pratt output? | SELECT COUNT(*) > 0 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 = 3118)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'drain out #1 ja... |
CREATE TABLE table_204_465 (
id number,
"#" number,
"temple name" text,
"hangul" text,
"hanja" text,
"period of reign" text,
"personal name" text,
"relationship" text,
"note" text
) | what was the last baekje temple ? | SELECT "temple name" FROM table_204_465 ORDER BY "period of reign" DESC LIMIT 1 |
CREATE TABLE table_23685152_2 (
record VARCHAR,
opponent VARCHAR
) | What was the record in the game against Eskimos? | SELECT record FROM table_23685152_2 WHERE opponent = "Eskimos" |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requi... | What courses I am required to take before MUSED 370 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... |
CREATE TABLE table_name_42 (
date VARCHAR,
opponent_number VARCHAR
) | what is the date when the opponent# is iowa? | SELECT date FROM table_name_42 WHERE opponent_number = "iowa" |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIG... | Return a bar chart on how many hours do the students spend studying in each department?, could you sort in descending by the sum stu hrs please? | SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE ORDER BY SUM(STU_HRS) DESC |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | Show id from each meter 400, and sort y-axis in ascending order. | SELECT meter_400, ID FROM swimmer ORDER BY ID |
CREATE TABLE table_1745843_8 (
class VARCHAR,
part_4 VARCHAR
) | What class in the word with part 4 'giheizan'? | SELECT class FROM table_1745843_8 WHERE part_4 = "giheizan" |
CREATE TABLE table_name_67 (
score VARCHAR,
opponent VARCHAR
) | What was the score with the opponent being New Zealand Warriors? | SELECT score FROM table_name_67 WHERE opponent = "new zealand warriors" |
CREATE TABLE table_name_43 (
shooter VARCHAR,
event VARCHAR,
rank_points VARCHAR
) | What shooter has wc munich as the event, and 8 as the rank points? | SELECT shooter FROM table_name_43 WHERE event = "wc munich" AND rank_points = "8" |
CREATE TABLE table_69604 (
"Polling Firm" text,
"Date Published" text,
"T. Papadopoulos" text,
"D. Christofias" text,
"I. Kasoulidis" text,
"K. Themistokleous" text
) | What was the percentage for T. Papadopoulos when I. Kasoulidis was 27.1%? | SELECT "T. Papadopoulos" FROM table_69604 WHERE "I. Kasoulidis" = '27.1%' |
CREATE TABLE Supplier_Addresses (
supplier_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Staff_Department_Assignments (
staff_id INTEGER,
department_id INTEGER,
date_assigned_from DATETIME,
job_title_code VARCHAR(10),
date_assigned_to DATETIME
)... | Give the maximum product price for each product type in a pie chart. | SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code |
CREATE TABLE table_51787 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the average top-25 value for majors that have more than 0 wins? | SELECT AVG("Top-25") FROM table_51787 WHERE "Wins" > '0' |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number... | were patient 018-47575 in the emergency room? | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '018-47575' AND patient.hospitaladmitsource = 'emergency department' |
CREATE TABLE table_name_34 (
away_team VARCHAR,
crowd INTEGER
) | What team played in front of 28,536 at an away stadium? | SELECT away_team AS score FROM table_name_34 WHERE crowd > 28 OFFSET 536 |
CREATE TABLE table_204_866 (
id number,
"name" text,
"lifetime" text,
"nationality" text,
"notable as" text,
"notes" text
) | which nationality is top on the chart | SELECT "nationality" FROM table_204_866 WHERE id = 1 |
CREATE TABLE table_name_58 (
bronze INTEGER,
total INTEGER
) | What is the number of bronze when the total is smaller than 1? | SELECT AVG(bronze) FROM table_name_58 WHERE total < 1 |
CREATE TABLE table_204_135 (
id number,
"position" number,
"club" text,
"played" number,
"points" number,
"wins" number,
"draws" number,
"losses" number,
"goals for" number,
"goals against" number,
"goal difference" number
) | which club had a total of only four wins ? | SELECT "club" FROM table_204_135 WHERE "wins" = 4 |
CREATE TABLE table_54656 (
"Name" text,
"Scotland career" text,
"Caps" real,
"Goals" real,
"Average" real
) | What is the average cap number in scotland in 1986 1998 leass than 69? | SELECT COUNT("Average") FROM table_54656 WHERE "Caps" < '69' AND "Scotland career" = '1986–1998' |
CREATE TABLE table_name_8 (
school VARCHAR,
mascot VARCHAR
) | What school has rebels as their mascot? | SELECT school FROM table_name_8 WHERE mascot = "rebels" |
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)... | Stacked bar of date in locaton to and the number of date in locaton to colored by Location_Code, order by the Y in ascending. | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(Date_in_Locaton_To) |
CREATE TABLE table_name_69 (
silver INTEGER,
gold VARCHAR,
bronze VARCHAR
) | Gold of 0, and a Bronze smaller than 0 and what is the sum of the silver? | SELECT SUM(silver) FROM table_name_69 WHERE gold = 0 AND bronze < 0 |
CREATE TABLE table_name_45 (
candidate VARCHAR,
result VARCHAR
) | Who is the candidate that had 10 fired in week 2 (1-27-2005)? | SELECT candidate FROM table_name_45 WHERE result = "10 fired in week 2 (1-27-2005)" |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | List the last name of the students who do not have any food type allergy and count them in a bart chart. | SELECT LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName |
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 prescription... | provide the number of patients who died primarily due to fall on stair/step nec. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Fall on stair/step NEC" |
CREATE TABLE table_name_66 (
nation VARCHAR,
bronze VARCHAR,
silver VARCHAR
) | Bronze smaller than 5, and a Silver larger than 0 is which nation? | SELECT nation FROM table_name_66 WHERE bronze < 5 AND silver > 0 |
CREATE TABLE table_57592 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | Who was the constructor when Eugenio Castellotti was the pole position and the race had a C tyre? | SELECT "Constructor" FROM table_57592 WHERE "Tyre" = 'c' AND "Pole position" = 'eugenio castellotti' |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | tell me the price of a procedure called agent specific therapy - calcium channel blockers overdose? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'agent specific therapy - calcium channel blockers overdose') |
CREATE TABLE table_17156 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | Which years had a jersey number 55 | SELECT "Years for Rockets" FROM table_17156 WHERE "No.(s)" = '55' |
CREATE TABLE table_name_40 (
year INTEGER,
points VARCHAR,
entrant VARCHAR
) | What is the earliest year with less than 3 points and Parmalat Forti Ford was the entrant? | SELECT MIN(year) FROM table_name_40 WHERE points < 3 AND entrant = "parmalat forti ford" |
CREATE TABLE table_204_547 (
id number,
"rank" number,
"lane" number,
"name" text,
"nationality" text,
"time" number,
"notes" text
) | out of all their times , which one was fastest ? | SELECT "time" FROM table_204_547 ORDER BY "time" LIMIT 1 |
CREATE TABLE table_47704 (
"Date" text,
"Flight" text,
"Aircraft" text,
"Registration" text,
"Location" text,
"Fatalities" real
) | Which flight had an aircraft of vickers viscount type 794? | SELECT "Flight" FROM table_47704 WHERE "Aircraft" = 'vickers viscount type 794' |
CREATE TABLE table_name_65 (
position VARCHAR
) | Who held the Communications Rep position in 2011? | SELECT 2011 FROM table_name_65 WHERE position = "communications rep" |
CREATE TABLE table_64769 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
) | What is the latitude that has a sqmi smaller than 34.401, a Geo ID smaller than 3807157722, and a Longitude of -98.475995? | SELECT "Latitude" FROM table_64769 WHERE "Land ( sqmi )" < '34.401' AND "GEO ID" < '3807157722' AND "Longitude" = '-98.475995' |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, give me the comparison about the sum of code over the headquarter , and group by attribute headquarter, display y axis from high to low order. | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC |
CREATE TABLE table_31143 (
"Season" real,
"Winner" text,
"Runner-up" text,
"Third place" text,
"Fourth place" text
) | Who was the runner up the season that Sagawa Express came in fourth? | SELECT "Runner-up" FROM table_31143 WHERE "Fourth place" = 'Sagawa Express' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid... | when is the first time that patient 002-52932 has had a heartrate measured until 03/10/2100? | 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 = '002-52932')) AND NOT vitalperiodic.heartrate IS NUL... |
CREATE TABLE table_56464 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | On February 26, who was the leading scorer? | SELECT "Leading scorer" FROM table_56464 WHERE "Date" = 'february 26' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | how many patients are below 49 years of age and admitted under the year 2198? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "49" AND demographic.admityear < "2198" |
CREATE TABLE table_name_87 (
top_10 VARCHAR,
events VARCHAR,
top_5 VARCHAR
) | What's the sum of Top-10 that has Events that's larger than 16, and has a Top-5 that's also larger than 5? | SELECT COUNT(top_10) FROM table_name_87 WHERE events > 16 AND top_5 > 5 |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | give me the number of patients whose days of hospital stay is greater than 26 and diagnoses short title is joint replaced knee? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "26" AND diagnoses.short_title = "Joint replaced knee" |
CREATE TABLE table_name_57 (
inhabitants INTEGER,
party VARCHAR,
election VARCHAR
) | In the election earlier than 2012 how many Inhabitants had a Party of five star movement? | SELECT SUM(inhabitants) FROM table_name_57 WHERE party = "five star movement" AND election < 2012 |
CREATE TABLE table_name_36 (
distance VARCHAR,
venue VARCHAR
) | In what Distance has a Venue of sale? | SELECT distance FROM table_name_36 WHERE venue = "sale" |
CREATE TABLE Playlist (
PlaylistId integer,
Name varchar(120)
)
CREATE TABLE Artist (
ArtistId integer,
Name varchar(120)
)
CREATE TABLE MediaType (
MediaTypeId integer,
Name varchar(120)
)
CREATE TABLE Invoice (
InvoiceId integer,
CustomerId integer,
InvoiceDate datetime,
Bil... | List the number of the phone numbers of all employees. | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone |
CREATE TABLE table_203_112 (
id number,
"choke" text,
"constriction (inch)" number,
"percentage of lead shot in 30-inch circle at 40 yards" text,
"identification (notches)" number,
"identification (stars)\n(spanish shotguns)" number
) | what is the difference in percentage of lead shot at 25 yards between cylinder and skeet 1 barrels ? | SELECT ABS((SELECT "percentage of lead shot in 30-inch circle at 40 yards" FROM table_203_112 WHERE "choke" = 'cylinder') - (SELECT "percentage of lead shot in 30-inch circle at 40 yards" FROM table_203_112 WHERE "choke" = 'skeet 1')) |
CREATE TABLE table_44824 (
"Game" real,
"Date" real,
"Opponent" text,
"Score" text,
"Decision" text,
"Location/Attendance" text,
"Record" text
) | What is the record of game 42, which had a clemmensen decision? | SELECT "Record" FROM table_44824 WHERE "Decision" = 'clemmensen' AND "Game" = '42' |
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 ethnicity is asian and age is less than 80? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.age < "80" |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Courses (
course_id INTEGER,
author_... | Find the enrollment date for all the tests that have 'Pass' result, and count them by a bar chart, sort by the Y from low to high please. | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) |
CREATE TABLE products (
product_id text,
product_name text,
product_price number,
product_description text,
other_product_service_details text
)
CREATE TABLE performers_in_bookings (
order_id number,
performer_id number
)
CREATE TABLE clients (
client_id number,
address_id number,
... | What is the description and code of the type of service that is performed the most often? | SELECT T1.service_type_description, T1.service_type_code FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code GROUP BY T1.service_type_code ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_65097 (
"Date" text,
"Opponent" text,
"Score" text,
"Venue" text,
"Attendance" text
) | What is the Attendance of New Zealand Scores in bold? | SELECT "Attendance" FROM table_65097 WHERE "Date" = 'new zealand scores in bold' |
CREATE TABLE table_name_34 (
code VARCHAR,
currency VARCHAR
) | What code is used to represent the currency of Croatian Kuna? | SELECT code FROM table_name_34 WHERE currency = "croatian kuna" |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | Give me a bar chart for mean max(score) of each year, and sort by the y-axis in ascending. | SELECT Year, AVG(MAX(Score)) FROM wine ORDER BY AVG(MAX(Score)) |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id numbe... | what is the name of a procedure that patient 73713 has been given for two times since 70 months ago? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 737... |
CREATE TABLE table_69514 (
"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
) | What is the number of tries for that has 30 tries against? | SELECT "Tries for" FROM table_69514 WHERE "Tries against" = '30' |
CREATE TABLE table_34511 (
"Rank" text,
"Player" text,
"Position" text,
"Career" text,
"Points" real
) | Who is the player who had more than 1,052 points? | SELECT "Player" FROM table_34511 WHERE "Points" > '1,052' |
CREATE TABLE table_203_160 (
id number,
"rank" number,
"heat" number,
"nation" text,
"competitors" text,
"time" text,
"notes" text
) | how long did it take the german team to finish the race ? | SELECT "time" FROM table_203_160 WHERE "nation" = 'germany' |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_ti... | When Connie Shaw took GREEK 695 , who was the teacher ? | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id INNER JOIN course_... |
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 job_history (
EMPLO... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, and rank sum salary from high to low order. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(SALARY) DESC |
CREATE TABLE table_77372 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Record" text
) | what is the game when on november 27? | SELECT SUM("Game") FROM table_77372 WHERE "November" = '27' |
CREATE TABLE endowment (
endowment_id int,
School_id int,
donator_name text,
amount real
)
CREATE TABLE School (
School_id text,
School_name text,
Location text,
Mascot text,
Enrollment int,
IHSAA_Class text,
IHSAA_Football_Class text,
County text
)
CREATE TABLE budget ... | What is the proportion of the number of schools in different counties? | SELECT County, COUNT(*) FROM School GROUP BY County |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | provide the number of patients whose gender is f and drug name is phenytoin sodium? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "Phenytoin Sodium" |
CREATE TABLE table_203_82 (
id number,
"first issued" number,
"design" text,
"slogan" text,
"serial format" text,
"serials issued" text,
"notes" text
) | what was year was the first arizona license plate made ? | SELECT MIN("first issued") FROM table_203_82 |
CREATE TABLE table_name_15 (
lead VARCHAR,
nation VARCHAR
) | Which Lead has a Nation of switzerland? | SELECT lead FROM table_name_15 WHERE nation = "switzerland" |
CREATE TABLE table_name_83 (
drawn INTEGER,
played VARCHAR,
_percentage_won VARCHAR
) | What is the smallest draws for a player larger than 2 with a 100% wins? | SELECT MIN(drawn) FROM table_name_83 WHERE played > 2 AND _percentage_won > 100 |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE... | How many students that has a GPA lower than average? Show me a pie chart grouping by student's first name. | SELECT STU_FNAME, COUNT(STU_FNAME) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME |
CREATE TABLE customers (
customer_id number,
customer_details text
)
CREATE TABLE settlements (
settlement_id number,
claim_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number,
customer_policy_id number
)
CREATE TABLE payments (
... | Find the claimed amount in the claim with the least amount settled. Show both the settlement amount and claim amount. | SELECT amount_settled, amount_claimed FROM claims ORDER BY amount_settled LIMIT 1 |
CREATE TABLE table_40931 (
"Place" real,
"Rider" text,
"Country" text,
"Machine" text,
"Speed" text,
"Time" text,
"Points" real
) | What machine has 5 as the place? | SELECT "Machine" FROM table_40931 WHERE "Place" = '5' |
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE college (
cname text,
state text,
enr number
) | How many students participated in tryouts for each college by descennding count? | SELECT COUNT(*), cname FROM tryout GROUP BY cname ORDER BY COUNT(*) DESC |
CREATE TABLE table_2460 (
"#" real,
"Japanese title" text,
"R\u014dmaji" text,
"Japanese translation" text,
"Vocalist" text,
"Episodes used" text
) | When momoiro clover z is the vocalist how many japanese titles are there? | SELECT COUNT("Japanese title") FROM table_2460 WHERE "Vocalist" = 'Momoiro Clover Z' |
CREATE TABLE table_4855 (
"Week" real,
"Opponent" text,
"Result" text,
"Stadium" text,
"Record" text,
"Attenmdance" text
) | What was the attendance at war memorial stadium? | SELECT "Attenmdance" FROM table_4855 WHERE "Stadium" = 'war memorial stadium' |
CREATE TABLE table_14012 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What's the total amount of USSR that has more than 0 gold, less than 85 silver and more than 6 bronze? | SELECT MIN("Total") FROM table_14012 WHERE "Gold" > '0' AND "Bronze" > '6' AND "Nation" = 'ussr' AND "Silver" < '85' |
CREATE TABLE table_name_71 (
position_in_1999 VARCHAR,
venue VARCHAR
) | What is the position of the team that played at the venue, Central, Gomel? | SELECT position_in_1999 FROM table_name_71 WHERE venue = "central, gomel" |
CREATE TABLE table_name_60 (
player VARCHAR,
total VARCHAR
) | Which player had a total of 152? | SELECT player FROM table_name_60 WHERE total = "152" |
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,
... | For patient Kurt Buczek, specify the location he was admitted to and his death status | SELECT demographic.expire_flag, demographic.admission_location FROM demographic WHERE demographic.name = "Kurt Buczek" |
CREATE TABLE table_26920192_5 (
fastest_lap VARCHAR,
winning_driver VARCHAR
) | Who had the fastest lap when the winning driver was kristian ghedina? | SELECT fastest_lap FROM table_26920192_5 WHERE winning_driver = "Kristian Ghedina" |
CREATE TABLE table_24498 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | In what district was the successor seated August 31, 1943? | SELECT "District" FROM table_24498 WHERE "Date successor seated" = 'August 31, 1943' |
CREATE TABLE table_42700 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many silvers have a gold greater than 2, a bronze less than 35, china as the nation, with a total greater than 26? | SELECT COUNT("Silver") FROM table_42700 WHERE "Gold" > '2' AND "Bronze" < '35' AND "Nation" = 'china' AND "Total" > '26' |
CREATE TABLE products_for_hire (
product_id number,
product_type_code text,
daily_hire_cost number,
product_name text,
product_description text
)
CREATE TABLE customers (
customer_id number,
coupon_id number,
good_or_bad_customer text,
first_name text,
last_name text,
gender... | What are all the distinct payment types? | SELECT DISTINCT payment_type_code FROM payments |
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 l... | what is the name of the drug which patient 012-4131 was prescribed during the same day after having received a therapeutic antibacterials - third generation cephalosporin procedure until 08/2105? | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-4131') AND treatment.treatmen... |
CREATE TABLE table_64334 (
"Year" real,
"1st Place Team" text,
"2nd Place Team" text,
"3rd Place Team" text,
"4th Place Team" text,
"Host Location" text
) | What year was the 4th Place Team of the Wyoming Angus, Johnstown, Co? | SELECT COUNT("Year") FROM table_64334 WHERE "4th Place Team" = 'wyoming angus, johnstown, co' |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | TOP 50 users from Bangladesh. Lists the top 50 users (ranked by reputation) that are located in Calicut/Kozhikode, Kerala, India according to their profile information.
Thanks to http://data.stackexchange.com/stackoverflow/qe/1157/top-100-users-from-greece | SELECT Id, DisplayName, Reputation, WebsiteUrl, Location, LastAccessDate FROM Users WHERE Location LIKE '%Bangladesh%' ORDER BY Reputation DESC LIMIT 150 |
CREATE TABLE table_name_11 (
year INTEGER,
player_name VARCHAR
) | I want the sum of year for mark barron | SELECT SUM(year) FROM table_name_11 WHERE player_name = "mark barron" |
CREATE TABLE table_name_18 (
founded INTEGER,
stadium VARCHAR,
club VARCHAR
) | What year was the team Club of atl tico de san juan fc who plays at hiram bithorn stadium founded. | SELECT SUM(founded) FROM table_name_18 WHERE stadium = "hiram bithorn stadium" AND club = "atlético de san juan fc" |
CREATE TABLE table_32245 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away team that faced Carlton? | SELECT "Away team" FROM table_32245 WHERE "Home team" = 'carlton' |
CREATE TABLE table_48215 (
"Player" text,
"Club" text,
"Games" real,
"Goals" real,
"Assists" real,
"Points" real
) | What is the highest number of goals Eisb ren Berlin had along with 13 points and 10 assists? | SELECT MAX("Goals") FROM table_48215 WHERE "Points" = '13' AND "Assists" = '10' AND "Club" = 'eisbären berlin' |
CREATE TABLE table_64376 (
"Rank" real,
"Show" text,
"Episode" text,
"Number of Viewers" real,
"Date" text
) | Which Rank has a Show of alcatraz, and a Number of Viewers larger than 1,229,000? | SELECT MIN("Rank") FROM table_64376 WHERE "Show" = 'alcatraz' AND "Number of Viewers" > '1,229,000' |
CREATE TABLE table_60538 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue number(s)" text
) | Which Format has a Date of 14 october 2008, and a Label of eagle eye media? | SELECT "Format" FROM table_60538 WHERE "Date" = '14 october 2008' AND "Label" = 'eagle eye media' |
CREATE TABLE table_name_41 (
name VARCHAR,
indication VARCHAR
) | Which study included autoimmune disease and inflammation? | SELECT name FROM table_name_41 WHERE indication = "autoimmune disease and inflammation" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.