context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_4981 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2012" text,
"2013" text
) | What is the value in 2013 when it is 1R in 2007 and 2009? | SELECT "2013" FROM table_4981 WHERE "2007" = '1r' AND "2009" = '1r' | wikisql |
CREATE TABLE table_203_577 (
id number,
"tenure" text,
"coach" text,
"years" number,
"record" text,
"pct." number
) | who was coach before tilden campbell ? | SELECT "coach" FROM table_203_577 WHERE id = (SELECT id FROM table_203_577 WHERE "coach" = 'tilden campbell') - 1 | squall |
CREATE TABLE Student_Addresses (
student_id INTEGER,
address_id INTEGER,
date_address_from DATETIME,
date_address_to DATETIME,
monthly_rental DECIMAL(19,4),
other_details VARCHAR(255)
)
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGE... | Give me the comparison about the amount of date_address_from over the date_address_from , and group by attribute other_details and bin date_address_from by weekday. | SELECT date_address_from, COUNT(date_address_from) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_name_66 (
iata VARCHAR,
icao VARCHAR
) | For an ICAO of VCCT, what is the IATA? | SELECT iata FROM table_name_66 WHERE icao = "vcct" | sql_create_context |
CREATE TABLE table_43347 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the number of gold when the silver is 1, bronze is 1, and the nation is Austria? | SELECT COUNT("Gold") FROM table_43347 WHERE "Silver" = '1' AND "Bronze" = '1' AND "Nation" = 'austria' | wikisql |
CREATE TABLE table_name_85 (
country VARCHAR,
icao VARCHAR
) | What country has an ICAO of ENZV? | SELECT country FROM table_name_85 WHERE icao = "enzv" | sql_create_context |
CREATE TABLE table_name_99 (
gold VARCHAR,
rank VARCHAR,
bronze VARCHAR
) | How many Golds did Rank 10 get, with a Bronze larger than 2? | SELECT COUNT(gold) FROM table_name_99 WHERE rank = "10" AND bronze > 2 | sql_create_context |
CREATE TABLE table_name_79 (
result VARCHAR,
date VARCHAR
) | What was the result of the game on January 5, 1926? | SELECT result FROM table_name_79 WHERE date = "january 5, 1926" | sql_create_context |
CREATE TABLE Invoices (
Invoice_ID INTEGER,
Order_ID INTEGER,
payment_method_code CHAR(15),
Product_ID INTEGER,
Order_Quantity VARCHAR(288),
Other_Item_Details VARCHAR(255),
Order_Item_ID INTEGER
)
CREATE TABLE Customer_Orders (
Order_ID INTEGER,
Customer_ID INTEGER,
Store_ID IN... | A bar chart for giveing me the number of the descriptions of the service types that cost more than 100. | SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description | nvbench |
CREATE TABLE table_name_80 (
city_of_license VARCHAR,
frequency INTEGER
) | What is City of License, when Frequency is greater than 1380? | SELECT city_of_license FROM table_name_80 WHERE frequency > 1380 | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id numbe... | how much does it cost to get checked for fall from ladder? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fall from ladder')) | mimic_iii |
CREATE TABLE table_18091 (
"#" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Originalairdate" text,
"Repeatairdate(s)" text,
"Prod.Code" text
) | what is the prod.code of the episode with original air date 01/12/1968? | SELECT COUNT("Prod.Code") FROM table_18091 WHERE "Originalairdate" = '01/12/1968' | wikisql |
CREATE TABLE table_47122 (
"Period" text,
"Team" text,
"Player" text,
"Penalty" text,
"Time" text
) | What team was the player that received a penalty at time 32:17 playing for? | SELECT "Team" FROM table_47122 WHERE "Time" = '32:17' | wikisql |
CREATE TABLE table_38407 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | How many Wins have a Scored smaller than 24, and a Conceded larger than 25, and Draws larger than 5, and a Position smaller than 9? | SELECT COUNT("Wins") FROM table_38407 WHERE "Scored" < '24' AND "Conceded" > '25' AND "Draws" > '5' AND "Position" < '9' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
la... | has patient 015-94586 ever undergone a bronchodilator? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-94586')) AND treatment.treatmentname = 'bronchodilator' | eicu |
CREATE TABLE table_2562572_35 (
population__2011_ VARCHAR,
settlement VARCHAR
) | Name the population 2011 for mihajlovo | SELECT COUNT(population__2011_) FROM table_2562572_35 WHERE settlement = "Mihajlovo" | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostHistory (
Id number,
PostHistoryT... | Questions by summed rep of the answerers. | SELECT QuestionId AS "post_link", QuestionId, COUNT(*) AS AnswererNo, SUM(CAST(AnswererRep AS INT)) AS SumAnswererRep FROM (SELECT DISTINCT Q.Id AS QuestionId, Users.Id AS AnswererId, Users.Reputation AS AnswererRep FROM Posts AS Q, Posts AS A, Users WHERE A.ParentId = Q.Id AND Users.Id = A.OwnerUserId AND Q.ClosedDate... | sede |
CREATE TABLE table_name_13 (
name VARCHAR,
population VARCHAR
) | What name has a population of 810? | SELECT name FROM table_name_13 WHERE population = "810" | sql_create_context |
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
pr... | Show the number of accounts opened in each year for all accounts in a line chart. | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | 患者53311855自二零零四年八月二日开始,截止到二零一七年一月二十九日,由哪几位医务人员为其检测二氧化碳的,查查这些医务人员的工号及姓名 | (SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb... | css |
CREATE TABLE table_33556 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which venue had a crowd larger than 20,000? | SELECT "Venue" FROM table_33556 WHERE "Crowd" > '20,000' | wikisql |
CREATE TABLE table_69778 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"10:00" text,
"10:30" text
) | for the 10:00 of the simple life what is the 9:00? | SELECT "9:00" FROM table_69778 WHERE "10:00" = 'the simple life' | wikisql |
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... | 以往患者77965758进行过哪些治疗? | 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_ID = '77965758' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' | css |
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... | Draw a bar chart about the distribution of ACC_Road and the sum of Team_ID , and group by attribute ACC_Road, sort in descending by the X. | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is the number of patients whose insurance is government and procedure icd9 code is 4439? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.icd9_code = "4439" | mimicsql_data |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS va... | For all employees who have the letters D or S in their first name, a line chart shows the change of manager_id over hire_date, and sort HIRE_DATE in descending order. | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_2252745_1 (
population_2008_07_01 INTEGER,
administrative_centre VARCHAR
) | What is the max pop of 2008 for selfoss? | SELECT MAX(population_2008_07_01) FROM table_2252745_1 WHERE administrative_centre = "Selfoss" | sql_create_context |
CREATE TABLE table_23649244_2 (
release_date VARCHAR,
artist_1 VARCHAR
) | If artist 1 is Wolfgang Gartner, what is the release date? | SELECT release_date FROM table_23649244_2 WHERE artist_1 = "Wolfgang Gartner" | sql_create_context |
CREATE TABLE table_3172 (
"Place Name" text,
"County(ies) [A ]" text,
"Population (2010)" real,
"Land Area (2010)" text,
"Density (2010)" text
) | How many counties have a place name of Macedonia? | SELECT COUNT("County(ies) [A ]") FROM table_3172 WHERE "Place Name" = 'Macedonia' | wikisql |
CREATE TABLE table_name_96 (
crowd INTEGER,
venue VARCHAR
) | What is the smallest Crowd number for the Venue named Princes Park? | SELECT MIN(crowd) FROM table_name_96 WHERE venue = "princes park" | sql_create_context |
CREATE TABLE table_62260 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"Facility ID" real,
"ERP W" real,
"Height m ( ft )" text,
"Class" text,
"FCC info" text
) | Which Call sign has an ERP W of 75? | SELECT "Call sign" FROM table_62260 WHERE "ERP W" = '75' | wikisql |
CREATE TABLE table_55381 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the football Bronze with more than 1 Silver? | SELECT AVG("Bronze") FROM table_55381 WHERE "Sport" = 'football' AND "Silver" > '1' | wikisql |
CREATE TABLE table_9135 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What date did the away team Mansfield Town play? | SELECT "Date" FROM table_9135 WHERE "Away team" = 'mansfield town' | wikisql |
CREATE TABLE table_name_28 (
round VARCHAR,
opponent VARCHAR
) | In what round was Clyde the opponent? | SELECT round FROM table_name_28 WHERE opponent = "clyde" | 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... | what is the number of patients diagnosed for human immuno virus dis with iv drug route? | 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 = "Human immuno virus dis" AND prescriptions.route = "IV" | mimicsql_data |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
E... | Top iOS Users in Madrid. | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | sede |
CREATE TABLE table_18393 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Who's the incumbent of Indiana 4 district? | SELECT "Incumbent" FROM table_18393 WHERE "District" = 'Indiana 4' | wikisql |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 从零零年一月二十四号到零四年四月十四号,患者85533304这个甲状腺摄取实验情况怎么样 | SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),... | How many students taking a course who received an A or C? Group by students' first name with a bar chart, and show by the how many stu fname in asc please. | SELECT STU_FNAME, COUNT(STU_FNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_FNAME ORDER BY COUNT(STU_FNAME) | nvbench |
CREATE TABLE table_204_664 (
id number,
"rank" number,
"bib" number,
"name" text,
"nationality" text,
"start" text,
"penalties (p+p+s+s)" text,
"time" text,
"deficit" text
) | how many united states competitors did not win medals ? | SELECT COUNT(*) FROM table_204_664 WHERE "nationality" = 'united states' AND NOT "rank" IS NULL | squall |
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 13948798患者头部的各项指标检验结果是什么? | SELECT * FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
Hours_Played INTEGER
)
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 Video_Games (
Ga... | Bar chart x axis sportname y axis the total number | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName | nvbench |
CREATE TABLE table_55029 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
) | Did Jason Pennycooke win the award he was nominated for? | SELECT "Result" FROM table_55029 WHERE "Nominee" = 'jason pennycooke' | wikisql |
CREATE TABLE table_47677 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What was Jim Colbert's score? | SELECT "Score" FROM table_47677 WHERE "Player" = 'jim colbert' | wikisql |
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,
... | tell me the first procedure patient 029-7028 had last year? | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-7028')) AND DATETIME(treatment.treatmenttime, 'start of year'... | eicu |
CREATE TABLE table_54561 (
"Name" text,
"Current version" text,
"System" text,
"Platform" text,
"License" text
) | Who has a license of proprietary (available on inquiry)? | SELECT "Name" FROM table_54561 WHERE "License" = 'proprietary (available on inquiry)' | wikisql |
CREATE TABLE table_45093 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the highest total for bronze with a gold larger than 0, a silver smaller than 5, and a total of 15? | SELECT MAX("Bronze") FROM table_45093 WHERE "Gold" > '0' AND "Total" = '15' AND "Silver" < '5' | wikisql |
CREATE TABLE table_34537 (
"Name" text,
"Town/City" text,
"Borough" text,
"Region" text,
"Type" text
) | In what Borough is the History Type Fairbanks Community Museum? | SELECT "Borough" FROM table_34537 WHERE "Type" = 'history' AND "Name" = 'fairbanks community museum' | wikisql |
CREATE TABLE table_name_70 (
college VARCHAR,
pos VARCHAR,
conf VARCHAR
) | What is the College of the LB Player with Big Ten Conf.? | SELECT college FROM table_name_70 WHERE pos = "lb" AND conf = "big ten" | sql_create_context |
CREATE TABLE table_32437 (
"Conference" text,
"# of Bids" real,
"Record" text,
"Win %" text,
"Round of 32" text,
"Sweet Sixteen" text,
"Elite Eight" text,
"Final Four" text,
"Championship Game" text
) | How many bids were there for the .500 win percentage in the Ohio Valley conference? | SELECT SUM("# of Bids") FROM table_32437 WHERE "Win %" = '.500' AND "Conference" = 'ohio valley' | wikisql |
CREATE TABLE table_54739 (
"Date" real,
"Country" text,
"Place" text,
"Building" text,
"Size" text
) | Name the country that has m ntt | SELECT "Country" FROM table_54739 WHERE "Place" = 'mänttä' | wikisql |
CREATE TABLE table_name_78 (
pick VARCHAR,
position VARCHAR,
nationality VARCHAR,
college_high_school_club VARCHAR
) | What was the pick number for the person from the United States who as drafted to the SF position from North Carolina? | SELECT pick FROM table_name_78 WHERE nationality = "united states" AND college_high_school_club = "north carolina" AND position = "sf" | sql_create_context |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
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,
flight_id int,
flight_number ... | what are the afternoon flights from ATLANTA to BALTIMORE | 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 = 'BALTI... | atis |
CREATE TABLE table_2311410_1 (
series_premiere VARCHAR,
season VARCHAR
) | How many series premieres did the season 'All-stars' have? | SELECT COUNT(series_premiere) FROM table_2311410_1 WHERE season = "All-Stars" | sql_create_context |
CREATE TABLE table_name_62 (
time VARCHAR,
reaction_time VARCHAR,
lane VARCHAR
) | How many Times have a Reaction Time larger than 0.17500000000000002, and a Lane of 3? | SELECT COUNT(time) FROM table_name_62 WHERE reaction_time > 0.17500000000000002 AND lane = 3 | sql_create_context |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 从2007年11月6日开始,截止到2012年5月8日,请把47198797的这位病人总共被开出的检验报告单的审核日期时间给列出来 | (SELECT jybgb.SHSJ 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 = '47198797' AND jybgb.BGRQ BETWEEN '2007-11-06' AND '2012-05-08') UNI... | css |
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,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | 编号为28349097的病患的检验报告单的报告日期在15年4月17日之后的是哪些住院就诊的?列出流水号 | SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '28349097' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2015-04-17') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN... | css |
CREATE TABLE table_name_56 (
package_option VARCHAR,
television_service VARCHAR,
content VARCHAR,
hdtv VARCHAR
) | What package/option has documentaries as the content, yes as the HDTV, and a television service of history hd? | SELECT package_option FROM table_name_56 WHERE content = "documentaries" AND hdtv = "yes" AND television_service = "history hd" | sql_create_context |
CREATE TABLE table_60102 (
"Date" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Scorers" text
) | When was the game played against Astley Bridge 'a'? | SELECT "Date" FROM table_60102 WHERE "Opponents" = 'astley bridge ''a' | wikisql |
CREATE TABLE table_name_31 (
laps INTEGER,
grid VARCHAR,
time_retired VARCHAR
) | How many laps for a grid of over 18 and retired due to electrical failure? | SELECT SUM(laps) FROM table_name_31 WHERE grid > 18 AND time_retired = "electrical" | sql_create_context |
CREATE TABLE table_65756 (
"Competition" text,
"Played" real,
"Spartak" real,
"Draw" real,
"Dynamo" real
) | what is the sum of spartak when played is 102 and draw is less than 19? | SELECT SUM("Spartak") FROM table_65756 WHERE "Played" = '102' AND "Draw" < '19' | wikisql |
CREATE TABLE table_27885 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | What was the dominant religion in 2002 of the settlement with the cyrillic and other name of (romanian: voivodin )? | SELECT "Dominant religion (2002)" FROM table_27885 WHERE "Cyrillic Name Other Names" = 'Војводинци (Romanian: Voivodinţ)' | 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... | Create a bar chart showing school_id across all neutral, and rank by the School_ID from high to low. | SELECT All_Neutral, School_ID FROM basketball_match ORDER BY School_ID DESC | nvbench |
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... | 列出患者金嘉丽的医疗记录中每一次被开出的药品金额不低于4769.0元的医疗就诊编号 | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '金嘉丽' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 4769.0) | css |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | calculate the total number of patients who had sm bowel endoscopy nec | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Sm bowel endoscopy NEC" | mimicsql_data |
CREATE TABLE table_32154 (
"Year" text,
"Division" real,
"League" text,
"Reg. Season" text,
"Playoffs" text
) | Which division has no playoff but has a 12th game in their season? | SELECT MAX("Division") FROM table_32154 WHERE "Playoffs" = 'no playoff' AND "Reg. Season" = '12th' | wikisql |
CREATE TABLE table_62728 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was the score for the game that attendance was 70,721? | SELECT "Result" FROM table_62728 WHERE "Attendance" = '70,721' | wikisql |
CREATE TABLE table_50022 (
"Speed" text,
"Craft" text,
"Pilot(s)" text,
"Location" text,
"Date" text
) | Who was the pilot at lake dumbleyung? | SELECT "Pilot(s)" FROM table_50022 WHERE "Location" = 'lake dumbleyung' | wikisql |
CREATE TABLE table_60332 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
) | What is the number of points of the match with less than 22 games played? | SELECT COUNT("Points") FROM table_60332 WHERE "Games played" < '22' | wikisql |
CREATE TABLE table_59521 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What is Gene Sauers' to par? | SELECT "To par" FROM table_59521 WHERE "Player" = 'gene sauers' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE cours... | Out of the upper-level classes this Fall are any MCDB classes ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MCDB' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fall' ... | advising |
CREATE TABLE table_203_530 (
id number,
"country" text,
"gdp (usd bln, 2012)" number,
"gdp (usd bln, 2017)" number,
"gdp (usd ppp bln, 2012)" number,
"gdp (usd ppp bln, 2017)" number,
"per capita (usd, 2012)" number,
"per capita (usd, 2017)" number,
"per capita (usd ppp, 2012)" numbe... | how many countries had at least a gdp -lrb- usd bin -rrb- of eight or greater in 2012 ? | SELECT COUNT("country") FROM table_203_530 WHERE "gdp (usd bln, 2012)" >= 8 | squall |
CREATE TABLE table_24151 (
"Season" text,
"Games" real,
"Won" real,
"Lost" real,
"Tied" real,
"Points" real,
"Pct %" text,
"Goals For" real,
"Goals Against" real,
"Standing" text
) | What were the points in the 1958-59 season? | SELECT "Points" FROM table_24151 WHERE "Season" = '1958-59' | wikisql |
CREATE TABLE table_50659 (
"Fin. Pos" text,
"Car No." text,
"Driver" text,
"Team" text,
"Laps" text,
"Time/Retired" text,
"Grid" text,
"Laps Led" text,
"Points" text
) | What is the grid of driver tomas scheckter from vision racing team? | SELECT "Grid" FROM table_50659 WHERE "Team" = 'vision racing' AND "Driver" = 'tomas scheckter' | wikisql |
CREATE TABLE table_23958944_2 (
written_by VARCHAR,
no_by_series VARCHAR
) | How many different writers have written the episode with series number 8? | SELECT COUNT(written_by) FROM table_23958944_2 WHERE no_by_series = 8 | 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(2... | For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the sum of salary bin hire_date by time, and visualize them by a bar chart, and order y-axis in asc order. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_4577 (
"Commodity" text,
"2001-02" text,
"2002-03" text,
"2003-04" text,
"2004-05" text,
"2005-06" text,
"2006-07" text
) | What was the production in 2005-06 for the commodity that produced 1,175 in 2001-02? | SELECT "2005-06" FROM table_4577 WHERE "2001-02" = '1,175' | wikisql |
CREATE TABLE table_name_52 (
gold INTEGER,
silver VARCHAR,
bronze VARCHAR
) | What is the lowest Gold, when Silver is 0, and when Bronze is 2? | SELECT MIN(gold) FROM table_name_52 WHERE silver = 0 AND bronze = 2 | sql_create_context |
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id ... | Show the number of brand from each brand, order total number in ascending order. | SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand ORDER BY COUNT(brand) | nvbench |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
A... | Show the name of each party and the corresponding number of delegates from that party in a bar chart. | SELECT T2.Party, AVG(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party | nvbench |
CREATE TABLE table_20218 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text,
"Pictorials" text
) | Who was the cover model in the 7-86 issue? | SELECT "Cover model" FROM table_20218 WHERE "Date" = '7-86' | wikisql |
CREATE TABLE mzb (
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... | 查一下范升荣这个病人的医疗记录中,有哪几次医疗记录中被开出过金额超过5540.22元的药品?列出医疗就诊编码 | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '范升荣' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 5540.22) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '范升荣' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 5540.... | css |
CREATE TABLE table_1965650_10 (
college_junior_club_team VARCHAR,
player VARCHAR
) | What team does Lee Palmer play for? | SELECT college_junior_club_team FROM table_1965650_10 WHERE player = "Lee Palmer" | sql_create_context |
CREATE TABLE table_7957 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the sum of Total ranking 9 and a Gold more than 6 | SELECT SUM("Total") FROM table_7957 WHERE "Rank" = '9' AND "Gold" > '6' | wikisql |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_stop (
flight_id int,
stop... | what are the flights from BOSTON 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA... | atis |
CREATE TABLE table_65243 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) | What is total number of years that has genre of first-person shooter? | SELECT SUM("Year") FROM table_65243 WHERE "Genre" = 'first-person shooter' | wikisql |
CREATE TABLE table_27293285_6 (
drawn VARCHAR,
won VARCHAR
) | How many matches were drawn by the teams that won exactly 10? | SELECT COUNT(drawn) FROM table_27293285_6 WHERE won = "10" | sql_create_context |
CREATE TABLE table_54146 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many people attended the game that resulted in an away team score of 18.17 (125)? | SELECT SUM("Crowd") FROM table_54146 WHERE "Away team score" = '18.17 (125)' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
C... | how many patients whose insurance is government and lab test name is % hemoglobin a1c? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "% Hemoglobin A1c" | mimicsql_data |
CREATE TABLE table_11545282_4 (
player VARCHAR,
years_for_jazz VARCHAR
) | Who are the players that played for the jazz from 1979-86 | SELECT player FROM table_11545282_4 WHERE years_for_jazz = "1979-86" | sql_create_context |
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
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 schedule... | A bar chart showing the average of capacity of cinemas open for each year, sort in asc by the names. | SELECT Openning_year, AVG(Capacity) FROM cinema GROUP BY Openning_year ORDER BY Openning_year | nvbench |
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),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who did not have any job in the past, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_25881 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who tied for highest rebounds in game 29? | SELECT "High rebounds" FROM table_25881 WHERE "Game" = '29' | wikisql |
CREATE TABLE table_37512 (
"Season" text,
"Competition" text,
"Round" text,
"Against" text,
"Played" text,
"Drew" text,
"Lost" text,
"Goals for" text,
"Goals against" text
) | Which season did not qualify for UEFA competitions? | SELECT "Season" FROM table_37512 WHERE "Against" = 'did not qualify for uefa competitions' | wikisql |
CREATE TABLE table_7845 (
"Species" text,
"Species common name" text,
"NCBI Accession Number (mRNA/Protein)" text,
"Length (bp/aa)" text,
"Protein Identity" text
) | What Species has the Species common name listed as human? | SELECT "Species" FROM table_7845 WHERE "Species common name" = 'human' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents ... | when did patient 73713 receive a prescription last month for the first time? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
... | 秦宛白患者以前的就诊医院是哪里 | (SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '秦宛白') UNION (SELECT zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = h... | css |
CREATE TABLE table_63298 (
"Municipality (2010)" text,
"White (both Hispanic and Non-Hispanic)" real,
"Black (Both Hispanic and Non-Hispanic)" real,
"Amerindian (Both Hispanic and Non-Hispanic)" real,
"n Asia (Both Hispanic and Non-Hispanic)" real,
"Multiracial (Both Hispanic and Non-Hispanic)" ... | What is the total number of white (Hispanic/Non-Hispanic) having a black (Hispanic/Non-Hispanic) of 9.9 and Hispanic under 99.5? | SELECT COUNT("White (both Hispanic and Non-Hispanic)") FROM table_63298 WHERE "Black (Both Hispanic and Non-Hispanic)" = '9.9' AND "Hispanic (Of any Race)" < '99.5' | wikisql |
CREATE TABLE table_name_34 (
incumbent VARCHAR,
first_elected VARCHAR,
district VARCHAR
) | Who is the incumbent for the Oregon 5 District that was elected in 1996? | SELECT incumbent FROM table_name_34 WHERE first_elected = 1996 AND district = "oregon 5" | sql_create_context |
CREATE TABLE table_name_20 (
year_won INTEGER,
player VARCHAR,
to_par VARCHAR
) | What is the average year Rich Beem had a to par less than 17? | SELECT AVG(year_won) FROM table_name_20 WHERE player = "rich beem" AND to_par < 17 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.