context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
... | How many stadiums does each country have Show bar chart, and rank by the Y-axis in descending. | SELECT Country, COUNT(*) FROM stadium GROUP BY Country ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Tag associated with 'homework' tag. | SELECT COUNT(*), at.TagName FROM PostTags AS a JOIN PostTags AS b ON (a.PostId = b.PostId) JOIN Tags AS at ON (a.TagId = at.Id) JOIN Tags AS bt ON (b.TagId = bt.Id) WHERE bt.TagName = 'homework' AND at.TagName != 'homework' GROUP BY at.TagName ORDER BY 1 DESC | sede |
CREATE TABLE table_44162 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the overall sum of round 3? | SELECT SUM("Overall") FROM table_44162 WHERE "Round" = '3' | wikisql |
CREATE TABLE table_77471 (
"Team" text,
"Athletes" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Run 4" text,
"Final" text
) | Which Run 4 has a Run 1 of 1:25.82? | SELECT "Run 4" FROM table_77471 WHERE "Run 1" = '1:25.82' | wikisql |
CREATE TABLE table_23408094_14 (
span_of_years_led INTEGER,
tournament_at_which_lead_began VARCHAR
) | Of the players whose lead began at the australian championships, what was the shortest span of years led? | SELECT MIN(span_of_years_led) FROM table_23408094_14 WHERE tournament_at_which_lead_began = "Australian Championships" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 患者53751020全部检验报告单中的标本采集部位在2000年10月30日到2002年2月6日内都是哪一部位? | SELECT jybgb.BBCJBW FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '53751020' AND jybgb.BGRQ BETWEEN '2000-10-30' AND '200... | 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... | 郑丽容患者在医院5352405的出院诊断结果中哪个出院诊断医生姓沈,需要这个结果的详情 | SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '郑丽容' AND qtb.MED_SER_ORG_NO = '5352405' AND qtb.OUT_DIAG_DOC_NM LIKE '沈%' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '郑丽容' AND gyb.MED_SER_ORG_NO = '5352405' AND gyb.OUT_DIAG_DOC_NM LIKE '沈%' UNION ... | css |
CREATE TABLE table_train_63 (
"id" int,
"immune_suppression" bool,
"leukocyte_count" int,
"need_hemodialysis" bool,
"head_injury" bool,
"periodic_paralysis" bool,
"renal_disease" bool,
"glasgow_come_score_gcs" int,
"sepsis" bool,
"pancreatitis" bool,
"enteral_feeding" bool,
... | head trauma with a glasgow come score ( gcs ) less or equal to 5 | SELECT * FROM table_train_63 WHERE head_injury = 1 AND glasgow_come_score_gcs <= 5 | criteria2sql |
CREATE TABLE table_204_524 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | which division were they in the most ? | SELECT "division" FROM table_204_524 GROUP BY "division" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_200_1 (
id number,
"year" number,
"title" text,
"role" text,
"notes" text
) | what is the name of the movie where mischa barton plays the role of ms. monica ? | SELECT "title" FROM table_200_1 WHERE "role" = 'ms. monica' | squall |
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
) | For those records from the products and each product's manufacturer, a bar chart shows the distribution of headquarter and the average of manufacturer , and group by attribute headquarter. | SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | nvbench |
CREATE TABLE table_name_61 (
production_company VARCHAR,
producer_s_ VARCHAR
) | For which production company did Sam Mccarthy produce? | SELECT production_company FROM table_name_61 WHERE producer_s_ = "sam mccarthy" | sql_create_context |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password... | Return a bar chart about the distribution of login_name and author_id . | SELECT login_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_16423070_4 (
golf VARCHAR,
soccer VARCHAR
) | how many teams won at golf when wooster won soccer | SELECT COUNT(golf) FROM table_16423070_4 WHERE soccer = "Wooster" | sql_create_context |
CREATE TABLE table_78540 (
"Round" real,
"Pick" text,
"Player" text,
"Position" text,
"School" text
) | Which round was Tom Morris picked in? | SELECT COUNT("Round") FROM table_78540 WHERE "Player" = 'tom morris' | wikisql |
CREATE TABLE table_75904 (
"RR Romaja" text,
"M\u2013R Romaja" text,
"Hangul/Chosongul" text,
"Hanja" text,
"Area" text,
"Capital" text,
"Region" text,
"Country" text
) | Which capital has a Hangul of ? | SELECT "Capital" FROM table_75904 WHERE "Hangul/Chosongul" = '경상남도' | wikisql |
CREATE TABLE table_29697744_1 (
movements VARCHAR,
position VARCHAR
) | what is the name of the movement in the 7th position | SELECT movements FROM table_29697744_1 WHERE position = "7th" | sql_create_context |
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,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 那个孙清涵的病人在2017年11月21日到2019年11月23日内所有检验结果指标记录中的仪器编号以及名称能不能给我详细列举出来? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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... | css |
CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME,
Day_Number INTEGER
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Descri... | Show the number of documents in different ending date and group by ending date with a line chart. | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Date_in_Locaton_To | nvbench |
CREATE TABLE table_name_35 (
second VARCHAR,
nation VARCHAR
) | Who was second for the United States team? | SELECT second FROM table_name_35 WHERE nation = "united states" | sql_create_context |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
... | please find all the flights from CINCINNATI to any airport in the NEW YORK area that arrive next saturday before 1800 | 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.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 26 AND da... | atis |
CREATE TABLE table_28484 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | How many times is the original artist Alicia keys? | SELECT COUNT("Result") FROM table_28484 WHERE "Original artist" = 'Alicia Keys' | wikisql |
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... | 能查一下39270764的患者有做过什么治疗吗 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '39270764' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE ... | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
... | did patient 006-62367 ever underwent any therapeutic antibacterials - vancomycin procedure in 2105? | 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 = '006-62367')) AND treatment.treatmentname = 'therapeutic antibacterials - van... | eicu |
CREATE TABLE table_name_89 (
place VARCHAR,
score VARCHAR,
country VARCHAR
) | When the score is 71 and the player is from United States what is the place? | SELECT place FROM table_name_89 WHERE score = 71 AND country = "united states" | sql_create_context |
CREATE TABLE table_7254 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What score has notts county as the home team? | SELECT "Score" FROM table_7254 WHERE "Home team" = 'notts county' | wikisql |
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats text
)
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id number,
genre_is text,
rating number,
languages text,
releasedate time,
resolution number
)
... | What are the names of artists who are Male and are from UK? | SELECT artist_name FROM artist WHERE country = "UK" AND gender = "Male" | spider |
CREATE TABLE table_75955 (
"Tournament" text,
"2006" text,
"2009" text,
"2012" text,
"2013" text
) | What is the 2006 when the 2013 is 1r, and the 2012 is 1r? | SELECT "2006" FROM table_75955 WHERE "2013" = '1r' AND "2012" = '1r' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what was the drug patient 22648 had been prescribed two or more times in this month? | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22648) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 ... | mimic_iii |
CREATE TABLE table_204_699 (
id number,
"district" text,
"name" text,
"party" text,
"residence" text,
"first served" number
) | nelsano albano served in the same year as which washington twp . member ? | SELECT "name" FROM table_204_699 WHERE "name" <> 'nelson albano' AND "first served" = (SELECT "first served" FROM table_204_699 WHERE "name" = 'nelson albano') AND "residence" = 'washington twp' | squall |
CREATE TABLE table_name_95 (
score VARCHAR,
place VARCHAR
) | Which Score has a Place of t2? | SELECT score FROM table_name_95 WHERE place = "t2" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | what time was the last time patient 006-2586 had the maximum respiration value today? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-2586')) AND NOT vitalperiodic.respiration IS NU... | eicu |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Buscando posts sobre windows phone de 2018 at hoje. | SELECT Id, LastActivityDate, CreationDate, Score, ViewCount, Body, OwnerUserId, Title, Tags, AnswerCount FROM Posts WHERE Tags LIKE '%<windows-phone%' AND PostTypeId = 1 AND CreationDate >= '01/01/2018' ORDER BY LastActivityDate DESC | sede |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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 ... | For those employees who did not have any job in the past, visualize the relationship between salary and commission_pct . | SELECT SALARY, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_53963 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
) | What type of object has an NGC number higher than 2090 and has a right ascension (J2000) of 05h52m19s? | SELECT "Object type" FROM table_53963 WHERE "NGC number" > '2090' AND "Right ascension ( J2000 )" = '05h52m19s' | wikisql |
CREATE TABLE table_14378 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Distance" text
) | In which year did he finish 8th? | SELECT "Year" FROM table_14378 WHERE "Result" = '8th' | wikisql |
CREATE TABLE table_name_77 (
year VARCHAR,
national_champion VARCHAR
) | In what Year was Rhode Island the National Champion? | SELECT year FROM table_name_77 WHERE national_champion = "rhode island" | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_s... | give me US flights for next wednesday from CLEVELAND to MIAMI | 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 = 'MIAMI' AND date_day.day_number = 23 AND date_day.month_number = 4 AND da... | atis |
CREATE TABLE table_19778010_5 (
game INTEGER,
date VARCHAR
) | What's the number of the game played on June 22? | SELECT MAX(game) FROM table_19778010_5 WHERE date = "June 22" | sql_create_context |
CREATE TABLE table_19338 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" text,
"2nd (m)" text,
"Points" text,
"Overall FHT points" text,
"Overall WC points (Rank)" text
) | How many total points did roman Koudelka have | SELECT "Overall WC points (Rank)" FROM table_19338 WHERE "Name" = 'Roman Koudelka' | wikisql |
CREATE TABLE table_name_22 (
tries_against VARCHAR,
tries_for VARCHAR
) | What is Tries Against, when Tries For is 20? | SELECT tries_against FROM table_name_22 WHERE tries_for = "20" | sql_create_context |
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 ... | 列出患者蒋清淑门诊诊断名称不包含维生素的在医院6779932中有哪些门诊就诊记录? | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjz... | css |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | when is the last time patient 015-52724 has had a heartrate measurement since 2 days ago? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-52724')) AND NOT vitalperiodic.heartrate IS NUL... | eicu |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | is there a meal on DL flight 852 from SAN FRANCISCO to DALLAS FORT WORTH | SELECT DISTINCT food_service.compartment, food_service.meal_code, food_service.meal_number FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, food_service WHERE (((CITY_1.city_code = AIRPORT_SERVI... | atis |
CREATE TABLE table_3313 (
"Position" real,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Corrected time d:hh:mm:ss" text
) | What were the LOA metres for the yacht ichi ban? | SELECT "LOA (Metres)" FROM table_3313 WHERE "Yacht" = 'Ichi Ban' | wikisql |
CREATE TABLE table_58606 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
) | Which tournament resulted in 6th place? | SELECT "Tournament" FROM table_58606 WHERE "Result" = '6th' | wikisql |
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
... | Give me a group line chart showing the number of documents in different ending date The x-axis is ending date and group by location code, rank by the x axis from low to high please. | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code, Date_in_Locaton_To ORDER BY Date_in_Locaton_To | nvbench |
CREATE TABLE table_59946 (
"Rank" text,
"Name" text,
"Height ft (m)" text,
"Floors" real,
"Year" real
) | How tall is the structure built in 1907? | SELECT "Height ft (m)" FROM table_59946 WHERE "Year" = '1907' | wikisql |
CREATE TABLE table_49496 (
"Issued" real,
"Type" text,
"Design" text,
"Serial format" text,
"Serials issued" text
) | What is the issued serial given in 1966? | SELECT "Serials issued" FROM table_49496 WHERE "Issued" = '1966' | wikisql |
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state ... | Find the name and account balance of the customer whose name includes the letter a Visualize them using a bar chart, show y-axis in descending order. | SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY acc_bal DESC | nvbench |
CREATE TABLE table_name_77 (
object_type VARCHAR,
right_ascension___j2000__ VARCHAR
) | what is the object type when the right ascension (j2000) is 11h10m42.8s? | SELECT object_type FROM table_name_77 WHERE right_ascension___j2000__ = "11h10m42.8s" | sql_create_context |
CREATE TABLE table_name_96 (
loss VARCHAR,
record VARCHAR
) | What loss has 26-9 as a loss? | SELECT loss FROM table_name_96 WHERE record = "26-9" | sql_create_context |
CREATE TABLE table_203_620 (
id number,
"tie no" number,
"home team" text,
"score" text,
"away team" text,
"attendance" number
) | which team was the first team to score six goals ? | SELECT "home team" FROM table_203_620 WHERE "score" = 6 LIMIT 1 | squall |
CREATE TABLE table_68203 (
"Team" text,
"City" text,
"Stadium" text,
"Manager" text,
"Past season" text
) | what stadium has a prior record of 7th? | SELECT "Stadium" FROM table_68203 WHERE "Past season" = '7th' | wikisql |
CREATE TABLE table_47749 (
"Elector" text,
"Nationality" text,
"Order and title" text,
"Elevated" text,
"Elevator" text
) | When the elevator was Innocent IV what was the nationality? | SELECT "Nationality" FROM table_47749 WHERE "Elevator" = 'innocent iv' | wikisql |
CREATE TABLE attribute_definitions (
attribute_id number,
attribute_name text,
attribute_data_type text
)
CREATE TABLE catalog_contents (
catalog_entry_id number,
catalog_level_number number,
parent_entry_id number,
previous_entry_id number,
next_entry_id number,
catalog_entry_name ... | Find all the catalog publishers whose name contains 'Murray | SELECT DISTINCT (catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%" | spider |
CREATE TABLE table_31945 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | Tell me the tournament with a hard surface for 6 1, 6 2 | SELECT "Tournament" FROM table_31945 WHERE "Surface" = 'hard' AND "Score" = '6–1, 6–2' | wikisql |
CREATE TABLE table_66262 (
"Event" text,
"Performance" text,
"Athlete" text,
"Nation" text,
"Place" text,
"Date" text
) | What's the date when Yelena Isinbayeva for Russia was in Beijing, China? | SELECT "Date" FROM table_66262 WHERE "Nation" = 'russia' AND "Place" = 'beijing, china' AND "Athlete" = 'yelena isinbayeva' | wikisql |
CREATE TABLE table_28540609_2 (
earnings__ VARCHAR,
best_finish VARCHAR
) | How many earnings values are associated with players who had a best finish of T38? | SELECT COUNT(earnings__) AS €_ FROM table_28540609_2 WHERE best_finish = "T38" | sql_create_context |
CREATE TABLE table_58991 (
"Name" text,
"Years" text,
"MLS Cup" real,
"U.S. Open Cup" real,
"CONCACAF" real,
"Other" real,
"Total" real
) | What is the total where there are 4 MLS Cups and more US Open Cups than 1? | SELECT COUNT("Total") FROM table_58991 WHERE "MLS Cup" = '4' AND "U.S. Open Cup" > '1' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGu... | High Rep users with the peer pressure badge. A way to find which users (mostly high rep) have the peer pressure badge. Was just playing around with T-SQL and cooked this. =D | SELECT Id AS "user_link", DisplayName, Reputation FROM Users WHERE Reputation > @RepLimit AND NOT EXISTS(SELECT Id FROM Badges AS b WHERE b.UserId = Users.Id AND b.Name = 'Peer Pressure') ORDER BY Reputation DESC | sede |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | how many patients with drug code glyb5 died in or before 2115? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2115.0" AND prescriptions.formulary_drug_cd = "GLYB5" | mimicsql_data |
CREATE TABLE table_4036 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Which junior team is associated with an NHL pick by the Buffalo Sabres? | SELECT "College/junior/club team" FROM table_4036 WHERE "NHL team" = 'Buffalo Sabres' | wikisql |
CREATE TABLE table_name_29 (
jianshu INTEGER,
rank VARCHAR,
qiangshu VARCHAR
) | What is the average Jianshu higher than rank 2, with a Qiangshu smaller than 9.85? | SELECT AVG(jianshu) FROM table_name_29 WHERE rank < 2 AND qiangshu < 9.85 | sql_create_context |
CREATE TABLE table_204_443 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"game site" text,
"attendance" number,
"bye" text
) | what is the date for the first game played in the meadowlands ? | SELECT "date" FROM table_204_443 WHERE "game site" = 'the meadowlands' ORDER BY "date" LIMIT 1 | squall |
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 lab (
subject_id text,
hadm_id text,
... | provide the number of patients whose admission location is phys referral/normal deli and diagnoses short title is 29-30 comp wks gestation? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.short_title = "29-30 comp wks gestation" | mimicsql_data |
CREATE TABLE table_name_33 (
top_25 INTEGER,
events VARCHAR,
cuts_made VARCHAR
) | Tell me the average top 25 with events of 5 and cuts madde less than 3 | SELECT AVG(top_25) FROM table_name_33 WHERE events = 5 AND cuts_made < 3 | sql_create_context |
CREATE TABLE neighborhood (
id int,
business_id varchar,
neighborhood_name varchar
)
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_address varchar,
city varchar,
latitude varchar,
longitude varchar,
review_count bigint,
is_open tinyint,
rat... | Find all cities which has a ' Taj Mahal ' . | SELECT city FROM business WHERE name = 'Taj Mahal' | yelp |
CREATE TABLE table_17330069_1 (
fin_pos VARCHAR,
points VARCHAR
) | If the points is 15, what is the fin. pos? | SELECT COUNT(fin_pos) FROM table_17330069_1 WHERE points = "15" | sql_create_context |
CREATE TABLE fgwyjzb (
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,
... | 这个编号是32023982的患者交的医疗费总额不少于3281.11元的医疗记录都多些,在其入院诊断时患的疾病编码和名称分别都是什么? | SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '32023982' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 3281.11) UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '32023982' AND fg... | css |
CREATE TABLE table_name_68 (
percent_yes VARCHAR,
jurisdiction VARCHAR,
percent_no VARCHAR
) | What is the percent yes of Alberta, which had a percent no larger than 60.2? | SELECT COUNT(percent_yes) FROM table_name_68 WHERE jurisdiction = "alberta" AND percent_no > 60.2 | sql_create_context |
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... | 列出各科室在医院2092473的编码和名称以及平均住院时长是什么,并按平均住院时长升序排序? | SELECT qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM, AVG(qtb.IN_HOSP_DAYS) FROM qtb WHERE qtb.MED_SER_ORG_NO = '2092473' GROUP BY qtb.MED_ORG_DEPT_CD ORDER BY AVG(qtb.IN_HOSP_DAYS) UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.MED_ORG_DEPT_NM, AVG(gyb.IN_HOSP_DAYS) FROM gyb WHERE gyb.MED_SER_ORG_NO = '2092473' GROUP BY gyb.MED_ORG... | css |
CREATE TABLE table_37099 (
"Title" text,
"Date" text,
"Theatre" text,
"Role" text,
"Dance Partner" text,
"Director" text,
"Lyrics" text,
"Music" text
) | Which Title has a Dance Partner of adele astaire, and Lyrics of ira gershwin, and a Director of felix edwardes? | SELECT "Title" FROM table_37099 WHERE "Dance Partner" = 'adele astaire' AND "Lyrics" = 'ira gershwin' AND "Director" = 'felix edwardes' | wikisql |
CREATE TABLE table_28499 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real,
"Nickname" text
) | How many joined when the enrollment was 1150 in Sioux City, Iowa? | SELECT "Joined" FROM table_28499 WHERE "Enrollment" = '1150' AND "Location" = 'Sioux City, Iowa' | wikisql |
CREATE TABLE table_name_44 (
year_opened VARCHAR,
arena_venue VARCHAR
) | What year did the San Agustin gym open? | SELECT year_opened FROM table_name_44 WHERE arena_venue = "san agustin gym" | sql_create_context |
CREATE TABLE table_23398 (
"No. in series" text,
"No. in season" real,
"Family/families" text,
"Location(s)" text,
"Original air date" text
) | What episode in the season was episode us18 in the series? | SELECT COUNT("No. in season") FROM table_23398 WHERE "No. in series" = 'US18' | wikisql |
CREATE TABLE tryout (
enr INTEGER,
cName VARCHAR,
pPos VARCHAR
)
CREATE TABLE college (
enr INTEGER,
cName VARCHAR,
pPos VARCHAR
) | What is the total number of enrollment of schools that do not have any goalie player? | SELECT SUM(enr) FROM college WHERE NOT cName IN (SELECT cName FROM tryout WHERE pPos = "goalie") | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id... | what is the maximum monthly number of patients who have had chro kidney dis stage ii since 2102? | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'chro kidney dis stage ii') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2102' GROUP BY STRFTIME('%y... | mimic_iii |
CREATE TABLE table_4195 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" real,
"Position" text
) | How many seasons are there for the 3rd position? | SELECT COUNT("Season") FROM table_4195 WHERE "Position" = '3rd' | wikisql |
CREATE TABLE table_23285849_10 (
game VARCHAR,
team VARCHAR
) | When the clippers are the team how many games are there? | SELECT COUNT(game) FROM table_23285849_10 WHERE team = "Clippers" | sql_create_context |
CREATE TABLE table_204_109 (
id number,
"district" text,
"incumbent" text,
"party" text,
"first\nelected" text,
"result" text,
"candidates" text
) | what are the number of times re elected is listed as the result ? | SELECT COUNT(*) FROM table_204_109 WHERE "result" = 're-elected' | squall |
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
) | What are the names and seatings for all tracks opened after 2000, ordered by seating? | SELECT name, seating FROM track WHERE year_opened > 2000 ORDER BY seating | spider |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paperkeyphrase (
paperid int,
... | papers from 2014 | SELECT DISTINCT paperid FROM paper WHERE year = 2014 | scholar |
CREATE TABLE table_name_69 (
visitor VARCHAR,
date VARCHAR
) | Which team was the visitor on January 10? | SELECT visitor FROM table_name_69 WHERE date = "january 10" | sql_create_context |
CREATE TABLE table_2192 (
"Year(s)" real,
"Commentator" text,
"Dual Commentator" text,
"Spokesperson" text,
"Channel" text
) | state all spokesperson for the channel where dual commentator was elena batinova | SELECT "Spokesperson" FROM table_2192 WHERE "Dual Commentator" = 'Elena Batinova' | wikisql |
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,
... | 看看之前11219115患者的住院诊断有哪些 | SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_inf... | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | list the number of patients who were admitted before the year 2107. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < "2107" | mimicsql_data |
CREATE TABLE table_43083 (
"Usage" text,
"Sn/Sb (%)" text,
"Liquid at (\u00b0C)" text,
"Casting at (\u00b0C)" text,
"Remelting at (\u00b0C)" text,
"Hardness" text
) | What is the remelting temperature for the alloy that has a Sn/Sb ratio of 9.5/15? | SELECT "Remelting at (\u00b0C)" FROM table_43083 WHERE "Sn/Sb (%)" = '9.5/15' | wikisql |
CREATE TABLE table_2697 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | Name the total number for report july 23 | SELECT COUNT("Report") FROM table_2697 WHERE "Date" = 'July 23' | wikisql |
CREATE TABLE table_14962316_9 (
recopa_sudamericana_1998 VARCHAR,
team VARCHAR
) | Did Flamengo play in the Recopa Sudamericana in 1998 | SELECT recopa_sudamericana_1998 FROM table_14962316_9 WHERE team = "Flamengo" | sql_create_context |
CREATE TABLE table_1612760_1 (
line VARCHAR,
service_pattern VARCHAR
) | Which line offers Fast to Norwood Junction? | SELECT line FROM table_1612760_1 WHERE service_pattern = "Fast to Norwood Junction" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | did patient 016-9636 have calcium gluconate 10% prescribed since 12/2105? | 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 = '016-9636')) AND medication.drugname = 'calcium gluconate 10%' AND STRFTIME... | eicu |
CREATE TABLE Addresses (
city VARCHAR,
address_id VARCHAR
)
CREATE TABLE Staff (
staff_address_id VARCHAR
) | Which city lives most of staffs? List the city name and number of staffs. | SELECT T1.city, COUNT(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_21429 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"FLaps" real,
"Podiums" real,
"Points" real,
"Position" text
) | Which season did he have 0 points and 31st position? | SELECT MAX("Season") FROM table_21429 WHERE "Points" = '0' AND "Position" = '31st' | wikisql |
CREATE TABLE table_204_55 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | what date is after october 1st ? | SELECT "date" FROM table_204_55 WHERE "date" > (SELECT "date" FROM table_204_55 WHERE "date" = 'october 1, 2005') ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_name_47 (
year INTEGER,
position VARCHAR
) | What's the average Year for the Position of 7th (sf)? | SELECT AVG(year) FROM table_name_47 WHERE position = "7th (sf)" | sql_create_context |
CREATE TABLE table_name_4 (
against INTEGER,
played INTEGER
) | What is the lowest Against when the played is more than 10? | SELECT MIN(against) FROM table_name_4 WHERE played > 10 | sql_create_context |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
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_seaso... | What is the number of films of each director? Return a bar chart, and could you display by the how many directed by in asc? | SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by ORDER BY COUNT(Directed_by) | nvbench |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what is patient 027-144847's gender? | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '027-144847' | eicu |
CREATE TABLE table_1057262_2 (
tasmania VARCHAR,
new_south_wales VARCHAR
) | what's the total number of tasmania with new south wales crop of 190 kilotonnes | SELECT COUNT(tasmania) FROM table_1057262_2 WHERE new_south_wales = 190 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.