context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_11207040_5 (
highest INTEGER,
team VARCHAR
) | What is the highest attandence at a Hamilton Academical game? | SELECT MIN(highest) FROM table_11207040_5 WHERE team = "Hamilton Academical" | sql_create_context |
CREATE TABLE table_name_67 (
gold INTEGER,
silver INTEGER
) | What is the lowest number of gold medals the nation with less than 0 silver medals has? | SELECT MIN(gold) FROM table_name_67 WHERE silver < 0 | sql_create_context |
CREATE TABLE table_54449 (
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" real,
"Points" real
) | Name the total number of draw for played more than 18 | SELECT COUNT("Draw") FROM table_54449 WHERE "Played" > '18' | wikisql |
CREATE TABLE table_203_808 (
id number,
"rank" number,
"peak name" text,
"elevation" text,
"location" text,
"notes" text
) | what are the total amount of mountains located in ruma , bandarban ? | SELECT COUNT("peak name") FROM table_203_808 WHERE "location" = 'ruma,bandarban' | squall |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | give me the number of patients whose year of birth is less than 2078 and drug route is inhalation? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2078" AND prescriptions.route = "INHALATION" | mimicsql_data |
CREATE TABLE table_name_32 (
date VARCHAR,
attendance VARCHAR
) | What is the date for 45,000 in attendance? | SELECT date FROM table_name_32 WHERE attendance = "45,000" | sql_create_context |
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... | give the number of patients whose drug type is base and lab test name is nucleated red cells. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "BASE" AND lab.label = "Nucleated Red Cells" | mimicsql_data |
CREATE TABLE table_203_77 (
id number,
"album title" text,
"format" text,
"year" number,
"original label" text,
"chart positions" text
) | what album title came next after get lost ? | SELECT "album title" FROM table_203_77 WHERE id = (SELECT id FROM table_203_77 WHERE "album title" = 'get lost') + 1 | squall |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskStates (
Id number,
Na... | Container trends (# of Questions per Month). | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ... | sede |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | My Voted Comments grouped by score. How many comments do I have for each score. | SELECT Score, COUNT(1) FROM Comments WHERE UserId = @UserId GROUP BY Score ORDER BY Score DESC | sede |
CREATE TABLE table_48424 (
"Season" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text,
"Alternate" text,
"Events" text
) | Which lead had a season of 2007-08? | SELECT "Lead" FROM table_48424 WHERE "Season" = '2007-08' | wikisql |
CREATE TABLE table_67847 (
"Year" real,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Points" real
) | What year is listed that has points greater than 0 with a chassis labeled AGS JH22? | SELECT "Year" FROM table_67847 WHERE "Points" > '0' AND "Chassis" = 'ags jh22' | wikisql |
CREATE TABLE table_36749 (
"Athlete" text,
"Nationality" text,
"2.15" text,
"2.20" text,
"2.24" text,
"2.27" text,
"Result" real
) | Which Athlete has a 2.24 of xo, and a 2.20 of o, and a 2.15 of o? | SELECT "Athlete" FROM table_36749 WHERE "2.24" = 'xo' AND "2.20" = 'o' AND "2.15" = 'o' | wikisql |
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 (
... | what was the name of the drug that was last prescribed to patient 022-6959 in the current hospital visit via the infiltration route? | 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 = '022-6959' AND patient.hospitaldischargetime IS NULL)) AND medicatio... | eicu |
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... | give me the number of patients whose admission type is emergency and drug name is amaryl? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Amaryl" | mimicsql_data |
CREATE TABLE table_46452 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the lowest round that a pick had a position of ls? | SELECT MIN("Round") FROM table_46452 WHERE "Position" = 'ls' | wikisql |
CREATE TABLE table_name_99 (
result VARCHAR,
attendance VARCHAR
) | Which Result has an Attendance of bye? | SELECT result FROM table_name_99 WHERE attendance = "bye" | sql_create_context |
CREATE TABLE table_59062 (
"Place" text,
"Competitor" text,
"Downhill points" real,
"Slalom points" text,
"Total" text
) | What place is the skier with 7.73 downhill points? | SELECT "Place" FROM table_59062 WHERE "Downhill points" = '7.73' | wikisql |
CREATE TABLE table_67013 (
"Round" real,
"Pick" real,
"Name" text,
"Position" text,
"College" text
) | Rutgers college holds what position? | SELECT "Position" FROM table_67013 WHERE "College" = 'rutgers' | wikisql |
CREATE TABLE table_name_86 (
test VARCHAR,
number_of_students VARCHAR
) | What test had 49,608 students? | SELECT test FROM table_name_86 WHERE number_of_students = "49,608" | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | Find tags and their excerpts ('definitions'). | SELECT Count, ('site://tags/' + TagName + '|' + TagName) AS TagName, ExcerptPostId AS "post_link" FROM Tags AS t LEFT JOIN Posts AS p ON p.Id = t.ExcerptPostId WHERE NOT (ExcerptPostId IS NULL) AND LENGTH(Body) > 0 ORDER BY Count DESC | sede |
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE jo... | How many papers has Richard Ladner and Linda Shapiro written together ? | SELECT DISTINCT COUNT(1) FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Richard Ladner' AND AUTHOR_1.authorname = 'Linda Shapiro' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid | scholar |
CREATE TABLE book (
Book_ID int,
Title text,
Issues real,
Writer text
)
CREATE TABLE publication (
Publication_ID int,
Book_ID int,
Publisher text,
Publication_Date text,
Price real
) | Bar chart x axis publication date y axis how many publication date, and rank in descending by the total number. | SELECT Publication_Date, COUNT(Publication_Date) FROM publication GROUP BY Publication_Date ORDER BY COUNT(Publication_Date) DESC | nvbench |
CREATE TABLE table_68918 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Name the most year for team motul brm and chassis of brm p201 and points less than 0 | SELECT MAX("Year") FROM table_68918 WHERE "Entrant" = 'team motul brm' AND "Chassis" = 'brm p201' AND "Points" < '0' | wikisql |
CREATE TABLE table_59556 (
"Season" real,
"Year" real,
"Mole" text,
"Winner" text,
"Runner-up" text,
"Total prize money" text,
"Potential prize money" text,
"Destination" text
) | What was the highest season number with a total prize of $108,000? | SELECT MAX("Season") FROM table_59556 WHERE "Total prize money" = '$108,000' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS va... | For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, I want to show by the sum department id in asc please. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID) | nvbench |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | Find Nationality and the average of ID , and group by attribute Nationality, and visualize them by a bar chart, and list by the bar from low to high. | SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | All answers for an post. | SELECT a.ParentId AS "post_link", q.Tags, a.Score, a.Body FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE q.Tags LIKE '%<##TagName##>%' ORDER BY a.Score DESC LIMIT 50 | sede |
CREATE TABLE table_204_471 (
id number,
"year" number,
"title" text,
"peak chart positions\nger" number,
"label" text,
"artist" text
) | what year was willy deville 's last album released ? | SELECT MAX("year") FROM table_204_471 WHERE "artist" = 'willy deville' | squall |
CREATE TABLE table_name_20 (
team VARCHAR,
pos VARCHAR
) | Which team is in 14th position? | SELECT team FROM table_name_20 WHERE pos = "14th" | sql_create_context |
CREATE TABLE table_name_27 (
club VARCHAR,
position_in_2012_13 VARCHAR
) | When the position in 2012-23 is 4th, second division what is the club? | SELECT club FROM table_name_27 WHERE position_in_2012_13 = "4th, second division" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | what are the four diagnoses with the lowest two year survival rate? | SELECT t4.diagnosisname FROM (SELECT t3.diagnosisname, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.diagnosisname, 100 - SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 10... | eicu |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text... | 患者53751020全部检验报告单中的标本采集部位在2000年10月30日到2002年2月6日内都是哪一部位? | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '53751020' AND jybgb.BGRQ BETWEEN '2000-10-30' AND '2002-02-06' UNI... | css |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 列出8322376这个医院内有多少科室在2003年5月20日到2018年4月7日期间涉及的医疗费总额高于7725.47元 | SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '8322376' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-05-20' AND '2018-04-07' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 7725.47 UNION SELECT fgwyjzb.... | css |
CREATE TABLE table_2467150_2 (
tdp VARCHAR,
model__list_ VARCHAR
) | What is every value for TDP if model is x53xx? | SELECT tdp FROM table_2467150_2 WHERE model__list_ = "X53xx" | sql_create_context |
CREATE TABLE table_11622771_1 (
location VARCHAR,
tournament VARCHAR
) | Where was the Fairfield Barnett classic tournament held? | SELECT location FROM table_11622771_1 WHERE tournament = "Fairfield Barnett Classic" | sql_create_context |
CREATE TABLE table_name_46 (
record_label VARCHAR,
title VARCHAR
) | Which Record label has a Title of ? | SELECT record_label FROM table_name_46 WHERE title = "诀别诗" | sql_create_context |
CREATE TABLE table_name_47 (
film VARCHAR,
ceremony VARCHAR,
name VARCHAR
) | What is the Film with winner Jerome Kern in the 19th Ceremony? | SELECT film FROM table_name_47 WHERE ceremony = "19th" AND name = "jerome kern" | sql_create_context |
CREATE TABLE table_name_9 (
label VARCHAR,
date VARCHAR
) | What label released a record on March 25, 1984? | SELECT label FROM table_name_9 WHERE date = "march 25, 1984" | sql_create_context |
CREATE TABLE table_name_16 (
rank VARCHAR,
games VARCHAR,
player VARCHAR
) | How many players played over 125 games and were named david gonzalvez? | SELECT COUNT(rank) FROM table_name_16 WHERE games > 125 AND player = "david gonzalvez" | sql_create_context |
CREATE TABLE table_name_20 (
college VARCHAR,
round__number VARCHAR
) | What is the College with a Round # that is 290? | SELECT college FROM table_name_20 WHERE round__number = 290 | sql_create_context |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE month (
... | information on flights from PITTSBURGH to SAN FRANCISCO | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN... | atis |
CREATE TABLE table_name_61 (
record VARCHAR,
week VARCHAR,
date VARCHAR
) | What's the record for October 8, 2000 before week 13? | SELECT record FROM table_name_61 WHERE week < 13 AND date = "october 8, 2000" | sql_create_context |
CREATE TABLE table_name_42 (
name VARCHAR,
release_date VARCHAR,
location VARCHAR
) | What is the name with a release date of December 1966, and a Location of UK? | SELECT name FROM table_name_42 WHERE release_date = "december 1966" AND location = "uk" | sql_create_context |
CREATE TABLE table_name_79 (
snatch INTEGER,
total__kg_ INTEGER
) | How much Snatch has a Total (kg) smaller than 257? | SELECT SUM(snatch) FROM table_name_79 WHERE total__kg_ < 257 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
... | 患者82905019在2000年9月22日到2002年6月22日内有多少就诊医生? | SELECT COUNT(mzjzjlb.ZZYSGH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '82905019' AND mzjzjlb.JZKSRQ BETWEEN '2000-09-22' AND '2002-06-22' | css |
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... | Visualize a bar chart about the distribution of All_Home and the average of Team_ID , and group by attribute All_Home. | SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home | nvbench |
CREATE TABLE table_name_89 (
tie_no INTEGER,
away_team VARCHAR
) | What was the tie number for the round against visiting opponent Chelsea? | SELECT SUM(tie_no) FROM table_name_89 WHERE away_team = "chelsea" | sql_create_context |
CREATE TABLE table_name_40 (
longest_span_in_s_metre___feet__ VARCHAR,
location VARCHAR
) | How long is the bridge in Villeneuve-sur-Lot? | SELECT longest_span_in_s_metre___feet__ FROM table_name_40 WHERE location = "villeneuve-sur-lot" | sql_create_context |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
) | Show me a bar chart for how many movie reviews does each director get? | SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director | nvbench |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),... | List the number of enrolment students in each day and bin date of enrolment by weekday with a bar chart, and could you show Y-axis in descending order? | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) DESC | nvbench |
CREATE TABLE Products_in_Events (
Product_ID VARCHAR
)
CREATE TABLE Products (
Product_Name VARCHAR,
Product_ID VARCHAR
) | Show the names of products that are in at least two events in ascending alphabetical order of product name. | SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name HAVING COUNT(*) >= 2 ORDER BY T1.Product_Name | sql_create_context |
CREATE TABLE table_201_34 (
id number,
"year" number,
"film" text,
"role" text,
"notes" text
) | how many times was nina hagan the evil queen ? | SELECT COUNT(*) FROM table_201_34 WHERE "role" = 'the evil queen' | squall |
CREATE TABLE table_name_77 (
date VARCHAR,
attendance VARCHAR
) | Attendance of 35,842 had what date? | SELECT date FROM table_name_77 WHERE attendance = "35,842" | sql_create_context |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE 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,
... | 患者44236721有哪几次医疗就诊被开出过金额在2819.61元以下的药品?列出对应的医疗就诊编号 | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '44236721' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2819.61) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '44236721' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLI... | css |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_... | what are the 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 train_station (
Train_ID int,
Station_ID int
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train (
Train_ID ... | Show all locations and the total number of platforms for all train stations in each location in a bar chart, and order by the y-axis in desc. | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) DESC | nvbench |
CREATE TABLE accounts (
account_id number,
customer_id number,
date_account_opened time,
account_name text,
other_account_details text
)
CREATE TABLE products (
product_id number,
parent_product_id number,
production_type_code text,
unit_price number,
product_name text,
prod... | How many customers have opened an account? | SELECT COUNT(DISTINCT customer_id) FROM accounts | spider |
CREATE TABLE table_75411 (
"Almal\u0131 (Qax)" text,
"F\u0131st\u0131ql\u0131" text,
"Malax" text,
"Qaxmu\u011fal" text,
"S\u00fcsk\u0259n" text
) | What is the S sk n village with a Malax village me ba ? | SELECT "S\u00fcsk\u0259n" FROM table_75411 WHERE "Malax" = 'meşəbaş' | wikisql |
CREATE TABLE table_name_76 (
position VARCHAR,
round VARCHAR
) | What is the position played for the player drafted in round 2? | SELECT position FROM table_name_76 WHERE round = 2 | sql_create_context |
CREATE TABLE table_19214 (
"Name" text,
"2011 Census" real,
"2006 Census" real,
"% change" text,
"Land area (km\u00b2)" text,
"Density (pop/km\u00b2)" text,
"Population rank" real
) | When the population rank is 34, what the is % change? | SELECT "% change" FROM table_19214 WHERE "Population rank" = '34' | wikisql |
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Ra... | Show the number of male and female assistant professors Plot them as bar chart, and I want to display y axis in descending order. | SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
... | can you list all flights from CHICAGO to MILWAUKEE | 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 = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAU... | atis |
CREATE TABLE table_name_70 (
season_outcome VARCHAR,
school VARCHAR
) | What is the Season Outcome, when the School is Sussex Tech? | SELECT season_outcome FROM table_name_70 WHERE school = "sussex tech" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Les 7 premiers utilisateurs ayant 30 ans. | SELECT DisplayName FROM Users WHERE age = 30 ORDER BY DisplayName LIMIT 7 | sede |
CREATE TABLE table_203_145 (
id number,
"position" number,
"club" text,
"played" number,
"points" text,
"wins" number,
"draws" number,
"losses" number,
"goals for" number,
"goals against" number,
"goal difference" number
) | what are the number of times 13 or greater was listed in the wins column ? | SELECT COUNT(*) FROM table_203_145 WHERE "wins" >= 13 | squall |
CREATE TABLE table_name_50 (
date VARCHAR,
ground VARCHAR,
opponent VARCHAR
) | What is the date ground A and Cartagena as an opponent? | SELECT date FROM table_name_50 WHERE ground = "a" AND opponent = "cartagena" | sql_create_context |
CREATE TABLE Companies (
Headquarters VARCHAR
) | Show the headquarters shared by more than two companies. | SELECT Headquarters FROM Companies GROUP BY Headquarters HAVING COUNT(*) > 2 | sql_create_context |
CREATE TABLE table_50898 (
"Round" text,
"St Kilda Saints" text,
"Opposition" text,
"Their Score" text,
"Margin" real
) | What is the average Margin that has a Round of 13. (h)? | SELECT AVG("Margin") FROM table_50898 WHERE "Round" = '13. (h)' | wikisql |
CREATE TABLE table_6464 (
"English name" text,
"Bulgarian name" text,
"Bulgarian name ( Transliteration )" text,
"Old Bulgarian Names" text,
"Old Bulgarian name (Transliteration)" text,
"Old Bulgarian name - Meaning" text
) | What's the bulgarian word for January? | SELECT "Bulgarian name" FROM table_6464 WHERE "English name" = 'january' | wikisql |
CREATE TABLE table_56887 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Which lap number had a grid number of less than 17 when the driver was Giancarlo Fisichella? | SELECT COUNT("Laps") FROM table_56887 WHERE "Grid" < '17' AND "Driver" = 'giancarlo fisichella' | wikisql |
CREATE TABLE table_15589 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
) | How many losses were there with 208 points? | SELECT "Lost" FROM table_15589 WHERE "Points for" = '208' | wikisql |
CREATE TABLE table_name_85 (
sprint INTEGER,
wins VARCHAR,
feature VARCHAR
) | How many sprints on average had 10 wins and less than 5 features? | SELECT AVG(sprint) FROM table_name_85 WHERE wins = 10 AND feature < 5 | sql_create_context |
CREATE TABLE table_16953 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
) | What was the minimal amount ($) of the 1st prize in the tournaments in New Mexico? | SELECT MIN("1st Prize( $ )") FROM table_16953 WHERE "Location" = 'New Mexico' | wikisql |
CREATE TABLE table_12660 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Location" text
) | What is the brand where the location is Cagayan De Oro? | SELECT "Branding" FROM table_12660 WHERE "Location" = 'cagayan de oro' | wikisql |
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, draw a bar chart about the distribution of name and price , and group by attribute name, and show by the y axis in descending. | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Price DESC | nvbench |
CREATE TABLE table_name_42 (
wins VARCHAR,
byes VARCHAR,
losses VARCHAR,
against VARCHAR
) | What is the total number of Wins, when Losses is less than 10, when Against is less than 1253, and when Byes is less than 0? | SELECT COUNT(wins) FROM table_name_42 WHERE losses < 10 AND against < 1253 AND byes < 0 | sql_create_context |
CREATE TABLE chip_model (
model_name text,
launch_year number,
ram_mib number,
rom_mib number,
slots text,
wifi text,
bluetooth text
)
CREATE TABLE phone (
company_name text,
hardware_model_name text,
accreditation_type text,
accreditation_level text,
date text,
chip... | Which model has the least amount of RAM? List the model name and the amount of RAM. | SELECT model_name, ram_mib FROM chip_model ORDER BY ram_mib LIMIT 1 | spider |
CREATE TABLE table_67463 (
"Minister" text,
"Party" text,
"Governments" text,
"Term start" text,
"Term end" text
) | Who is the minister with a term end on 10 March 1974? | SELECT "Minister" FROM table_67463 WHERE "Term end" = '10 march 1974' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | 在10年2月2日到10年12月21日内病患02315348主要看的医生是哪一个? | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '02315348' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-02-02' AND '2010-12-21' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_name_17 (
opponent VARCHAR,
event VARCHAR
) | What is Opponent, when Event is 'ISCF - Southeast Championships'? | SELECT opponent FROM table_name_17 WHERE event = "iscf - southeast championships" | sql_create_context |
CREATE TABLE table_41120 (
"Stage (Winner)" text,
"General Classification" text,
"Young Classification" text,
"Mountains Classification" text,
"Sprint Classification" text,
"Team Classification" text
) | Which young classification has general classification of Christian Vande Velde for Team Columbia and Mark Cavendish? | SELECT "Young Classification" FROM table_41120 WHERE "General Classification" = 'christian vande velde' AND "Team Classification" = 'team columbia' AND "Sprint Classification" = 'mark cavendish' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | Bar chart of minimal price from each name, and order y axis in asc order. | SELECT Name, MIN(Price) FROM Products GROUP BY Name ORDER BY MIN(Price) | nvbench |
CREATE TABLE table_68108 (
"Year" text,
"Team" text,
"TTkl" real,
"Solo" real,
"Sacks" real,
"Pass Def" real
) | What is the average pass def that has green bay packers as the team, 62 as the solo and sacks less than 2? | SELECT AVG("Pass Def") FROM table_68108 WHERE "Team" = 'green bay packers' AND "Solo" = '62' AND "Sacks" < '2' | wikisql |
CREATE TABLE table_24565004_13 (
period VARCHAR,
name VARCHAR
) | Name the period for michel llodra | SELECT period FROM table_24565004_13 WHERE name = "Michel Llodra" | sql_create_context |
CREATE TABLE table_name_46 (
Id VARCHAR
) | Which 2012 has a 2010 of 0 0? | SELECT 2012 FROM table_name_46 WHERE 2010 = "0–0" | sql_create_context |
CREATE TABLE table_47830 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
) | Which college has a pick # 84 in round 3? | SELECT "College" FROM table_47830 WHERE "Round" = '3' AND "Pick #" = '84' | wikisql |
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
) | What are the ids of all moviest hat have not been reviewed by Britanny Harris? | SELECT mid FROM rating EXCEPT SELECT T1.mid FROM rating AS T1 JOIN reviewer AS T2 ON T1.rid = T2.rid WHERE T2.name = "Brittany Harris" | spider |
CREATE TABLE table_61833 (
"Seat" real,
"Season 1" text,
"Season 2" text,
"Season 3" text,
"Season 6" text,
"Season 7" text
) | Which Season 7 has a Season 6 of jim treliving? | SELECT "Season 7" FROM table_61833 WHERE "Season 6" = 'jim treliving' | wikisql |
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 drug route of subject name paul edwards? | SELECT prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Paul Edwards" | mimicsql_data |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Give me the comparison about ACC_Percent over the All_Neutral , order total number in asc order. | SELECT All_Neutral, ACC_Percent FROM basketball_match ORDER BY ACC_Percent | nvbench |
CREATE TABLE table_70681 (
"Application" text,
"Expected Speed Up\u2020" text,
"GPU\u2021" text,
"Multi-GPU Support" text,
"Release Status" text
) | What is the expected speed up of the gpu-hmmer application? | SELECT "Expected Speed Up\u2020" FROM table_70681 WHERE "Application" = 'gpu-hmmer' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varc... | At what time do WRITING 240 lectures start next semester ? | SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'WRITING' AND course... | advising |
CREATE TABLE table_name_91 (
home_team VARCHAR,
venue VARCHAR
) | Which Home team plays at the arden street oval Venue? | SELECT home_team FROM table_name_91 WHERE venue = "arden street oval" | sql_create_context |
CREATE TABLE table_25030512_41 (
result VARCHAR,
incumbent VARCHAR
) | Name the result for glenn thompson | SELECT result FROM table_25030512_41 WHERE incumbent = "Glenn Thompson" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | had patient 029-22492 been prescribed until 02/2105 morphine, ondansetron, or vancomycin consult to pharmacy? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-22492')) AND medication.drugname IN ('morphine', 'ondansetron', 'vanco... | eicu |
CREATE TABLE table_204_923 (
id number,
"club" text,
"entered\nadministration" text,
"exited\nadministration" text,
"league(s)" text,
"deduction(s)" text
) | what is the total number of teams that entered administration in 1992 ? | SELECT COUNT(*) FROM table_204_923 WHERE "entered\nadministration" = 1992 | squall |
CREATE TABLE circuits (
circuitId INTEGER,
circuitRef TEXT,
name TEXT,
location TEXT,
country TEXT,
lat REAL,
lng REAL,
alt TEXT,
url TEXT
)
CREATE TABLE races (
raceId INTEGER,
year INTEGER,
round INTEGER,
circuitId INTEGER,
name TEXT,
date TEXT,
time TE... | How many races that had any driver whose forename is Lewis? Show me a line chart, rank by the X in asc please. | SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" ORDER BY year | nvbench |
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 regions (
REGION_ID decimal(5,0),
... | For those employees who was hired before 2002-06-21, a bar chart shows the distribution of hire_date and the sum of manager_id bin hire_date by time, list Y-axis in asc order. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID) | nvbench |
CREATE TABLE company (
Name VARCHAR,
Company_ID VARCHAR
)
CREATE TABLE employment (
People_ID VARCHAR,
Company_ID VARCHAR,
Year_working VARCHAR
)
CREATE TABLE people (
Name VARCHAR,
People_ID VARCHAR
) | Show names of companies and that of employees in descending order of number of years working for that employee. | SELECT T3.Name, T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID ORDER BY T1.Year_working | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.