table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_74837 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text
) | Name the venue for staines town | SELECT "Venue" FROM table_74837 WHERE "Opponent" = 'staines town' |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Rev... | Open questions by users with rep>1000 from the past year, with link to post. | SELECT Users.Id AS "user_link", Posts.Title AS "posts_link", 'http://english.stackexchange.com/questions/' + CAST(Posts.Id AS TEXT), Posts.LastEditDate, Posts.CreationDate, Posts.ClosedDate, Posts.AcceptedAnswerId FROM Users INNER JOIN Posts ON Users.Id = OwnerUserId WHERE Reputation >= 1000 AND Title != '' AND Posts.C... |
CREATE TABLE table_name_51 (
replaced_by VARCHAR,
date_of_vacancy VARCHAR
) | who is the replacement when the date of vacancy is 1 september 2008? | SELECT replaced_by FROM table_name_51 WHERE date_of_vacancy = "1 september 2008" |
CREATE TABLE table_10788 (
"Player" text,
"Att." real,
"Yards" real,
"Avg." real,
"Long" real,
"FumL" real
) | I want to know the longest Long for santana moss and Att more than 1 | SELECT MIN("Long") FROM table_10788 WHERE "Player" = 'santana moss' AND "Att." > '1' |
CREATE TABLE table_5413 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"Position" text
) | What is the highest season wth a Win of 1 and a Position that is 8th? | SELECT MAX("Season") FROM table_5413 WHERE "Wins" = '1' AND "Position" = '8th' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | count the number of patients who have government insurance and their diagnosis icd9 code is 99702. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.icd9_code = "99702" |
CREATE TABLE table_12141496_1 (
alt_name VARCHAR,
id VARCHAR
) | How many alt names does 1964-011a have? | SELECT COUNT(alt_name) FROM table_12141496_1 WHERE id = "1964-011A" |
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 whose gender is f and diagnoses short title is bacteremia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Bacteremia" |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | calculate the number of patients who have received protein - csf lab tests since 2104. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'protein - csf' AND STRFTIME('%y', lab.labresulttime) >= '2104') |
CREATE TABLE table_66706 (
"Year" text,
"Births (000s)" real,
"Deaths" real,
"Natural Growth" real,
"Total Fertility Rate" text
) | What was the amount of Births (000s) that had a death rate larger than 7.6, and a Year of 1990-2009? | SELECT SUM("Births (000s)") FROM table_66706 WHERE "Deaths" > '7.6' AND "Year" = '1990-2009' |
CREATE TABLE table_1966 (
"#" real,
"Player" text,
"Country" text,
"Points" real,
"Events" real,
"Reset Points" real
) | Name the total number of points for number 6 | SELECT COUNT("Points") FROM table_1966 WHERE "#" = '6' |
CREATE TABLE table_27994983_8 (
juries INTEGER,
artist VARCHAR
) | How many juries are there for Brolle? | SELECT MAX(juries) FROM table_27994983_8 WHERE artist = "Brolle" |
CREATE TABLE Lessons (
staff_id VARCHAR
)
CREATE TABLE Staff (
staff_id VARCHAR,
first_name VARCHAR,
last_name VARCHAR
) | What is average lesson price taught by staff with first name as Janessa and last name as Sawayn? | SELECT AVG(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | what's the name of the drug that patient 030-4181 was first prescribed via intravenous route in 06/2104? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-4181')) AND medication.routeadmin = 'intravenous' AND STRFTIME(... |
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End_Date DATE
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Cla... | Plot date claim settled by the number of date claim settled as a line chart, and I want to order in desc by the X. | SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements GROUP BY Date_Claim_Settled ORDER BY Date_Claim_Settled DESC |
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Participants (
Participant_ID... | How many events have each participants attended? Show their average number by each participant type code using a bar chart. | SELECT T1.Participant_Type_Code, AVG(COUNT(*)) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_Type_Code |
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(120),
line_2 VARCHAR(120),
line_3 VARCHAR(120),
city VARCHAR(80),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50),
other_address_details VARCHAR(255)
)
CREATE TABLE Ref_Detention_Type (
... | Visualize a scatter chart about the correlation between address_id and monthly_rental . | SELECT address_id, monthly_rental FROM Student_Addresses ORDER BY monthly_rental DESC |
CREATE TABLE table_28634206_1 (
total INTEGER,
country VARCHAR
) | How many placements in total does russia have? | SELECT MAX(total) FROM table_28634206_1 WHERE country = "Russia" |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TI... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, display in desc by the sum department id. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID) DESC |
CREATE TABLE table_20168 (
"Round" real,
"Choice" real,
"Player name" text,
"Position" text,
"Height" text,
"Weight" real,
"College" text
) | What position(s) do players from florida state play? | SELECT "Position" FROM table_20168 WHERE "College" = 'Florida State' |
CREATE TABLE table_name_19 (
ground VARCHAR,
away_team VARCHAR
) | What was the ground for away team essendon? | SELECT ground FROM table_name_19 WHERE away_team = "essendon" |
CREATE TABLE table_6027 (
"Year" real,
"Round" text,
"Series" text,
"Games covered" text,
"Play-by-play" text,
"Colour commentator (s)" text
) | What Games covered had a round of divisional finals? | SELECT "Games covered" FROM table_6027 WHERE "Round" = 'divisional finals' |
CREATE TABLE table_name_89 (
total INTEGER,
gold INTEGER
) | What is the lowest medal total with less than 3 gold medals? | SELECT MIN(total) FROM table_name_89 WHERE gold < 3 |
CREATE TABLE table_47030 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the record of the game with a game number greater than 24 on December 19? | SELECT "Record" FROM table_47030 WHERE "Game" > '24' AND "Date" = 'december 19' |
CREATE TABLE table_name_38 (
set_2 VARCHAR,
set_1 VARCHAR
) | Set 1 of 25 20, what was Set 2? | SELECT set_2 FROM table_name_38 WHERE set_1 = "25–20" |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number... | SELECT TOP 100 * From Posts. | SELECT * FROM Users LIMIT 1000000 |
CREATE TABLE table_204_243 (
id number,
"year" number,
"album" text,
"song" text,
"duration" text,
"artist" text
) | what album was previous to one dream ? | SELECT "album" FROM table_204_243 WHERE id = (SELECT id FROM table_204_243 WHERE "song" = '"one dream"') - 1 |
CREATE TABLE table_1341549_10 (
incumbent VARCHAR,
first_elected VARCHAR
) | Name the incumbent for 1954 | SELECT incumbent FROM table_1341549_10 WHERE first_elected = "1954" |
CREATE TABLE table_name_99 (
tournament VARCHAR
) | What is 2011, when 2012 is 'A', and when Tournament is 'French Open'? | SELECT 2011 FROM table_name_99 WHERE 2012 = "a" AND tournament = "french open" |
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... | Show me about the distribution of ACC_Road and the sum of Team_ID , and group by attribute ACC_Road in a bar chart, show names in desc order. | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,... | count the number of times that patient 87530 has until 20 months ago had gastric nasogastric output. | SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87530)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric nasogastri... |
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE student (
ID varchar(5... | How many courses are provided in each year? Visualize with a line chart, and order x-axis in descending order. | SELECT year, COUNT(*) FROM section GROUP BY year ORDER BY year DESC |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | How many patients stayed in hospital for more than 15 days and were diagnosed for respiratory distress syn? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "15" AND diagnoses.short_title = "Respiratory distress syn" |
CREATE TABLE table_1030 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | was herb graver a starter? | SELECT "Starter" FROM table_1030 WHERE "Player" = 'Herb Graver' |
CREATE TABLE table_32775 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
) | The safety position is represented in the draft by which colleges? | SELECT "College" FROM table_32775 WHERE "Position" = 'safety' |
CREATE TABLE table_name_59 (
city VARCHAR,
icao VARCHAR
) | Which city has an ICAO of Kiah? | SELECT city FROM table_name_59 WHERE icao = "kiah" |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | Search for mysql_* functions are deprecated. | SELECT CONCAT('id', 'comment_link') FROM Comments WHERE Text LIKE 'mysql_*' |
CREATE TABLE table_204_262 (
id number,
"rank" number,
"athlete" text,
"time" text,
"notes" text,
"q" text
) | what was the time of the person who finished first ? | SELECT "time" FROM table_204_262 WHERE "rank" = 1 |
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE professor (
emp_num number,
dep... | How many different professors are there for the different schools? | SELECT COUNT(*), T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code |
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,
... | how many married patients had total calcium lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Calcium, Total" |
CREATE TABLE table_58554 (
"Country" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
) | What is the total swimsuit number with gowns larger than 9.48 with interviews larger than 8.94 in florida? | SELECT COUNT("Swimsuit") FROM table_58554 WHERE "Evening Gown" > '9.48' AND "Country" = 'florida' AND "Interview" > '8.94' |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_fro... | what do you have from PHILADELPHIA to DALLAS on saturday morning | 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 (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_nam... |
CREATE TABLE table_204_117 (
id number,
"season" number,
"level" text,
"division" text,
"section" text,
"position" text,
"movements" text
) | how many times did they finish above 5th place in division 2 tier 3 ? | SELECT COUNT(*) FROM table_204_117 WHERE "position" < 5 AND "division" = 2 AND "level" = 3 |
CREATE TABLE table_name_98 (
result_f___a VARCHAR,
opponents VARCHAR
) | hat is the Result F A when they played against Leeds United? | SELECT result_f___a FROM table_name_98 WHERE opponents = "leeds united" |
CREATE TABLE table_name_80 (
finish VARCHAR,
total VARCHAR
) | What was the finish of the player who had a total of 282? | SELECT finish FROM table_name_80 WHERE total = 282 |
CREATE TABLE table_77015 (
"Round" real,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Team" text
) | On what date does Yuji Tachikawa have the fastest lap in round 1? | SELECT "Date" FROM table_77015 WHERE "Fastest Lap" = 'yuji tachikawa' AND "Round" = '1' |
CREATE TABLE table_name_70 (
year INTEGER,
overall_pick VARCHAR,
name VARCHAR
) | What year was Jordan Hill picked overall number 8? | SELECT MIN(year) FROM table_name_70 WHERE overall_pick = "8" AND name = "jordan hill" |
CREATE TABLE table_10051 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the country with a 66-70-69=205 score? | SELECT "Country" FROM table_10051 WHERE "Score" = '66-70-69=205' |
CREATE TABLE table_73708 (
"Model" text,
"Launch" text,
"Model Number" text,
"Code name" text,
"Fab ( nm )" text,
"Bus interface" text,
"Memory ( MiB )" text,
"Core clock ( MHz )" text,
"Memory clock ( MHz )" text,
"Config core 1" text,
"Pixel ( GP /s)" text,
"Texture ( G... | What is every bus type for the texture of fillrate? | SELECT "Bus type" FROM table_73708 WHERE "Texture ( GT /s)" = 'Fillrate' |
CREATE TABLE table_14752049_1 (
country VARCHAR,
rank VARCHAR
) | Which country has a rank of 5? | SELECT country FROM table_14752049_1 WHERE rank = 5 |
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,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | A bar chart about the number of last name for all female students whose sex is F, and rank in asc by the y-axis. | SELECT LName, COUNT(LName) FROM Student WHERE Sex = 'F' GROUP BY LName ORDER BY COUNT(LName) |
CREATE TABLE table_name_68 (
date VARCHAR,
record VARCHAR
) | On what date did they have a record of 12-17? | SELECT date FROM table_name_68 WHERE record = "12-17" |
CREATE TABLE table_27765443_2 (
cpu_type VARCHAR,
period_of_operation VARCHAR
) | Name the cpu type for june 2005 - april 2009 | SELECT cpu_type FROM table_27765443_2 WHERE period_of_operation = "June 2005 - April 2009" |
CREATE TABLE table_204_928 (
id number,
"year" number,
"album" text,
"territory" text,
"label" text,
"notes" text
) | five and jezebel are apart of which label ? | SELECT "label" FROM table_204_928 WHERE "album" = 'five' |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | how many patients received parenteral feeds - tpn treatment within 2 months after being diagnosed with coronary artery disease during the last year. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'coronary artery disease' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), '... |
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 transfers (
row_id number,
subject_id number,
hadm_... | did patient 65124 receive hemorrhage complic proc diagnosis until 1 year ago? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hemorrhage complic proc') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65124) AND DATETIME(diagnoses... |
CREATE TABLE table_24584486_1 (
team VARCHAR,
points VARCHAR
) | What team was he on the year he had 38 points? | SELECT team FROM table_24584486_1 WHERE points = 38 |
CREATE TABLE table_name_21 (
transfer_window VARCHAR,
moving_from VARCHAR
) | What was the transfer window with a moving from of fenerbah e? | SELECT transfer_window FROM table_name_21 WHERE moving_from = "fenerbahçe" |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Courses (
course_id INTEGER,
author... | Give me the comparison about author_tutor_ATB over the middle_name . | SELECT middle_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name |
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 price for the lorazepam inj? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'lorazepam inj') |
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 average of revenue over the founder , and group by attribute founder, and I want to rank in descending by the x axis. | SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
CREATE TABLE table_23293785_2 (
sf_round INTEGER,
country VARCHAR
) | What is the highest value for SF round for the country of England? | SELECT MAX(sf_round) FROM table_23293785_2 WHERE country = "England" |
CREATE TABLE table_71457 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine \u2020" text,
"Tyre" text,
"Driver" text,
"Rounds" text
) | Which tyre is on the car driven by Pedro de la Rosa? | SELECT "Tyre" FROM table_71457 WHERE "Driver" = 'pedro de la rosa' |
CREATE TABLE table_name_35 (
total__000s_ VARCHAR,
germany VARCHAR
) | What was the amount of 000s when Germany had 16.6? | SELECT total__000s_ FROM table_name_35 WHERE germany = 16.6 |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
... | During the Fall and Winter , what upper-level electives are offered ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (semester.semester = ... |
CREATE TABLE table_32752 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the date of the game when the venue is MCG? | SELECT "Date" FROM table_32752 WHERE "Venue" = 'mcg' |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | Questions & Answers with 'Thanks in advance'. | SELECT p.CreationDate, CASE WHEN (2 = p.PostTypeId) THEN 'Answer' ELSE 'Question' END AS PostType, p.Score, CASE WHEN (2 = p.PostTypeId) THEN t.Title ELSE p.Title END AS QuestionTitle, p.Body, p.Id AS "post_link" FROM Posts AS p LEFT OUTER JOIN Posts AS t ON (p.ParentId = t.Id) WHERE 1 = 1 AND p.CreationDate >= DATEADD... |
CREATE TABLE table_2613 (
"Stage" real,
"Stage winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Malaysian rider classification" text,
"Team classification" text,
"Malaysian team classification" text
) | Which points classification has 4 as the stage? | SELECT "Points classification" FROM table_2613 WHERE "Stage" = '4' |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime tim... | have patient 15125 been diagnosed with anything since 1 year ago? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15125) AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year') |
CREATE TABLE table_204_793 (
id number,
"call-sign" text,
"location" text,
"rf" number,
"psip" number,
"programming" text
) | how many jstations have an rf of at least 29 ? | SELECT COUNT(*) FROM table_204_793 WHERE "rf" >= 29 |
CREATE TABLE table_78262 (
"Date" text,
"Venue" text,
"Visitor" text,
"Score" text,
"Home" text,
"Montreal goals" text,
"Decision" text,
"Attendance" real,
"Series" text
) | What was the average attendance when the decision was price and montreal were the visitors? | SELECT AVG("Attendance") FROM table_78262 WHERE "Visitor" = 'montreal' AND "Decision" = 'price' |
CREATE TABLE table_name_83 (
isolation__km_ INTEGER,
municipality VARCHAR,
elevation__m_ VARCHAR
) | What is the average Isolation in the municipality of Sunndal at an elevation of more than 1850? | SELECT AVG(isolation__km_) FROM table_name_83 WHERE municipality = "sunndal" AND elevation__m_ > 1850 |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | how many times did patient 017-58432 have an intake of ns ivf on 11/07/last year? | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-58432')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... |
CREATE TABLE HOTELS (
other_hotel_details VARCHAR,
price_range VARCHAR
) | Show the details of the top 3 most expensive hotels. | SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3 |
CREATE TABLE table_name_6 (
location VARCHAR,
name VARCHAR
) | What is the Location for the newington international airport? | SELECT location FROM table_name_6 WHERE name = "newington international airport" |
CREATE TABLE table_8997 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What place had a score smaller than 74 and a par of e? | SELECT "Place" FROM table_8997 WHERE "Score" < '74' AND "To par" = 'e' |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_s... | i'd like to see the flights from DENVER to PHILADELPHIA again | 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE... |
CREATE TABLE table_46034 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the game number when the Toronto Maple Leafs were the opponent, and the February was less than 17? | SELECT AVG("Game") FROM table_46034 WHERE "Opponent" = 'toronto maple leafs' AND "February" < '17' |
CREATE TABLE table_name_2 (
league VARCHAR,
reg_season VARCHAR
) | Tell me the league with a regular 1st season | SELECT league FROM table_name_2 WHERE reg_season = "1st" |
CREATE TABLE table_4494 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the attendance when the VFL played Lake Oval? | SELECT COUNT("Crowd") FROM table_4494 WHERE "Venue" = 'lake oval' |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
tr... | i'd like the cheapest one way fare from BOSTON to ATLANTA please | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... |
CREATE TABLE table_name_61 (
director VARCHAR,
film_title_used_in_nomination VARCHAR
) | Who was the director of Small Voices, a film title used in nomination? | SELECT director FROM table_name_61 WHERE film_title_used_in_nomination = "small voices" |
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | Show the average price of each film in a bar chart, I want to show y axis from low to high order. | SELECT Title, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title ORDER BY AVG(Price) |
CREATE TABLE table_name_87 (
entrant VARCHAR,
points VARCHAR,
chassis VARCHAR
) | with lola t86/50 chassis and less than 7 points what is the entrant? | SELECT entrant FROM table_name_87 WHERE points < 7 AND chassis = "lola t86/50" |
CREATE TABLE table_1342198_25 (
district VARCHAR,
party VARCHAR
) | What is the district with Republican party in place? | SELECT district FROM table_1342198_25 WHERE party = "Republican" |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE... | what are total transaction amounts for each transaction type?, and I want to rank by the Y-axis from high to low. | SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type ORDER BY SUM(transaction_amount) DESC |
CREATE TABLE table_28812 (
"Western" text,
"Central" text,
"Eastern" text,
"Old Galician (13th\u201315th c.)" text,
"Portuguese" text,
"Spanish" text,
"Latin" text,
"English" text
) | What is the Spanish word for cas [ kas]? | SELECT "Spanish" FROM table_28812 WHERE "Central" = 'cas [ˈkas]' |
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,
... | count the number of times that nitroglycerin 50 mg in d5w 250 ml r has been prescribed until 2103. | SELECT COUNT(*) FROM medication WHERE medication.drugname = 'nitroglycerin 50 mg in d5w 250 ml r' AND STRFTIME('%y', medication.drugstarttime) <= '2103' |
CREATE TABLE table_65433 (
"Date" text,
"Location" text,
"Lineup" text,
"Assist/pass" text,
"Score" text,
"Result" text,
"Competition" text
) | What's the lineup when the assist/pass was Unassisted? | SELECT "Lineup" FROM table_65433 WHERE "Assist/pass" = 'unassisted' |
CREATE TABLE table_name_86 (
game VARCHAR,
team VARCHAR,
record VARCHAR
) | Which Game has a Team of at san antonio, and a Record of 3-3? | SELECT game FROM table_name_86 WHERE team = "at san antonio" AND record = "3-3" |
CREATE TABLE table_1990460_1 (
division INTEGER
) | What's the highest division number through the years? | SELECT MAX(division) FROM table_1990460_1 |
CREATE TABLE table_24920 (
"School" text,
"Location" text,
"Team Name" text,
"Colors" text,
"Varsity Teams" real,
"NJCAA Championships" real
) | If the school is John A. Logan College, what are the colors? | SELECT "Colors" FROM table_24920 WHERE "School" = 'John A. Logan College' |
CREATE TABLE table_25463 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | Who has the high points when 3-2 is the series? | SELECT "High points" FROM table_25463 WHERE "Series" = '3-2' |
CREATE TABLE table_21458142_1 (
sales_breakdown VARCHAR,
publisher VARCHAR,
release_date VARCHAR
) | What's the sales breakdown of the Nintendo game released on May 15, 2006? | SELECT sales_breakdown FROM table_21458142_1 WHERE publisher = "Nintendo" AND release_date = "May 15, 2006" |
CREATE TABLE table_24364 (
"Type of Record" text,
"Attendance" real,
"Date/Year" text,
"Stadium" text,
"Result/Games" text
) | For what year is the type of record 'total attendance-regular season? | SELECT "Date/Year" FROM table_24364 WHERE "Type of Record" = 'Total Attendance-Regular season' |
CREATE TABLE table_25316812_1 (
rate_limit__p_ VARCHAR,
desired_rate_change___percentage_ VARCHAR
) | What is the rate limit when the desired rate change (%) is +40.4? | SELECT rate_limit__p_ FROM table_25316812_1 WHERE desired_rate_change___percentage_ = "+40.4" |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diag... | tell me the intake method for belatacept study drug (*ind*)? | SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'belatacept study drug (*ind*)' |
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
)
... | what is days of hospital stay and primary disease of subject id 2560? | SELECT demographic.days_stay, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560" |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | count the number of patients whose age is less than 77 and item id is 51032? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "77" AND lab.itemid = "51032" |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description t... | My Tags by Post Count. | SELECT T.TagName, COUNT(Pot.TagId) AS TagCount, SUM(P.Score) AS TagScore FROM Tags AS T, PostTags AS Pot, Posts AS P, Users AS U, PostTypes AS Pt WHERE U.Id = P.OwnerUserId AND Pt.Id = P.PostTypeId AND (u.Id = 548225) AND Pot.PostId = P.ParentId AND T.Id = Pot.TagId GROUP BY T.TagName ORDER BY COUNT(Pot.TagId) DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.