table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_18012 (
"Release" text,
"Title" text,
"Windows" text,
"5th Gen" text,
"6th Gen" text,
"Handheld" text
) | Was the release on April 8 available on Windows? | SELECT "Windows" FROM table_18012 WHERE "Release" = 'April 8' |
CREATE TABLE endowment (
donator_name VARCHAR,
amount INTEGER
) | List each donator name and the amount of endowment in descending order of the amount of endowment. | SELECT donator_name, SUM(amount) FROM endowment GROUP BY donator_name ORDER BY SUM(amount) DESC |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number... | this year what were the four most common lab tests? | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4 |
CREATE TABLE table_name_10 (
crew_chief VARCHAR,
team VARCHAR,
driver_s_ VARCHAR
) | Who is the crew chief of team Chip Ganassi Racing with Felix Sabates, which has Casey Mears as the driver? | SELECT crew_chief FROM table_name_10 WHERE team = "chip ganassi racing with felix sabates" AND driver_s_ = "casey mears" |
CREATE TABLE table_name_97 (
total INTEGER,
nation VARCHAR,
silver VARCHAR
) | What is the Total of kyrgyzstan with a Silver smaller than 0? | SELECT AVG(total) FROM table_name_97 WHERE nation = "kyrgyzstan" AND silver < 0 |
CREATE TABLE table_11964263_13 (
game INTEGER
) | Name the minimum game | SELECT MIN(game) FROM table_11964263_13 |
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE i... | calculate the number of patients who were admitted to hospital during this year. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') |
CREATE TABLE table_name_93 (
others VARCHAR,
fidesz VARCHAR,
jobbik VARCHAR
) | What is the percentage of others with a Fidesz of 62% and a Jobbik of 4%? | SELECT others FROM table_name_93 WHERE fidesz = "62%" AND jobbik = "4%" |
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE head (
head_ID int,
name text,
born_state tex... | Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes' with a bar chart, show from low to high by the X. | SELECT Name, SUM(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY Name |
CREATE TABLE table_51420 (
"Player" text,
"Position" text,
"Tries" real,
"Goals" real,
"Points" real
) | What is the lowest number of points that Tevita Vaikona scored when making more than 23 tries? | SELECT MIN("Points") FROM table_51420 WHERE "Tries" > '23' AND "Player" = 'tevita vaikona' |
CREATE TABLE table_68026 (
"Year" real,
"Result" text,
"Award" text,
"Category" text,
"Nominated work" text
) | what is the category that has the people's choice awards? | SELECT "Category" FROM table_68026 WHERE "Award" = 'people''s choice awards' |
CREATE TABLE table_269888_1 (
no_of_s_barangay VARCHAR,
pop_density__per_km²_ VARCHAR
) | Name the number of barangay for 205.4 density | SELECT no_of_s_barangay FROM table_269888_1 WHERE pop_density__per_km²_ = "205.4" |
CREATE TABLE table_name_10 (
position_in_1998 VARCHAR,
team VARCHAR
) | What was the position of the Slavia team in 1998? | SELECT position_in_1998 FROM table_name_10 WHERE team = "slavia" |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | when was the last time that patient 013-9305 received a procedure in the previous year? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-9305')) AND DATETIME(treatment.treatmenttime, 'start of year'... |
CREATE TABLE table_name_73 (
partner VARCHAR,
outcome VARCHAR,
date VARCHAR
) | What is Partner, when Outcome is Winner, and when Date is 12 October 2003? | SELECT partner FROM table_name_73 WHERE outcome = "winner" AND date = "12 october 2003" |
CREATE TABLE table_77613 (
"Call sign" text,
"Frequency MHz" text,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | Tell me the city of license with frequency of Mhz of 90.3 fm | SELECT "City of license" FROM table_77613 WHERE "Frequency MHz" = '90.3 fm' |
CREATE TABLE table_name_67 (
score VARCHAR,
away_team VARCHAR
) | What was the score when Spennymoor United as the away team? | SELECT score FROM table_name_67 WHERE away_team = "spennymoor united" |
CREATE TABLE playlist (
playlistid number,
name text
)
CREATE TABLE customer (
customerid number,
firstname text,
lastname text,
company text,
address text,
city text,
state text,
country text,
postalcode text,
phone text,
fax text,
email text,
supportrepid n... | Please show the employee last names that serves no more than 20 customers. | SELECT T1.lastname FROM customer AS T1 JOIN employee AS T2 ON T1.supportrepid = T2.employeeid GROUP BY T1.supportrepid HAVING COUNT(*) <= 20 |
CREATE TABLE table_25688 (
"Episode Number" text,
"Title" text,
"Villains" text,
"Director" text,
"Writer" text,
"Original airdate" text
) | Who are the villains in 'the others'? | SELECT "Villains" FROM table_25688 WHERE "Title" = 'The Others' |
CREATE TABLE table_50163 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What team has a location and attendance at the Seattle Center Coliseum 12,591? | SELECT "Team" FROM table_50163 WHERE "Location Attendance" = 'seattle center coliseum 12,591' |
CREATE TABLE table_name_26 (
final_score VARCHAR,
stadium VARCHAR
) | What was the final score of the game at Texas Stadium? | SELECT final_score FROM table_name_26 WHERE stadium = "texas stadium" |
CREATE TABLE table_38452 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
) | Which Game has a Record of 27-11-10? | SELECT AVG("Game") FROM table_38452 WHERE "Record" = '27-11-10' |
CREATE TABLE table_26375386_28 (
average VARCHAR,
number_of_dances VARCHAR
) | What is every average when number of dances is 1? | SELECT average FROM table_26375386_28 WHERE number_of_dances = 1 |
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... | what is admission type and death status of subject name james sloan? | SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.name = "James Sloan" |
CREATE TABLE table_46974 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
) | In what Year was the Game on September 26? | SELECT SUM("Year") FROM table_46974 WHERE "Date" = 'september 26' |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABL... | Comments including the word 'edited'. | SELECT CreationDate, Id AS "comment_link" FROM Comments WHERE LOWER(Text) LIKE '%edited%' AND CreationDate >= '2019-01-01' ORDER BY LENGTH(Text) LIMIT 1000 |
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... | count the number of inpatient hospital admission patients born before 2092. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2092" |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Potential necromancer answers for a given user: answers with questions 60 days older or more. | SELECT Answers.Id AS "post_link", Answers.CreationDate AS "Answered Date", Questions.CreationDate AS "Asked Date", DATEDIFF(day, Questions.CreationDate, CreationDate) AS "Date Delta Days", Answers.Score FROM Posts AS Answers INNER JOIN Posts AS Questions ON Answers.PostTypeId = 2 AND Answers.OwnerUserId = '##UserId?895... |
CREATE TABLE prereq (
course_id text,
prereq_id text
)
CREATE TABLE takes (
id text,
course_id text,
sec_id text,
semester text,
year number,
grade text
)
CREATE TABLE teaches (
id text,
course_id text,
sec_id text,
semester text,
year number
)
CREATE TABLE instruc... | What is the sum of budgets of the Marketing and Finance departments? | SELECT SUM(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance' |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | what is patient 13473's last ward id until 4 years ago? | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13473) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY transfers.intime DESC LIMIT 1 |
CREATE TABLE table_17323092_6 (
location_attendance VARCHAR,
team VARCHAR
) | What is the location and attendance for the Orlando team? | SELECT location_attendance FROM table_17323092_6 WHERE team = "Orlando" |
CREATE TABLE table_9646 (
"Lane" real,
"Name" text,
"Country" text,
"Mark" real,
"React" real
) | What is the total number of Mark, when Country is 'Russia', and when React is less than 0.165? | SELECT COUNT("Mark") FROM table_9646 WHERE "Country" = 'russia' AND "React" < '0.165' |
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
... | What is the project id and detail for the project with at least two documents Plot them as bar chart, and order by the y axis from high to low. | SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID ORDER BY T1.Project_ID DESC |
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_diagnoses (
row_id number,
icd9_code text,
sh... | calculate the total of patient 25312's input on 12/27/2104. | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25312)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) = '2104-12-27' |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number... | when did patient 022-166510 receive a test in the lab for the first time in 12/2101? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-166510')) AND STRFTIME('%y-%m', lab.labresulttime) = '2101-12' ORDER BY lab.lab... |
CREATE TABLE table_63476 (
"District" real,
"Incumbent" text,
"2008 Status" text,
"Democratic" text,
"Republican" text,
"Green" text
) | What's the 2008 Status of Rosa Delauro? | SELECT "2008 Status" FROM table_63476 WHERE "Democratic" = 'rosa delauro' |
CREATE TABLE table_48702 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | What is the name of the person that was appointed on 13 May 2009? | SELECT "Replaced by" FROM table_48702 WHERE "Date of appointment" = '13 may 2009' |
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,
... | how many patients have been discharged from hospital. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL |
CREATE TABLE table_56231 (
"Yard Name" text,
"Location (City, State)" text,
"1st Ship Delivery Date" text,
"Ship Types Delivered" text,
"Total Number of Ways" text,
"Total Vessels Built for USMC" text
) | what is the yard name when the ship types delivered is n3 type, v4 type and the total vessels built for usmc is 13 ships for usmc? | SELECT "Yard Name" FROM table_56231 WHERE "Ship Types Delivered" = 'n3 type, v4 type' AND "Total Vessels Built for USMC" = '13 ships for usmc' |
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 three most frequently prescribed drugs for patients that have been prescribed with glucagon at the same time in 2102? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'glucagon' AND STRFTIME('%y', medication.drugstartti... |
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 lab (
labid numbe... | what is the number of patients who have been diagnosed with s/p exploratory laparotomy within 2 months after having received a blood product administration the last year? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'blood product administration' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME... |
CREATE TABLE table_name_27 (
date VARCHAR,
pos VARCHAR,
venue VARCHAR
) | On which date was the position less than 4 at Piraeus? | SELECT date FROM table_name_27 WHERE pos < 4 AND venue = "piraeus" |
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),... | Draw a bar chart for what is the first name and GPA of every student that has a GPA lower than average?, could you rank by the y-axis from high to low? | SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY SUM(STU_GPA) DESC |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
... | during the last year, what was the top four most frequent laboratory tests given to patients within 2 months after receiving a glucose - d50? | SELECT t3.labname FROM (SELECT t2.labname, 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 = 'glucose - d50' AND DATETIME(treatment.treatmenttime,... |
CREATE TABLE table_1637981_7 (
detroit__dtw_ VARCHAR,
lansing__lan_ VARCHAR
) | When Lansing's fare is $433.59, what is the Detroit fare? | SELECT detroit__dtw_ FROM table_1637981_7 WHERE lansing__lan_ = "$433.59" |
CREATE TABLE table_53391 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the score for Collingwood as the home team? | SELECT "Home team score" FROM table_53391 WHERE "Home team" = 'collingwood' |
CREATE TABLE table_77018 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | In which year did he compete in the Universiade? | SELECT "Year" FROM table_77018 WHERE "Competition" = 'universiade' |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
... | Will SM 217 be offered every semester ? | SELECT COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'SM' AND COURSEalias0.number = 2... |
CREATE TABLE table_name_45 (
date VARCHAR,
competition VARCHAR
) | What is the Date of the 1999 fifa confederations cup? | SELECT date FROM table_name_45 WHERE competition = "1999 fifa confederations cup" |
CREATE TABLE table_2532 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | What is Fred Stolle's final year of competing in a championship? | SELECT MAX("Year") FROM table_2532 |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and employee_id , and sort bars from high to low order please. | SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
trea... | what were the three most frequent drugs prescribed during the same month to the patients 30s after they had been diagnosed with acute respiratory failure in the previous year? | SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'acute respiratory failure' AND DATETIME(diagnosis.... |
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... | provide the number of patients whose insurance is government and procedure short title is non-invasive mech vent? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Non-invasive mech vent" |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
... | when since 2104 patient 016-35481 received for the last time a procedure? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-35481')) AND STRFTIME('%y', treatment.treatmenttime) >= '2104... |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id nu... | Users with Generalist badge ordered by their reputation. Users with Generalist badge ordered by their reputation | SELECT u.Id AS "user_link", u.Reputation, b.Date FROM Badges AS b INNER JOIN Users AS u ON u.Id = b.UserId WHERE b.Name = 'Generalist' ORDER BY u.Reputation |
CREATE TABLE table_28793672_1 (
golden_tickets VARCHAR,
callback_venue VARCHAR
) | How many times is there a golden tickets entry when the callback venue is rcti studio, jakarta? | SELECT COUNT(golden_tickets) FROM table_28793672_1 WHERE callback_venue = "RCTI Studio, Jakarta" |
CREATE TABLE table_name_97 (
region VARCHAR,
altitude__metres_ VARCHAR
) | Say the region for 6854 altitudes | SELECT region FROM table_name_97 WHERE altitude__metres_ = 6854 |
CREATE TABLE table_name_67 (
player VARCHAR,
to_par VARCHAR,
country VARCHAR
) | which Player has a To par of 7, and a Country of spain? | SELECT player FROM table_name_67 WHERE to_par = "–7" AND country = "spain" |
CREATE TABLE table_60551 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
) | What 2nd Member has a 1st Party of conservative, and a 1st Member of william edward dowdeswell? | SELECT "2nd Member" FROM table_60551 WHERE "1st Party" = 'conservative' AND "1st Member" = 'william edward dowdeswell' |
CREATE TABLE table_name_6 (
number_of_electorates__2009_ INTEGER,
name VARCHAR
) | What is the electorates in 2009 for Modi Nagar? | SELECT AVG(number_of_electorates__2009_) FROM table_name_6 WHERE name = "modi nagar" |
CREATE TABLE table_68671 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Name the least points with chassis of kurtis kraft 3000 and year before 1951 | SELECT MIN("Points") FROM table_68671 WHERE "Chassis" = 'kurtis kraft 3000' AND "Year" < '1951' |
CREATE TABLE table_22904707_1 (
title VARCHAR,
us_viewers__million_ VARCHAR
) | What was the name of the episode that had 14.52 viewers? | SELECT title FROM table_22904707_1 WHERE us_viewers__million_ = "14.52" |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
... | tell me the name of the organism found in the first bronchial lavage microbiology test on patient 031-19622 during their last hospital encounter? | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-19622' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient... |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
... | Number of down votes on answers in past 30 days. | SELECT COUNT(*) FROM Votes JOIN Posts ON Votes.PostId = Posts.Id WHERE Votes.VoteTypeId IN (3) AND Votes.CreationDate >= DATEADD(DAY, -30, GETDATE()) AND Posts.PostTypeId IN (2) |
CREATE TABLE table_21123 (
"Rank" real,
"Company" text,
"Country" text,
"Industry" text,
"Sales (billion $)" text,
"Profits (billion $)" text,
"Assets (billion $)" text,
"Market Value (billion $)" text
) | Name the number of rank for 9.52 profits | SELECT COUNT("Rank") FROM table_21123 WHERE "Profits (billion $)" = '9.52' |
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE match_season (
Season re... | Show the position of players and the corresponding number of players with a bar chart. | SELECT Position, COUNT(*) FROM match_season GROUP BY Position |
CREATE TABLE table_train_185 (
"id" int,
"dyscrasia" bool,
"bleeding" int,
"panic_disorder" bool,
"renal_disease" bool,
"anxiety" bool,
"creatinine_clearance_cl" float,
"alcohol_abuse" bool,
"retinopathy" bool,
"NOUSE" float
) | uncontrolled anxiety or panic disorder | SELECT * FROM table_train_185 WHERE anxiety = 1 OR panic_disorder = 1 |
CREATE TABLE table_name_58 (
game INTEGER,
record VARCHAR
) | What is the lowest game number when the record was 26-24-9? | SELECT MIN(game) FROM table_name_58 WHERE record = "26-24-9" |
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 DE... | What is the relationship between average and highest student GPA for every department? Give me a scatter chart grouping by department code. | SELECT MAX(STU_GPA), AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
... | Most Popular Tags of 2018. | SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS Rank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS Questions, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.... |
CREATE TABLE table_29569 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Points" real,
"Decision" text
) | How many games were numbered 69? | SELECT COUNT("Opponent") FROM table_29569 WHERE "Game" = '69' |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE job... | When can I take Applied Russian ? | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... |
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... | calculate the average days for which patients with white-russian ethnic background were hospitalized. | SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" |
CREATE TABLE table_name_98 (
player VARCHAR,
to_par VARCHAR,
country VARCHAR
) | Who has a To par of 2, and a Country of united states? | SELECT player FROM table_name_98 WHERE to_par = "–2" AND country = "united states" |
CREATE TABLE table_name_88 (
downstream VARCHAR,
upstream VARCHAR
) | What is Downstream, when Upstream is '384 kbit'? | SELECT downstream FROM table_name_88 WHERE upstream = "384 kbit" |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
... | what was the number of patients that were tested until 2104 for sputum, tracheal specimen microbiology? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'sputum, tracheal specimen' AND STRFTIME('%y', microlab.culturetakentime) <= '2104') |
CREATE TABLE table_name_25 (
margin_of_victory VARCHAR,
tournament VARCHAR
) | What is the margin of victory for PGA Championship? | SELECT margin_of_victory FROM table_name_25 WHERE tournament = "pga championship" |
CREATE TABLE table_64947 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What country is Larry Mize from? | SELECT "Country" FROM table_64947 WHERE "Player" = 'larry mize' |
CREATE TABLE table_11047 (
"Code" real,
"Type" text,
"Name" text,
"Area (km 2 )" real,
"Population" real,
"Regional County Municipality" text,
"Region" real
) | what is the regional county municipality when the type is m and the code is less than 91015? | SELECT "Regional County Municipality" FROM table_11047 WHERE "Type" = 'm' AND "Code" < '91015' |
CREATE TABLE table_name_81 (
silver VARCHAR,
bronze VARCHAR,
gold VARCHAR,
rank VARCHAR
) | What is number of silver for the country with more than 0 gold, rank of 14, and more than 4 bronze? | SELECT COUNT(silver) FROM table_name_81 WHERE gold > 0 AND rank = "14" AND bronze > 4 |
CREATE TABLE table_42964 (
"Year" real,
"Result" real,
"World Rank" text,
"Location" text,
"Date" text
) | What Year has a Result smaller than 20.31, and a World Rank of 5th? | SELECT AVG("Year") FROM table_42964 WHERE "Result" < '20.31' AND "World Rank" = '5th' |
CREATE TABLE table_24108789_4 (
after INTEGER,
player VARCHAR
) | What is the latest after when the player is Steve Stricker? | SELECT MAX(after) FROM table_24108789_4 WHERE player = "Steve Stricker" |
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,
... | how many times has cultures - csf procedure been performed since 5 years ago? | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'cultures - csf' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-5 year') |
CREATE TABLE table_65996 (
"Year" real,
"Formula" text,
"Driver" text,
"Constructor" text,
"Location" text,
"Report" text
) | Which location was won by George Heath? | SELECT "Location" FROM table_65996 WHERE "Driver" = 'george heath' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | what is drug type and drug code of drug name buspirone? | SELECT prescriptions.drug_type, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "BusPIRone" |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | Provide the number of patients whose admission type is elective and item id is 51269. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.itemid = "51269" |
CREATE TABLE table_63670 (
"School" text,
"City" text,
"Team Name" text,
"Enrollment 08-09" real,
"IHSAA Class" text,
"IHSAA Class Football" text,
"County" text,
"Year Joined (Or Joining)" real,
"Previous Conference" text
) | What school has a team called the Pirates? | SELECT "School" FROM table_63670 WHERE "Team Name" = 'pirates' |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)... | i need to book a flight from NEWARK to TAMPA on 4 4 | 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 = 'TAMPA' AND date_day.day_number = 4 AND date_day.month_number = 4 AND date... |
CREATE TABLE table_44914 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Who is the driver with 1 grid? | SELECT "Driver" FROM table_44914 WHERE "Grid" = '1' |
CREATE TABLE table_name_89 (
manuals VARCHAR,
kind VARCHAR,
opus VARCHAR
) | What are the manuals with a kind of r, and an opus of 144? | SELECT manuals FROM table_name_89 WHERE kind = "r" AND opus = "144" |
CREATE TABLE table_204_291 (
id number,
"rank" number,
"name" text,
"nation" text,
"cp" number,
"fp" number,
"points" number,
"placings" number
) | name a competitor that scored more that 2600 points and was from canada . | SELECT "name" FROM table_204_291 WHERE "points" > 2600 AND "nation" = 'canada' |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_co... | list all of the DAILY flights arriving in DENVER from 2000 to 2100 | SELECT DISTINCT flight_id FROM flight WHERE (((arrival_time <= 2100 AND arrival_time >= 2000) AND to_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_nam... |
CREATE TABLE table_63129 (
"County" text,
"Per capita income" text,
"Median household income" text,
"Median family income" text,
"Population" real,
"Number of households" real
) | What is the median family income when the per capita is $24,114? | SELECT "Median family income" FROM table_63129 WHERE "Per capita income" = '$24,114' |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | 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, return a line chart about the change of commission_pct over hire_date . | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
CREATE TABLE table_name_49 (
conv VARCHAR,
pens VARCHAR,
player VARCHAR
) | How many conversions did Severo Koroduadua Waqanibau have when he has 0 pens? | SELECT conv FROM table_name_49 WHERE pens = "0" AND player = "severo koroduadua waqanibau" |
CREATE TABLE table_42384 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | Who is the opponent for the game with 37,845 people in attendance? | SELECT "Opponent" FROM table_42384 WHERE "Attendance" = '37,845' |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_... | For all employees who have the letters D or S in their first name, give me the trend about commission_pct over hire_date , and I want to rank x axis from low to high order. | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE |
CREATE TABLE table_32524 (
"Year" real,
"Name" text,
"Date" text,
"Stages" text,
"Distance" text,
"Winner" text,
"Time" text
) | What tour was cancelled? | SELECT "Name" FROM table_32524 WHERE "Date" = 'cancelled' |
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
)
CREATE TABLE country (
Country_ID int,
Name text,
Population int,
Area int,
Languages text
) | Show the names of countries and the average speed of roller coasters from each country Plot them as bar chart, sort from high to low by the Name please. | 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 ORDER BY T1.Name DESC |
CREATE TABLE table_22383603_1 (
start__reg_season_ VARCHAR,
top_record VARCHAR
) | When did the season start that ended with the top record of Lindenwood (20 0 0)? | SELECT start__reg_season_ FROM table_22383603_1 WHERE top_record = "Lindenwood (20–0–0)" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.