context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_76 (
dvd_set_release_date VARCHAR,
network VARCHAR
) | When dis cbs release the DVD set? | SELECT dvd_set_release_date FROM table_name_76 WHERE network = "cbs" | sql_create_context |
CREATE TABLE table_50180 (
"Show" text,
"Host(s)" text,
"Flagship" text,
"Market" text,
"iHeartRadio" text
) | What is the Flagship of the Show Hosted by Rover (Shane French)? | SELECT "Flagship" FROM table_50180 WHERE "Host(s)" = 'rover (shane french)' | wikisql |
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 cost (
costid number,
... | calculate the duration of stay during patient 007-4322's first stay in the intensive care unit. | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-4322') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE table_59092 (
"Player" text,
"Country" text,
"Year(s) Won" text,
"Total" real,
"To par" real
) | Can you tell me the Year(s) Won that has the Country of united states, and the Total larger than 152? | SELECT "Year(s) Won" FROM table_59092 WHERE "Country" = 'united states' AND "Total" > '152' | wikisql |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | Show me how many year by year in a histogram, and I want to list Y-axis in desc order. | SELECT Year, COUNT(Year) FROM exhibition ORDER BY COUNT(Year) DESC | nvbench |
CREATE TABLE table_name_96 (
location VARCHAR,
classification VARCHAR
) | What is the location of Classification of T12? | SELECT location FROM table_name_96 WHERE classification = "t12" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
... | calculate the five year survival rate among the patients who were prescribed lr after they were diagnosed with cv dis nec-deliver w p/p. | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
CREATE TABLE table_32804 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home team when the home team score is 12.17 (89)? | SELECT "Home team" FROM table_32804 WHERE "Home team score" = '12.17 (89)' | wikisql |
CREATE TABLE table_57513 (
"Date of Issue" text,
"Theme" text,
"Design" text,
"Illustration" text,
"Paper Type" text,
"First Day Cover Cancellation" text
) | What is the Date of Issue with a Theme with mental health? | SELECT "Date of Issue" FROM table_57513 WHERE "Theme" = 'mental health' | wikisql |
CREATE TABLE table_56 (
"Year" real,
"Game or event" text,
"Date contested" text,
"League or governing body" text,
"Sport" text,
"Winning team" text,
"Losing team" text,
"Final score" text
) | What sport had a final score of 3-2? | SELECT "Sport" FROM table_56 WHERE "Final score" = '3-2' | wikisql |
CREATE TABLE table_203_61 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | nigeria has the most gold medals , but who has the most medals overall ? | SELECT "nation" FROM table_203_61 ORDER BY "total" DESC LIMIT 1 | squall |
CREATE TABLE volume (
Famous_Title VARCHAR,
Artist_ID VARCHAR
)
CREATE TABLE artist (
Famous_Title VARCHAR,
Artist_ID VARCHAR
) | Find the famous titles of artists that do not have any volume. | SELECT Famous_Title FROM artist WHERE NOT Artist_ID IN (SELECT Artist_ID FROM volume) | sql_create_context |
CREATE TABLE table_66970 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What races were Chi-Chi Rodriguez the runner-up in? | SELECT "Tournament" FROM table_66970 WHERE "Runner(s)-up" = 'chi-chi rodriguez' | wikisql |
CREATE TABLE table_27146868_1 (
Id VARCHAR
) | What is 2006 when 1997 is 6.8? | SELECT 2006 FROM table_27146868_1 WHERE 1997 = "6.8" | sql_create_context |
CREATE TABLE table_38417 (
"Pick #" real,
"MLS Team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | Which player's pick number was 25? | SELECT "Player" FROM table_38417 WHERE "Pick #" = '25' | wikisql |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | A bar chart about what is the average rating star for each reviewer?, I want to show from high to low by the y axis. | SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY AVG(T1.stars) DESC | nvbench |
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... | how many black/haitian patients had neb as the drug route? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.route = "NEB" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | what do endotracheal tube - insertion treatments cost? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'endotracheal tube - insertion') | eicu |
CREATE TABLE table_17657 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Total viewers (in millions)" text
) | Who directed the title that was written by Adam Milch? | SELECT "Directed by" FROM table_17657 WHERE "Written by" = 'Adam Milch' | wikisql |
CREATE TABLE table_name_83 (
consistency_ VARCHAR,
_participation VARCHAR,
pareto_efficiency VARCHAR,
condorcet VARCHAR
) | what is the consistency & participation when pareto efficiency is yes and condorcet is no? | SELECT consistency_ & _participation FROM table_name_83 WHERE pareto_efficiency = "yes" AND condorcet = "no" | sql_create_context |
CREATE TABLE table_18330 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What is the district that has Bob Wilson as an incumbent? | SELECT "District" FROM table_18330 WHERE "Incumbent" = 'Bob Wilson' | wikisql |
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 team_id by all road in a histogram, I want to list by the X-axis in ascending please. | SELECT All_Road, Team_ID FROM basketball_match ORDER BY All_Road | nvbench |
CREATE TABLE table_name_67 (
ranking INTEGER,
name VARCHAR
) | What is the lowest ranking for Paul Mctiernan? | SELECT MIN(ranking) FROM table_name_67 WHERE name = "paul mctiernan" | sql_create_context |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | Show the capacity for each cinema in a bar chart, list x axis from high to low order. | SELECT Name, Capacity FROM cinema ORDER BY Name DESC | nvbench |
CREATE TABLE table_name_34 (
score VARCHAR,
date VARCHAR
) | What was the score of the game on February 8? | SELECT score FROM table_name_34 WHERE date = "february 8" | sql_create_context |
CREATE TABLE table_28985631_1 (
defective_year VARCHAR,
numbered_month VARCHAR
) | What is the defective year for the eighth numbered month? | SELECT defective_year FROM table_28985631_1 WHERE numbered_month = "Eighth" | sql_create_context |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 在00年11月17日到07年11月12日期间里,医院5161684入院诊断疾病结果与出院诊断疾病结果不同的医疗就诊记录有哪些? | SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '5161684' AND qtb.IN_HOSP_DATE BETWEEN '2000-11-17' AND '2007-11-12' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '5161684' AND gyb.IN_HOSP_DATE BETWEEN '2000-11-17' AND '2007-11-12' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '5161684' AND zyb.IN_HOSP_DATE BETW... | css |
CREATE TABLE table_name_19 (
opponent VARCHAR,
result VARCHAR,
week VARCHAR
) | What opponent did they have a bye result against before week 14? | SELECT opponent FROM table_name_19 WHERE result = "bye" AND week < 14 | sql_create_context |
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),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
CO... | Show me a bar chart for what are all the employee ids and the names of the countries in which they work? | SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME | nvbench |
CREATE TABLE table_name_11 (
home_team VARCHAR,
venue VARCHAR
) | What team has theoir home games in the venue of gold coast convention centre? | SELECT home_team FROM table_name_11 WHERE venue = "gold coast convention centre" | sql_create_context |
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(... | I want to see trend of the number of date in locaton to by date in locaton to | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations | nvbench |
CREATE TABLE table_68838 (
"Original title" text,
"Title in English" text,
"Genre" text,
"Role" text,
"Directed by" text
) | What Genre did S ndor Sim direct? | SELECT "Genre" FROM table_68838 WHERE "Directed by" = 'sándor simó' | wikisql |
CREATE TABLE table_16527640_2 (
rank_held_at_time_of_death VARCHAR,
player VARCHAR
) | How many players named paddy rowan? | SELECT COUNT(rank_held_at_time_of_death) FROM table_16527640_2 WHERE player = "Paddy Rowan" | sql_create_context |
CREATE TABLE table_10335_1 (
current_country_of_location VARCHAR,
operational VARCHAR
) | what's the current country of location with operational period of summer of 1941 to 28 june 1944 | SELECT current_country_of_location FROM table_10335_1 WHERE operational = "Summer of 1941 to 28 June 1944" | sql_create_context |
CREATE TABLE table_23799417_2 (
title VARCHAR,
original_airing VARCHAR
) | what is the episode title on original air date of September 30, 2007? | SELECT title FROM table_23799417_2 WHERE original_airing = "September 30, 2007" | sql_create_context |
CREATE TABLE table_name_17 (
foundation VARCHAR,
enterprise VARCHAR
) | Which Foundation has an Enterprise of 2? | SELECT foundation FROM table_name_17 WHERE enterprise = "2" | sql_create_context |
CREATE TABLE table_2102782_1 (
broadcast_date VARCHAR,
run_time VARCHAR
) | Name the broadcast date for run timke of 25:04 | SELECT broadcast_date FROM table_2102782_1 WHERE run_time = "25:04" | sql_create_context |
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... | How many patients with brain mass intracranial hemorrhage as their primary disease had an abnormal lab test status? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | My List of Tag Synonyms which permit Voting. | SELECT 'site://tags/' + TargetTagName + '/synonyms|' + TargetTagName AS "vote4me", COUNT(SourceTagName) AS "synonyms" FROM TagSynonyms AS TS WHERE ApprovalDate IS NULL AND (SELECT SUM(CASE V.VoteTypeId WHEN 2 THEN 1 WHEN 3 THEN -1 END) FROM Tags AS T, PostTags AS Pt, Posts AS P, Votes AS V, VoteTypes AS Vt WHERE T.Id =... | sede |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 病人杨文彬的治疗历史 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '杨文彬' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' | css |
CREATE TABLE table_28194879_1 (
_number VARCHAR,
production_code VARCHAR
) | What is the number in season of the episode whose production code is pabf05? | SELECT _number FROM table_28194879_1 WHERE production_code = "PABF05" | sql_create_context |
CREATE TABLE table_name_96 (
wins INTEGER,
losses VARCHAR
) | What is the lowest amount of wins of someone who has 2 losses? | SELECT MIN(wins) FROM table_name_96 WHERE losses = 2 | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate... | Most accepted answers for Cassandra for the year. | SELECT Users.DisplayName, COUNT(*) AS AcceptedAnswers FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Posts AS questions ON questions.Id = PostTags.PostId INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Tags.Id = 34113 AND questions.Accept... | sede |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
... | when did patient 808 get a microbiology test for the last time this month? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY microbiologyevents.... | mimic_iii |
CREATE TABLE table_53941 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | Name the sum of played for position less than 9 and draws more than 19 with goals against more than 27 | SELECT SUM("Played") FROM table_53941 WHERE "Position" < '9' AND "Draws" > '19' AND "Goals against" > '27' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
sp... | how much has patient 85407 in a year before to pay for their hospital stay? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85407) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
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... | count the number of patients whose religion is jehovah's witness and age is less than 59? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "JEHOVAH'S WITNESS" AND demographic.age < "59" | mimicsql_data |
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... | A bar chart showing the average price of each cinema, show in descending by the y-axis please. | SELECT Name, 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 Name ORDER BY AVG(Price) DESC | nvbench |
CREATE TABLE table_58745 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
) | Name The Score of Player of seve ballesteros? | SELECT "Score" FROM table_58745 WHERE "Player" = 'seve ballesteros' | wikisql |
CREATE TABLE table_name_42 (
authors VARCHAR,
unit VARCHAR
) | Which authors have a Unit of densu -ciula formation? | SELECT authors FROM table_name_42 WHERE unit = "densuș-ciula formation" | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text... | i would like the evening schedule of flights from SAN FRANCISCO to WASHINGTON | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
CREATE TABLE table_23192 (
"Player" text,
"Games Played" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
) | What is the largest amount of assists that Nicole Levandusky made? | SELECT MAX("Assists") FROM table_23192 WHERE "Player" = 'Nicole Levandusky' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 在哪几次医疗记录中给病患17057702开出的药品均价低于6731.43元?列出医疗就诊编号都是多少? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '17057702' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6731.43) | css |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
... | In the classes for next Winter , what Core classes 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_offering.course_id WHERE program_cour... | advising |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | Show the trend about salary change over hire date using a line chart, and show x axis in descending order. | SELECT HIRE_DATE, SALARY FROM employees ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE region (
region_id number,
region_code text,
region_name text
)
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions_usd number,
number_deaths number
)
CREATE TABLE affected_region (
region_id number,
storm_id nu... | What are the names of regions that were not affected? | SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region) | spider |
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... | how many dead patients had diagnoses icd9 code 56962? | 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.icd9_code = "56962" | mimicsql_data |
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
acc_bal number,
no_of_loans number,
credit_score number,
branch_id number,
state text
)
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABL... | What are the names of customers who do not have saving accounts? | SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving' | spider |
CREATE TABLE table_2538117_12 (
organization VARCHAR,
founding_date VARCHAR
) | What organization had the founding date of 1998-11-08? | SELECT organization FROM table_2538117_12 WHERE founding_date = "1998-11-08" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDe... | Top users from Moscow, Russia. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%moscow%' OR UPPER(Location) LIKE '%MOSCOW%' OR Location LIKE '%Moscow%' AND Reputation >= 100 ORDER BY Reputation DESC | sede |
CREATE TABLE table_37410 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | What is the lowest lost from drawn of 1 or greater? | SELECT MIN("Lost") FROM table_37410 WHERE "Drawn" > '1' | wikisql |
CREATE TABLE table_18240 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What party did Beau Boulter represent? | SELECT "Party" FROM table_18240 WHERE "Incumbent" = 'Beau Boulter' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer... | what is the earliest flight from ATLANTA to BOSTON | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTO... | atis |
CREATE TABLE table_33863 (
"Frequency" real,
"Callsign" text,
"Brand" text,
"City of License" text,
"Website" text,
"Webcast" text
) | Which Website has a Frequency smaller than 760 and a Callsign of kkyx? | SELECT "Website" FROM table_33863 WHERE "Frequency" < '760' AND "Callsign" = 'kkyx' | wikisql |
CREATE TABLE table_name_15 (
team VARCHAR,
goals_against VARCHAR,
drawn VARCHAR,
position VARCHAR
) | Which team has a position higher than 3, a Drawn lower than 12, and a Goals Against higher than 85? | SELECT team FROM table_name_15 WHERE drawn < 12 AND position > 3 AND goals_against > 85 | sql_create_context |
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 d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABL... | what is the total acetaminophen dose that has been prescribed this month to patient 12927? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12927) AND prescriptions.drug = 'acetaminophen' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month'... | mimic_iii |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | 在门诊诊断为混合性焦虑和抑郁障碍的甲状旁腺素名叫金睿聪的患者的结果定量和单位都是什么? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE table_11393 (
"Data" text,
"Total gain" text,
"Percent gain" text,
"2003" text,
"2000" text,
"1997" text,
"1994" text,
"1991" text,
"1988" text,
"1985" text,
"1982" text,
"1979" text,
"1976" text,
"1973" text,
"1970" text,
"1967" text
) | Name the data with a percent gain of 28.4% | SELECT "Data" FROM table_11393 WHERE "Percent gain" = '28.4%' | wikisql |
CREATE TABLE table_74712 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the venue when Geelong is the away team? | SELECT "Venue" FROM table_74712 WHERE "Away team" = 'geelong' | wikisql |
CREATE TABLE table_10875694_11 (
product_no VARCHAR,
title VARCHAR
) | How many products have the title 'Jak 3'? | SELECT COUNT(product_no) FROM table_10875694_11 WHERE title = "Jak 3" | sql_create_context |
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,
... | give me the number of patients whose diagnoses short title is cellulitis of hand and drug type is main? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Cellulitis of hand" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | what are the four most common medications prescribed for patients who were also prescribed calcium gluconate 100 mg/ml (10 %) iv : 10 ml at the same time until 2101? | 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 = 'calcium gluconate 100 mg/ml (10 %) iv : 10 ml' AND ... | eicu |
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
) | How many actors have appeared in each musical Plot them as bar chart, and order x axis in asc order please. | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY T2.Name | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | what is the minimum age of patients whose admission location is transfer within this facility and diagnosed with primary disease atrial fibrillation\thoracoscopic maze procedure bilateral/sda? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" | mimicsql_data |
CREATE TABLE table_204_345 (
id number,
"discipline" text,
"amanda" number,
"bernie" number,
"javine h" number,
"julia" number,
"michelle" number
) | what is the first discipline listed on this chart ? | SELECT "discipline" FROM table_204_345 WHERE id = 1 | squall |
CREATE TABLE table_17623902_1 (
original_air_date VARCHAR,
written_by VARCHAR
) | What was the original air date of this episode that was written by Debbie Sarjeant? | SELECT original_air_date FROM table_17623902_1 WHERE written_by = "Debbie Sarjeant" | sql_create_context |
CREATE TABLE table_55295 (
"Grid" real,
"Driver" text,
"Constructor" text,
"Qual" real,
"Rank" real,
"Laps" real,
"Time/Retired" text
) | Name the highest grid for Laps more than 137 and rank is less than 8 | SELECT MAX("Grid") FROM table_55295 WHERE "Laps" > '137' AND "Rank" < '8' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
... | Finding questions having ONLY the given tag. | SELECT Posts.Id, Posts.Id AS "post_link", OwnerUserId AS "user_link", Score, ViewCount, AnswerCount, CreationDate, Tags FROM Posts WHERE Tags = '<##tagname?calculus##>' ORDER BY Posts.LastEditDate | sede |
CREATE TABLE table_name_87 (
points INTEGER,
laps INTEGER
) | What is the average amount of points larger than 154 laps? | SELECT AVG(points) FROM table_name_87 WHERE laps > 154 | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about manager_id over the last_name by a bar chart, list by the LAST_NAME from low to high please. | SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME | nvbench |
CREATE TABLE table_33570 (
"Type" text,
"Suffix" text,
"Valency change" text,
"Example" text,
"Meaning" text
) | What is the example with the associative type? | SELECT "Example" FROM table_33570 WHERE "Type" = 'associative' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | calculate the number of drugs prescribed to patient 006-200601 in a year before. | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-200601')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETI... | eicu |
CREATE TABLE table_name_6 (
dates VARCHAR,
tournament_location VARCHAR,
champion VARCHAR
) | What dates was champion masahiro kawamura at the ibaraki country club tournament? | SELECT dates FROM table_name_6 WHERE tournament_location = "ibaraki country club" AND champion = "masahiro kawamura" | sql_create_context |
CREATE TABLE table_2362606_1 (
score_in_final VARCHAR,
year VARCHAR
) | What was the score in the final in 1988? | SELECT score_in_final FROM table_2362606_1 WHERE year = 1988 | sql_create_context |
CREATE TABLE Attribute_Definitions (
attribute_id INTEGER,
attribute_name VARCHAR(30),
attribute_data_type VARCHAR(10)
)
CREATE TABLE Catalog_Contents (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
parent_entry_id INTEGER,
previous_entry_id INTEGER,
next_entry_id INTEGER,
... | Find the names of catalog entries with level number 8, and count them by a bar chart, I want to show x-axis in desc order. | SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name ORDER BY catalog_entry_name DESC | nvbench |
CREATE TABLE table_67502 (
"Season" real,
"Cars Entered" real,
"Winning Driver" text,
"Second Driver" text,
"Third Driver" text,
"Race Report" text
) | How many average Cars Entered have a Third Driver of manny ayulo? | SELECT AVG("Cars Entered") FROM table_67502 WHERE "Third Driver" = 'manny ayulo' | wikisql |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | 患者83706671的030972指标是什么情况在17年的10月30号到11月23号期间 | SELECT * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf... | css |
CREATE TABLE table_204_668 (
id number,
"#" number,
"menteri besar" text,
"took office" text,
"left office" text,
"party" text
) | what is the number of menteri besar that served 4 or more years ? | SELECT COUNT("menteri besar") FROM table_204_668 WHERE "left office" - "took office" >= 4 | squall |
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,
... | what is language and admission time of subject name jesse ran? | SELECT demographic.language, demographic.admittime FROM demographic WHERE demographic.name = "Jesse Ran" | mimicsql_data |
CREATE TABLE table_name_78 (
fatalities VARCHAR,
time VARCHAR
) | What number of Fatalties is associated with the Time of 12:38:46? | SELECT fatalities FROM table_name_78 WHERE time = "12:38:46" | sql_create_context |
CREATE TABLE table_77168 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | On what Date is Game 3 with Boston Road Team? | SELECT "Date" FROM table_77168 WHERE "Road Team" = 'boston' AND "Game" = 'game 3' | wikisql |
CREATE TABLE table_17596418_4 (
p VARCHAR,
moving_from VARCHAR
) | What is the P for the player moving from Everton? | SELECT p FROM table_17596418_4 WHERE moving_from = "Everton" | sql_create_context |
CREATE TABLE table_203_258 (
id number,
"year" number,
"team" text,
"games" number,
"combined tackles" number,
"tackles" number,
"assisted tackles" number,
"sacks" number,
"forced fumbles" number,
"fumble recoveries" number,
"fumble return yards" number,
"interceptions" n... | in what year did jason babin force at least 15 sacks ? | SELECT "year" FROM table_203_258 WHERE "sacks" >= 15 | squall |
CREATE TABLE table_204_598 (
id number,
"name" text,
"state of residence" text,
"took office" text,
"left office" text,
"president served under" text
) | name the advisor who served under the same president as karl rove . | SELECT "name" FROM table_204_598 WHERE "name" <> 'karl rove' AND "president served under" = (SELECT "president served under" FROM table_204_598 WHERE "name" = 'karl rove') | squall |
CREATE TABLE table_name_68 (
frequency VARCHAR,
format VARCHAR
) | what is the frequency when the format is contemporary christian music? | SELECT frequency FROM table_name_68 WHERE format = "contemporary christian music" | sql_create_context |
CREATE TABLE table_75487 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Total is the lowest one that has a Rank smaller than 1? | SELECT MIN("Total") FROM table_75487 WHERE "Rank" < '1' | wikisql |
CREATE TABLE table_name_79 (
top_5 INTEGER,
cuts_made VARCHAR
) | What is the average for the top five having a number of 42 cuts made. | SELECT AVG(top_5) FROM table_name_79 WHERE cuts_made = 42 | sql_create_context |
CREATE TABLE table_18602462_22 (
round_of_32 VARCHAR,
round_of_16 VARCHAR
) | How many round of 32 results are followed by Polidori ( Ita ) w 6-1, 3-6, 6-3 in the round of 16? | SELECT COUNT(round_of_32) FROM table_18602462_22 WHERE round_of_16 = "Polidori ( ITA ) W 6-1, 3-6, 6-3" | sql_create_context |
CREATE TABLE suppliers (
supplier_name VARCHAR,
supplier_phone VARCHAR,
supplier_id VARCHAR
)
CREATE TABLE product_suppliers (
supplier_id VARCHAR,
product_id VARCHAR
)
CREATE TABLE products (
product_id VARCHAR,
product_name VARCHAR
) | List the names and phone numbers of all the distinct suppliers who supply red jeans. | SELECT DISTINCT T1.supplier_name, T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = "red jeans" | sql_create_context |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
... | the most expensive flight between BOSTON and PHILADELPHIA | SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, fare, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_fare AS FLI... | atis |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.