context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_33910 (
"Tournament" text,
"2002" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | Which 2007 has a 2008 of 1r, and a Tournament of wimbledon? | SELECT "2007" FROM table_33910 WHERE "2008" = '1r' AND "Tournament" = 'wimbledon' | wikisql |
CREATE TABLE table_name_19 (
away_team VARCHAR,
home_team VARCHAR
) | What team was the away team when Footscray was the home team? | SELECT away_team FROM table_name_19 WHERE home_team = "footscray" | sql_create_context |
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,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 门诊诊断为疾病X67.195的病患的检测指标691450数值的平均值以及最值分别是多少 | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'X67.195' AND jyjgzbb.JCZBDM = '... | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | how many male patients had the procedure titled endosc destr stomach les? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.short_title = "Endosc destr stomach les" | mimicsql_data |
CREATE TABLE table_75255 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
) | Which Date has a Score of 4 5, and a Game smaller than 4? | SELECT "Date" FROM table_75255 WHERE "Score" = '4–5' AND "Game" < '4' | wikisql |
CREATE TABLE table_37260 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text
) | what team had a score of 2-1 | SELECT "Opponent" FROM table_37260 WHERE "Score" = '2-1' | 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... | Do I earn 18 credits for the upper-level classes ? | SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 18 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_56733 (
"Edition" real,
"Zone" text,
"Round" text,
"Date" text,
"Against" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Result" text
) | What is the zone of the game played against Estonia? | SELECT "Zone" FROM table_56733 WHERE "Against" = 'estonia' | wikisql |
CREATE TABLE Appointment (
AppointmentID INTEGER,
Patient INTEGER,
PrepNurse INTEGER,
Physician INTEGER,
Start DATETIME,
End DATETIME,
ExaminationRoom TEXT
)
CREATE TABLE Procedures (
Code INTEGER,
Name VARCHAR(30),
Cost REAL
)
CREATE TABLE Physician (
EmployeeID INTEGER,
... | Return the name of each physician and the number of patients he or she treats in a bar chart, list by the total number from low to high. | SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_46562 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | What team was the away team for the game with 916 in attendance? | SELECT "Away" FROM table_46562 WHERE "Attendance" = '916' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE m... | has patient 033-32465 received administration of electrolytes - oral in other hospitals, since 6 years ago? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '033-32465' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '033-32465' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
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,
... | get me the number of patients with self pay health insurance who were hospitalized for more than 29 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.days_stay > "29" | mimicsql_data |
CREATE TABLE table_12305325_4 (
safe VARCHAR,
eliminated VARCHAR
) | Who is safe if John and Nicole are eliminated? | SELECT safe FROM table_12305325_4 WHERE eliminated = "John and Nicole" | 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 ... | i'd like flights going from BOSTON to ATLANTA leaving on 8 6 in the afternoon | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 1200 AND 1800) AND date_day.day_number = 6 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_n... | atis |
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_ca... | What are the number of the first names of all students in Smith Hall?, and sort by the how many fname in asc. | SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname) | nvbench |
CREATE TABLE table_name_25 (
area__km²_ INTEGER,
capital VARCHAR,
population___percentage_ VARCHAR
) | What is the average area that has a Capital of camag ey, with a Population (%) larger than 7.02? | SELECT AVG(area__km²_) FROM table_name_25 WHERE capital = "camagüey" AND population___percentage_ > 7.02 | sql_create_context |
CREATE TABLE table_12777 (
"Name" text,
"Location" text,
"Land" text,
"Longest span in s metre ( feet )" text,
"Arch type" text,
"Completed" text
) | How long is the UK's Ballochmyle Viaduct? | SELECT "Longest span in s metre ( feet )" FROM table_12777 WHERE "Land" = 'uk' AND "Name" = 'ballochmyle viaduct' | wikisql |
CREATE TABLE table_name_63 (
score VARCHAR,
date VARCHAR,
away_team VARCHAR
) | What is the score of the game against away team queens park rangers on 23 january 1982? | SELECT score FROM table_name_63 WHERE date = "23 january 1982" AND away_team = "queens park rangers" | sql_create_context |
CREATE TABLE table_11090 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | How many people attended the game of a.f.c. totton? | SELECT "Attendance" FROM table_11090 WHERE "Home team" = 'a.f.c. totton' | wikisql |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_descriptio... | i'd like to book the cheapest flight from ATLANTA to DENVER on 8 1 | SELECT DISTINCT flight.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, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, da... | atis |
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(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, sort Y-axis from low to high order. | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE table_73268 (
"Gas name" text,
"Chemical formula" text,
"Lifetime (years)" text,
"20-yr" text,
"100-yr" text,
"500-yr" text
) | What is the 100 year when 500 year is 153? | SELECT "100-yr" FROM table_73268 WHERE "500-yr" = '153' | wikisql |
CREATE TABLE table_204_858 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | what was the total attendance at the august 30 game against alabama ? | SELECT "attendance" FROM table_204_858 WHERE "date" = 'august 30' AND "opponent#" = 'alabama' | squall |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
... | 自09年9月13日起,截止到15年11月11日,查询医疗机构1782032处理过多少次新生儿门诊 | SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '1782032' AND txmzjzjlb.JZKSRQ BETWEEN '2009-09-13' AND '2015-11-11' AND txmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '1782032' AND ftxmzjzjlb.JZKSRQ BETWEEN '2009-09-13' AND '2015-11-11' AND ftxmzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE table_74453 (
"Tournament" text,
"Player" text,
"Nationality" text,
"Team" text,
"Games played" real,
"Goals conceded" real,
"Coefficient" text
) | Which team was in the 2012 clausura tournament? | SELECT "Team" FROM table_74453 WHERE "Tournament" = '2012 Clausura' | wikisql |
CREATE TABLE table_70635 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Which loss was on June 13? | SELECT "Loss" FROM table_70635 WHERE "Date" = 'june 13' | wikisql |
CREATE TABLE table_20278716_2 (
obama__percentage VARCHAR,
county VARCHAR
) | What percentage of people voted for Obama in Burlington? | SELECT obama__percentage FROM table_20278716_2 WHERE county = "Burlington" | sql_create_context |
CREATE TABLE table_name_41 (
regular_season INTEGER,
playoffs VARCHAR,
total VARCHAR
) | A total larger than 302 and playoffs of 35 also list the total of regular seasons as what? | SELECT SUM(regular_season) FROM table_name_41 WHERE playoffs = 35 AND total > 302 | sql_create_context |
CREATE TABLE table_name_55 (
institution VARCHAR,
affiliation VARCHAR
) | Which institution is private/catholic? | SELECT institution FROM table_name_55 WHERE affiliation = "private/catholic" | sql_create_context |
CREATE TABLE table_name_54 (
height__m_ INTEGER,
highest_mountain VARCHAR
) | What is the average height with the Highest mountain of hochgall? | SELECT AVG(height__m_) FROM table_name_54 WHERE highest_mountain = "hochgall" | sql_create_context |
CREATE TABLE track (
track_id number,
name text,
location text,
seating number,
year_opened number
)
CREATE TABLE race (
race_id number,
name text,
class text,
date text,
track_id text
) | Show the race class and number of races in each class. | SELECT class, COUNT(*) FROM race GROUP BY class | spider |
CREATE TABLE table_53952 (
"Nation" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text,
"Alternate" text
) | Who is the third alternate for Germany? | SELECT "Third" FROM table_53952 WHERE "Nation" = 'germany' | wikisql |
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 average days of hospital stay of patients whose year of birth is greater than 2071? | SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2071" | mimicsql_data |
CREATE TABLE table_42035 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text,
"Notes" text
) | Which Year that has Notes of dnf? | SELECT MIN("Year") FROM table_42035 WHERE "Notes" = 'dnf' | wikisql |
CREATE TABLE table_75985 (
"Name" text,
"Country" text,
"Date(s)" text,
"Loss" text,
"Institution" text,
"Market activity" text
) | What was the loss for Boris Picano-Nacci? | SELECT "Loss" FROM table_75985 WHERE "Name" = 'boris picano-nacci' | wikisql |
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME,
Day_Number INTEGER
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
... | Show the location codes and the number of documents in each location. Visualize by bar chart. | SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code | nvbench |
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
) | What is the proportion of classes of all races? Give me a pie chart. | SELECT Class, COUNT(Class) FROM race GROUP BY Class | nvbench |
CREATE TABLE table_name_40 (
faith VARCHAR,
name VARCHAR
) | Which faith has a name of Belswains? | SELECT faith FROM table_name_40 WHERE name = "belswains" | sql_create_context |
CREATE TABLE table_name_29 (
total INTEGER,
gold VARCHAR,
nation VARCHAR
) | Which Total is the highest one that has a Gold of 1, and a Nation of czechoslovakia? | SELECT MAX(total) FROM table_name_29 WHERE gold = 1 AND nation = "czechoslovakia" | sql_create_context |
CREATE TABLE table_203_293 (
id number,
"years of appearance" text,
"title" text,
"network" text,
"character name" text,
"actor" text,
"notes" text
) | who was the last character on bbc to be hiv positive ? | SELECT "character name" FROM table_203_293 WHERE "network" = 'bbc' ORDER BY "years of appearance" DESC LIMIT 1 | squall |
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,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 被门诊诊断为R76.930这个病的蒋宏深,看看他的检测指标089733的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j... | css |
CREATE TABLE table_12529 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Streak" text
) | which Streak has a Location/Attendance of staples center, and a Score of 67 89? | SELECT "Streak" FROM table_12529 WHERE "Location/Attendance" = 'staples center' AND "Score" = '67–89' | wikisql |
CREATE TABLE table_28132970_5 (
breadth VARCHAR,
propulsion VARCHAR
) | How many breadth entries are there when propulsion is jet? | SELECT COUNT(breadth) FROM table_28132970_5 WHERE propulsion = "Jet" | sql_create_context |
CREATE TABLE table_name_73 (
team__number1 VARCHAR
) | What was the 2nd leg score for Chemie Halle? | SELECT 2 AS nd_leg FROM table_name_73 WHERE team__number1 = "chemie halle" | sql_create_context |
CREATE TABLE All_documents (
date_stored VARCHAR,
Document_name VARCHAR
) | What is the date when the document 'Marry CV' was stored? | SELECT date_stored FROM All_documents WHERE Document_name = "Marry CV" | sql_create_context |
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,
... | what is the total number of patients who had other exploration and decompression of spinal canal? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Other exploration and decompression of spinal canal" | mimicsql_data |
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 int,
from_airport varchar,
meal_code text,
stops int,... | please book for me a flight on TW from WASHINGTON to SAN FRANCISCO earliest possible time | 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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'S... | atis |
CREATE TABLE table_4516 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the away team when the home team scored 17.17 (119)? | SELECT "Away team" FROM table_4516 WHERE "Home team score" = '17.17 (119)' | wikisql |
CREATE TABLE table_6154 (
"Medal" text,
"Name" text,
"Games" text,
"Sport" text,
"Event" text
) | What team played in the 1964 Tokyo Games? | SELECT "Name" FROM table_6154 WHERE "Games" = '1964 tokyo' | wikisql |
CREATE TABLE table_203_38 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"performer(s)" text,
"length" text
) | how long os the longest track on the album ? | SELECT "length" FROM table_203_38 ORDER BY "length" DESC LIMIT 1 | squall |
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... | 哪几家医院为48799651这个患者开了硫酸氢氯吡格雷片这个药物 | SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '48799651' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '硫酸氢氯吡格雷片') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '48799651' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.M... | css |
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... | 00738240365被医疗就诊的病情描述是什么? | SELECT t_kc21.MAIN_COND_DES FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '00738240365' | css |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description... | What other questions do Favoriters like?. | SELECT Posts.Id AS "post_link", Posts.Score AS "score", COUNT(1) AS "favorited_by" FROM Votes AS "favorited_post" JOIN Votes AS "other_favorites" ON 'favorited_post'.UserId = 'other_favorites'.UserId JOIN Posts ON 'other_favorites'.PostId = Posts.Id WHERE 'favorited_post'.VoteTypeId = @FavoriteType AND 'other_favorites... | sede |
CREATE TABLE zyb (
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... | 按照科室和出院诊断所患疾病的不同编码,把医院4313090所有医疗就诊记录中病人的平均年龄列出来 | SELECT qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '4313090' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.OUT_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '4313090' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.... | css |
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... | 列出患者88247382医疗记录中的入院诊断疾病编码和名称,主要针对医疗费总额不少于6145.72元的 | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '88247382' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 6145.72) | css |
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
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 t... | Bar chart of total number of number of platforms from each location, could you show in descending by the y-axis please? | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) DESC | nvbench |
CREATE TABLE table_30180 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What is the production code of the episode written by Jeff Filgo? | SELECT MAX("Production code") FROM table_30180 WHERE "Written by" = 'Jeff Filgo' | wikisql |
CREATE TABLE table_name_48 (
l2_cache VARCHAR,
model_number VARCHAR
) | What is the L2 cache for the Mobile Pentium 333? | SELECT l2_cache FROM table_name_48 WHERE model_number = "mobile pentium 333" | sql_create_context |
CREATE TABLE table_967 (
"Season" text,
"Oberliga Bayern" text,
"Oberliga Hessen" text,
"Oberliga Baden-W\u00fcrttemberg" text,
"Oberliga S\u00fcdwest" text
) | Name the oberliga for where tsv 1860 munich and borussia neunkirchen | SELECT "Oberliga Baden-W\u00fcrttemberg" FROM table_967 WHERE "Oberliga Bayern" = 'TSV 1860 Munich' AND "Oberliga S\u00fcdwest" = 'Borussia Neunkirchen' | wikisql |
CREATE TABLE table_77715 (
"Player" text,
"Position" text,
"Date of Birth (Age)" text,
"Caps" real,
"Club/province" text
) | How many caps have a Date of Birth (Age) of 15 july 1981? | SELECT COUNT("Caps") FROM table_77715 WHERE "Date of Birth (Age)" = '15 july 1981' | wikisql |
CREATE TABLE table_34219 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Wins" real
) | What is the highest rank for ben crenshaw after winning more than 14 times? | SELECT MAX("Rank") FROM table_34219 WHERE "Player" = 'ben crenshaw' AND "Wins" > '14' | wikisql |
CREATE TABLE table_27890 (
"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 (2002) of the Mala Remeta settlement? | SELECT "Dominant religion (2002)" FROM table_27890 WHERE "Settlement" = 'Mala Remeta' | wikisql |
CREATE TABLE table_18018248_2 (
draws VARCHAR,
goals_conceded VARCHAR
) | How many draws were there when the conceded goals was numbered at 45? | SELECT COUNT(draws) FROM table_18018248_2 WHERE goals_conceded = 45 | sql_create_context |
CREATE TABLE table_name_6 (
name VARCHAR,
total VARCHAR
) | What is the name of the person with a total of 22? | SELECT name FROM table_name_6 WHERE total = 22 | sql_create_context |
CREATE TABLE table_name_66 (
album_number VARCHAR,
chinese__simplified_ VARCHAR
) | What is the album number for the record , simplified from the traditional Chinese name? | SELECT album_number FROM table_name_66 WHERE chinese__simplified_ = "情歌没有告诉你" | sql_create_context |
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... | find the number of patients on iv bolus route of drug administration who are married. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "MARRIED" AND prescriptions.route = "IV BOLUS" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | what number of patients diagnosed under icd9 code 78720 had government insurance? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.icd9_code = "78720" | mimicsql_data |
CREATE TABLE table_name_40 (
rank INTEGER,
nationality VARCHAR,
time VARCHAR
) | What is the lowest rank from Great Britain with a time of 2:10.33? | SELECT MIN(rank) FROM table_name_40 WHERE nationality = "great britain" AND time = "2:10.33" | sql_create_context |
CREATE TABLE table_name_62 (
gold INTEGER,
nation VARCHAR,
total VARCHAR,
bronze VARCHAR
) | Name the average gold for czech republic and bronze less than 1 when total is less than 14 | SELECT AVG(gold) FROM table_name_62 WHERE total < 14 AND bronze < 1 AND nation = "czech republic" | sql_create_context |
CREATE TABLE table_68146 (
"Championship" text,
"Champion(s)" text,
"Previous champion(s)" text,
"Date Won" text,
"Location" text
) | Who was the previous champion of the title won on July 7, 2010? | SELECT "Previous champion(s)" FROM table_68146 WHERE "Date Won" = 'july 7, 2010' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
Dupli... | Get all posts with tags = 'php' & 'javascript' & 'mysql'. | SELECT * FROM Posts WHERE Id IN (SELECT PostId FROM PostTags WHERE TagId = (SELECT Id FROM Tags WHERE TagName = 'php')) | sede |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | what is the number of patients on sl route of drug administration who were diagnosed with accidents occurring in other specified places? | 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 = "Accident in place NEC" AND prescriptions.route = "SL" | mimicsql_data |
CREATE TABLE table_40378 (
"Index" text,
"Name" text,
"Song" text,
"Group Song" text,
"Score" text
) | What is Score, when Group Song is , and when Index is F2? | SELECT "Score" FROM table_40378 WHERE "Group Song" = '就是你' AND "Index" = 'f2' | wikisql |
CREATE TABLE table_27989 (
"Series #" real,
"Episode title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" real
) | Who directed the episode with the production code 10? | SELECT "Directed by" FROM table_27989 WHERE "Prod. code" = '10' | wikisql |
CREATE TABLE table_name_42 (
surface VARCHAR,
outcome VARCHAR,
score VARCHAR
) | What is the surface of the match when the outcome was runner-up, and a Score of julia g rges polona hercog? | SELECT surface FROM table_name_42 WHERE outcome = "runner-up" AND score = "julia görges polona hercog" | sql_create_context |
CREATE TABLE table_26894949_2 (
event VARCHAR,
puma VARCHAR,
abu_dhabi VARCHAR
) | In how many events was Puma 20 and abu dhabi 30? | SELECT COUNT(event) FROM table_26894949_2 WHERE puma = "20" AND abu_dhabi = "30" | sql_create_context |
CREATE TABLE table_name_23 (
english_name VARCHAR,
abbr VARCHAR
) | What is the English word that is abbreviated . .? | SELECT english_name FROM table_name_23 WHERE abbr = "พ.ย." | sql_create_context |
CREATE TABLE table_20793 (
"School Year" text,
"Volleyball" text,
"Cross Country" text,
"Soccer" text,
"Tennis" text,
"Golf" text,
"Basketball" text,
"Swimming" text,
"Softball" text,
"Track & Field" text
) | which country won swimming track & field when lexington won swimming and madison won volleyball | SELECT "Track & Field" FROM table_20793 WHERE "Swimming" = 'Lexington' AND "Volleyball" = 'Madison' | wikisql |
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE medicine (
id int,
name text,
Trade_Name... | Show me a bar chart for what is the id and trade name of the medicines can interact with at least 3 enzymes?, and show X in asc order. | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY Trade_Name | nvbench |
CREATE TABLE table_6294 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What was the Attendance of August 26? | SELECT "Attendance" FROM table_6294 WHERE "Date" = 'august 26' | wikisql |
CREATE TABLE table_name_75 (
games INTEGER,
lost VARCHAR,
points VARCHAR
) | What's the total of Games with a Lost that's larger than 2, and has Points that's smaller than 0? | SELECT SUM(games) FROM table_name_75 WHERE lost > 2 AND points < 0 | sql_create_context |
CREATE TABLE table_test_15 (
"id" int,
"anemia" bool,
"cell_therapy" bool,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"active_hepatitis" bool,
"chronic_inflammatory_disease" bool,
"platelet_c... | impaired renal function ( creatinine > 2 mg / dl ) at the time of cell therapy | SELECT * FROM table_test_15 WHERE renal_disease = 1 OR creatinine_clearance_cl > 2 AND cell_therapy = 1 | criteria2sql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 列举出在06年8月30日到2008年5月14日内蒋锐锋病患所有检验报告单的审核日期时间是那几天? | SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '蒋锐锋' AND jybg... | css |
CREATE TABLE table_name_41 (
team VARCHAR,
kit_manufacturer VARCHAR,
captain VARCHAR
) | What team has a kit manufacturer of Umbro and Eric Cantona as captain? | SELECT team FROM table_name_41 WHERE kit_manufacturer = "umbro" AND captain = "eric cantona" | sql_create_context |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_... | Visualize a bar chart for the date and mean humidity for the days with the 3 largest maximum gust speeds. | SELECT date, mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3 | nvbench |
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 hz_info (
KH text,
KLX number... | 门诊上一般被诊断为疾病O32.933的患者的检测指标830460数值的平均值以及最值会是怎样的数据 | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'O32.933' AND jyjgzbb.JCZBDM = '... | css |
CREATE TABLE table_name_37 (
result VARCHAR,
competition VARCHAR
) | What is the result of the friendly match? | SELECT result FROM table_name_37 WHERE competition = "friendly" | sql_create_context |
CREATE TABLE table_26186 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Final Score" text,
"Attendance" real,
"Record" text
) | Which location has the date of October 28? | SELECT "Location" FROM table_26186 WHERE "Date" = 'October 28' | wikisql |
CREATE TABLE table_49197 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | What is the total number of games at Toronto with less than 31 points? | SELECT COUNT("Game") FROM table_49197 WHERE "Location" = 'toronto' AND "Points" < '31' | wikisql |
CREATE TABLE table_34600 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | What day in february was game 53? | SELECT AVG("February") FROM table_34600 WHERE "Game" = '53' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 varchar(40),
POSTAL_CODE varchar(12),
CITY ... | For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, list from low to high by the y axis please. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_67937 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What was the 2008 result associated with a 2009 of A and a 2011 of 2R? | SELECT "2008" FROM table_67937 WHERE "2009" = 'a' AND "2011" = '2r' | wikisql |
CREATE TABLE table_27887 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | What was the largest ethnic group in so ica? | SELECT "Largest ethnic group (2002)" FROM table_27887 WHERE "Settlement" = 'Sočica' | wikisql |
CREATE TABLE table_name_3 (
mls_team VARCHAR,
pick__number VARCHAR
) | Which MLS team had a pick number of 32? | SELECT mls_team FROM table_name_3 WHERE pick__number = 32 | sql_create_context |
CREATE TABLE table_74574 (
"Place" real,
"Rider" text,
"Country" text,
"Machine" text,
"Speed" text,
"Time" text,
"Points" real
) | What was the time for the man who scored 1 point? | SELECT "Time" FROM table_74574 WHERE "Points" = '1' | wikisql |
CREATE TABLE table_1341568_6 (
status VARCHAR,
party VARCHAR,
elected VARCHAR
) | What is the elected status of the Democratic party in 1989? | SELECT status FROM table_1341568_6 WHERE party = "Democratic" AND elected = "1989" | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
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 TA... | flight numbers from MINNEAPOLIS to LONG BEACH on 6 26 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LONG BEACH' AND date_day.day_number = 26 AND date_day.month_number = 6 AN... | atis |
CREATE TABLE table_name_52 (
away_team VARCHAR
) | In the match where Melbourne was the away team, how much did they score? | SELECT away_team AS score FROM table_name_52 WHERE away_team = "melbourne" | sql_create_context |
CREATE TABLE table_name_19 (
date INTEGER,
works_number VARCHAR,
builder VARCHAR,
number VARCHAR
) | Which Date has a Builder of alco schenectady, and a Number larger than 835, and Works number of 56566? | SELECT AVG(date) FROM table_name_19 WHERE builder = "alco schenectady" AND number > 835 AND works_number = 56566 | sql_create_context |
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... | 在2011年9月10日到2017年11月8日内医院2816651科室涉及医疗费总额低于6027.82元有多少? | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '2816651' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-09-10' AND '2017-11-08' GROUP B... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.