context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
... | 在医院0616625中,查一下患者邹慧巧的就诊科室名字中没有病理科的所有门诊就诊记录的流水号有哪些 | SELECT txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '邹慧巧' AND hz_info.YLJGDM = '0616625' AND NOT txmzjzjlb.JZKSMC LIKE '%病理科%' UNION SELECT ftxmzj... | css |
CREATE TABLE table_name_2 (
tie_no VARCHAR,
away_team VARCHAR
) | How many times did Arsenal tie when they were away? | SELECT tie_no FROM table_name_2 WHERE away_team = "arsenal" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),... | For all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the sum of salary bin hire_date by weekday in a bar chart, display total number of salary in ascending order. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_6008 (
"Release date" text,
"Country" text,
"Classifaction" text,
"Publisher" text,
"Format" text,
"Region" text,
"Language" text,
"Sound" text,
"Subtitles" text
) | What sound has cantonese as the language, N/A as the classification, and spectrum dvd as the publisher? | SELECT "Sound" FROM table_6008 WHERE "Language" = 'cantonese' AND "Classifaction" = 'n/a' AND "Publisher" = 'spectrum dvd' | wikisql |
CREATE TABLE table_name_47 (
d_48_o VARCHAR,
d_41_√ VARCHAR
) | Name the D 48 O with D 41 of d 41 | SELECT d_48_o FROM table_name_47 WHERE d_41_√ = "d 41 √" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text... | 检测指标816429在被门诊确诊为疾病H11.754的病人身上参考值范围下限和上限是多少? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ... | css |
CREATE TABLE table_17060277_10 (
high_points VARCHAR,
date VARCHAR
) | Who did the high points in the game played on April 12? | SELECT high_points FROM table_17060277_10 WHERE date = "April 12" | sql_create_context |
CREATE TABLE table_204_978 (
id number,
"position" number,
"nation" number,
"number" number,
"name" text,
"soproni liga" number,
"uefa cup" number,
"hungarian cup" number,
"league cup" number,
"total" number
) | who is immediately before biro on the list ? | SELECT "name" FROM table_204_978 WHERE id = (SELECT id FROM table_204_978 WHERE "name" = 'peter biro') - 1 | squall |
CREATE TABLE AssignedTo (
Scientist int,
Project char(4)
)
CREATE TABLE Projects (
Code Char(4),
Name Char(50),
Hours int
)
CREATE TABLE Scientists (
SSN int,
Name Char(30)
) | Find the name of the project for which a scientist whose name contains Smith is assigned to, and count them by a pie chart | SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name | nvbench |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
... | How am I ranked among those who have not asked a question?. | SELECT (ROW_NUMBER() OVER (ORDER BY Reputation DESC)), u.Id AS "user_link", u.Reputation FROM Users AS u WHERE (SELECT COUNT(p.Id) FROM Posts AS p WHERE p.OwnerUserId = u.Id AND p.PostTypeId = 1) = 0 AND (SELECT COUNT(p.Id) FROM Posts AS p WHERE p.OwnerUserId = u.Id AND p.PostTypeId = 2) > 0 AND u.Reputation > 101 | sede |
CREATE TABLE degrees (
year number,
campus number,
degrees number
)
CREATE TABLE discipline_enrollments (
campus number,
discipline number,
year number,
undergraduate number,
graduate number
)
CREATE TABLE faculty (
campus number,
year number,
faculty number
)
CREATE TABLE... | What degrees were conferred in San Francisco State University in the year 2001? | SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Francisco State University" AND t2.year = 2001 | spider |
CREATE TABLE table_204_53 (
id number,
"date" text,
"result" text,
"opponent" text,
"event" text,
"location" text,
"method" text,
"round" number,
"time" text
) | which event ended with the longest time ? | SELECT "event" FROM table_204_53 ORDER BY "time" DESC LIMIT 1 | squall |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId numb... | most number of comments on a single post. | SELECT * FROM Comments | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is admission time and icu stay id of subject id 74032? | SELECT demographic.admittime, prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "74032" | mimicsql_data |
CREATE TABLE table_14033 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | Which Year has a Venue of bydgoszcz, poland? | SELECT AVG("Year") FROM table_14033 WHERE "Venue" = 'bydgoszcz, poland' | wikisql |
CREATE TABLE table_40814 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What is the Result when the week is later than 9, and there are 65,858 people in attendance? | SELECT "Result" FROM table_40814 WHERE "Week" > '9' AND "Attendance" = '65,858' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | Count the number of patients who are single with a lab test name of c4. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "C4" | mimicsql_data |
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... | 查一下编号为63645719的病患在7473839这个医院的出院诊断结果,出院诊断医生要姓柏 | SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '63645719' AND MED_SER_ORG_NO = '7473839' AND OUT_DIAG_DOC_NM LIKE '柏%' | css |
CREATE TABLE table_41631 (
"Rank" real,
"Location" text,
"Total Passengers" real,
"Annual change" text,
"Capacity in use" text
) | What is the average rank of the airport with a 9.3% annual change? | SELECT AVG("Rank") FROM table_41631 WHERE "Annual change" = '9.3%' | wikisql |
CREATE TABLE table_25691838_8 (
episode__number INTEGER,
original_airdate VARCHAR
) | What was the minimum number of the episode that first aired August 11? | SELECT MIN(episode__number) FROM table_25691838_8 WHERE original_airdate = "August 11" | sql_create_context |
CREATE TABLE table_61135 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | What is the status of the match with 24 against? | SELECT "Status" FROM table_61135 WHERE "Against" = '24' | wikisql |
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE flight (
flno number(4,0),
origin var... | I prefer a pie chart to understand how many flights from each origin city. | SELECT origin, COUNT(origin) FROM flight GROUP BY origin | nvbench |
CREATE TABLE ref_colors (
color_code text,
color_description text
)
CREATE TABLE products (
product_id number,
color_code text,
product_category_code text,
product_name text,
typical_buying_price text,
typical_selling_price text,
product_description text,
other_product_details t... | How many colors are never used by any product? | SELECT COUNT(*) FROM ref_colors WHERE NOT color_code IN (SELECT color_code FROM products) | spider |
CREATE TABLE table_27694 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the final score when the Temple Owls beat Virginia Tech? | SELECT "Score" FROM table_27694 WHERE "Team" = 'Virginia Tech' | wikisql |
CREATE TABLE table_name_77 (
catalogue VARCHAR,
recorded VARCHAR,
release_date VARCHAR
) | What catalogue was recorded on 9/10/67 and a release date of 1/9/68? | SELECT catalogue FROM table_name_77 WHERE recorded = "9/10/67" AND release_date = "1/9/68" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of department_id over the hire_date bin hire_date by weekday by a bar chart, and sort in asc by the the average of department id. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_48957 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Which Pick has a Name of ed hickerson, and a Round smaller than 10? | SELECT SUM("Pick") FROM table_48957 WHERE "Name" = 'ed hickerson' AND "Round" < '10' | wikisql |
CREATE TABLE table_name_15 (
player VARCHAR,
draft VARCHAR,
pick VARCHAR
) | Who is the player from the 1971 draft with a pick greater than 7? | SELECT player FROM table_name_15 WHERE draft = 1971 AND pick > 7 | sql_create_context |
CREATE TABLE table_20424014_1 (
county VARCHAR,
obama__percentage VARCHAR
) | where did obama get 39.8% | SELECT county FROM table_20424014_1 WHERE obama__percentage = "39.8%" | sql_create_context |
CREATE TABLE table_204_798 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | how many total races has this racer competed in ? | SELECT COUNT(*) FROM table_204_798 | squall |
CREATE TABLE table_20010140_10 (
high_assists VARCHAR,
date VARCHAR
) | state high assists on february 15 | SELECT high_assists FROM table_20010140_10 WHERE date = "February 15" | sql_create_context |
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, show me about the distribution of name and the amount of name , and group by attribute name in a bar chart, could you display by the Y-axis from high to low? | SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC | nvbench |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Comments (
Id number,
PostId num... | Self-Service, on-Demand Creation of OLAP Cubes over Big Data: Application to Twitter. | SELECT * FROM Votes | sede |
CREATE TABLE table_44526 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | When Kansas State had a pick of over 35, what's the highest Overall pick found? | SELECT MAX("Overall") FROM table_44526 WHERE "College" = 'kansas state' AND "Pick" > '35' | wikisql |
CREATE TABLE table_203_192 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | what were the number of competitions that had a position of first ? | SELECT COUNT("competition") FROM table_203_192 WHERE "position" = 1 | squall |
CREATE TABLE table_56392 (
"Product" text,
"2004" text,
"2003" text,
"2002" text,
"2001" text
) | What is the 2003 statistic for the product that had 514,000 tonnes in 2001? | SELECT "2003" FROM table_56392 WHERE "2001" = '514,000 tonnes' | wikisql |
CREATE TABLE table_65507 (
"Club" text,
"League/Division" text,
"Home Ground" text,
"Location" text,
"Position in 2012-13" text
) | Which club is in the First division? | SELECT "Club" FROM table_65507 WHERE "League/Division" = 'first division' | wikisql |
CREATE TABLE table_name_56 (
time VARCHAR,
game VARCHAR
) | What was the time for game 4? | SELECT time FROM table_name_56 WHERE game = 4 | sql_create_context |
CREATE TABLE table_26858 (
"Name of Award" text,
"Name of Film" text,
"Language" text,
"Awardee(s)" text,
"Cash Prize" text
) | Name the number of awardees for best cinematography | SELECT COUNT("Awardee(s)") FROM table_26858 WHERE "Name of Award" = 'Best Cinematography' | wikisql |
CREATE TABLE table_test_5 (
"id" int,
"systemic_lupus_erythematosus" bool,
"anemia" bool,
"gender" string,
"pregnancy_or_lactation" bool,
"serum_potassium" float,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"estim... | hemoglobin level below 9 mg % | SELECT * FROM table_test_5 WHERE hemoglobin_a1c_hba1c < 9 | criteria2sql |
CREATE TABLE table_1342338_3 (
party VARCHAR,
district VARCHAR
) | What kind of party is the district in Alabama 1? | SELECT party FROM table_1342338_3 WHERE district = "Alabama 1" | sql_create_context |
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 cost (
c... | how many hours have passed since patient 005-87465 received his or her last meropenem intake on the current intensive care unit visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
CREATE TABLE table_56384 (
"Rank" real,
"Building" text,
"Height" text,
"Floors" real,
"Completed" real
) | What is the lowest amount of floors after rank 1 in the Trillium (residential) building? | SELECT MIN("Floors") FROM table_56384 WHERE "Rank" > '1' AND "Building" = 'the trillium (residential)' | wikisql |
CREATE TABLE table_71332 (
"Country" text,
"Currency" text,
"1 Euro =" real,
"1 USD =" real,
"Central bank" text
) | For Central Bank of Uruguay, what's the 1USD=? | SELECT "1 USD =" FROM table_71332 WHERE "Central bank" = 'central bank of uruguay' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | what is the monthly maximum value of patient 008-32147's wbc x 1000 until 02/2104? | SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-32147')) AND lab.labname = 'wbc x 1000' AND STRFTIME('%y-%m', lab.labresulttim... | eicu |
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 (
... | give the number of patients whose drug code is doxe0.5. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "DOXE0.5" | mimicsql_data |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and manufacturer , and group by attribute name, I want to sort Y-axis in desc order please. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Manufacturer DESC | nvbench |
CREATE TABLE table_name_57 (
defenses INTEGER,
days_held VARCHAR,
reign VARCHAR
) | What is the average defenses a champion with 404 days held and a reign larger than 1 has? | SELECT AVG(defenses) FROM table_name_57 WHERE days_held = "404" AND reign > 1 | sql_create_context |
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... | 列出8322376这个医院内有多少科室在2003年5月20日到2018年4月7日期间涉及的医疗费总额高于7725.47元 | SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '8322376' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-05-20' AND '2018-04-07' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 7725.47 UNION SELECT gyb.MED_ORG_DEPT_CD FRO... | css |
CREATE TABLE artist (
artist_id number,
artist text,
age number,
famous_title text,
famous_release_date text
)
CREATE TABLE volume (
volume_id number,
volume_issue text,
issue_date text,
weeks_on_top number,
song text,
artist_id number
)
CREATE TABLE music_festival (
id... | Return names of songs in volumes that are by artists that are at least 32 years old. | SELECT T2.song FROM artist AS T1 JOIN volume AS T2 ON T1.artist_id = T2.artist_id WHERE T1.age >= 32 | spider |
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... | 在0三年九月三十日到一五年二月四日这段时间内,医院8063652门诊看病的病人共有多少 | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '8063652' AND IN_HOSP_DATE BETWEEN '2003-09-30' AND '2015-02-04' AND CLINIC_TYPE = '门诊' | css |
CREATE TABLE table_name_40 (
venue VARCHAR,
home_team VARCHAR
) | Name the venue for collingwood home team | SELECT venue FROM table_name_40 WHERE home_team = "collingwood" | sql_create_context |
CREATE TABLE table_name_36 (
pole_position VARCHAR,
winning_driver VARCHAR,
grand_prix VARCHAR
) | What was the pole position at the san marino grand prix with michael schumacher as winning driver? | SELECT pole_position FROM table_name_36 WHERE winning_driver = "michael schumacher" AND grand_prix = "san marino grand prix" | sql_create_context |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
) | Draw a bar chart for what is the average rating star for each reviewer?, show from high to low by the bar please. | SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY name DESC | nvbench |
CREATE TABLE characteristics (
characteristic_id number,
characteristic_type_code text,
characteristic_data_type text,
characteristic_name text,
other_characteristic_details text
)
CREATE TABLE products (
product_id number,
color_code text,
product_category_code text,
product_name t... | What is the unit of measurement of product named 'cumin'? | SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "cumin" | spider |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE flight_fare ... | please list afternoon flights between ST. PETERSBURG and CHARLOTTE | SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'ST. PETERSBURG')) AND to_airport IN (SELECT A... | atis |
CREATE TABLE table_11768 (
"Name" text,
"Wheel arrangement" text,
"SR No." text,
"Manufacturer" text,
"Year made" real,
"Year withdrawn" real
) | Who manufactured the vehicle withdrawn after 1932? | SELECT "Manufacturer" FROM table_11768 WHERE "Year withdrawn" > '1932' | wikisql |
CREATE TABLE table_78562 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
) | Which event had a total of defending champion? | SELECT "Event" FROM table_78562 WHERE "Total" = 'defending champion' | wikisql |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station... | For each city, what is the highest latitude for its stations. Visualize by pie chart. | SELECT city, MAX(lat) FROM station GROUP BY city | nvbench |
CREATE TABLE table_48283 (
"Athlete" text,
"Event" text,
"Swim (1.5km)" text,
"Trans 1" text,
"Bike (40km)" text,
"Trans 2" text,
"Run (10km)" text,
"Total Time" text,
"Rank" real
) | Daniela Ryf who competes in the women's even had what swim (1.5km)? | SELECT "Swim (1.5km)" FROM table_48283 WHERE "Event" = 'women''s' AND "Athlete" = 'daniela ryf' | wikisql |
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
)
... | give me the number of patients whose year of birth is less than 1882 and item id is 51482? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1882" AND lab.itemid = "51482" | mimicsql_data |
CREATE TABLE table_15348 (
"Sydney" text,
"Melbourne" text,
"Perth" text,
"Adelaide" text,
"Gold Coast" text,
"Auckland" text
) | Which Adelaide has a Sydney of yes, a Perth of no, a Melbourne of yes, and an Auckland of no? | SELECT "Adelaide" FROM table_15348 WHERE "Sydney" = 'yes' AND "Perth" = 'no' AND "Melbourne" = 'yes' AND "Auckland" = 'no' | wikisql |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE ... | give me the round trip COACH fare from BALTIMORE to DALLAS | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code ... | atis |
CREATE TABLE table_51334 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | Which driver had a grid of 18 with 68 laps? | SELECT "Driver" FROM table_51334 WHERE "Laps" = '68' AND "Grid" = '18' | wikisql |
CREATE TABLE table_name_67 (
score VARCHAR,
date VARCHAR
) | what was the score for the game on 14 april 2001? | SELECT score FROM table_name_67 WHERE date = "14 april 2001" | sql_create_context |
CREATE TABLE txmzjzjlb (
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... | 在04年8月25日到2016年7月12日内病患彭天瑞曾在医院就诊的次数有几次? | SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '彭天瑞' AND txmzjzjlb.JZKSRQ BETWEEN '2004-08-25' AND '2016-07-12' UNION SELECT COUNT(*) FROM p... | css |
CREATE TABLE table_204_10 (
id number,
"ecclesiastical jurisdictions" text,
"latin name" text,
"type" text,
"rite" text,
"ecclesiastical province" text,
"established" text,
"area (km2)" number
) | what is the total number of established dioceses ? | SELECT COUNT(*) FROM table_204_10 | squall |
CREATE TABLE table_26119 (
"Date" text,
"Total USAAF" real,
"Tot Officers" real,
"Tot Enlisted" real,
"# overseas" real,
"Officers o/s" real,
"Enlisted o/s" real
) | How many different numbers of Tot enlisted are there on the dates when the number of Enlisted o/s was 801471? | SELECT COUNT("Tot Enlisted") FROM table_26119 WHERE "Enlisted o/s" = '801471' | wikisql |
CREATE TABLE table_64451 (
"Peak" text,
"Country" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Col (m)" real
) | Which Prominence (m) has an Elevation (m) of 3,095? | SELECT MIN("Prominence (m)") FROM table_64451 WHERE "Elevation (m)" = '3,095' | wikisql |
CREATE TABLE table_16227492_1 (
attendance INTEGER,
_number VARCHAR
) | Name the most attendance for number 4 | SELECT MAX(attendance) FROM table_16227492_1 WHERE _number = 4 | sql_create_context |
CREATE TABLE table_name_59 (
right_ascension___j2000__ VARCHAR,
object_type VARCHAR,
ngc_number VARCHAR
) | Tell me the right ascension for open cluster and NGC number more than 2547 | SELECT right_ascension___j2000__ FROM table_name_59 WHERE object_type = "open cluster" AND ngc_number > 2547 | sql_create_context |
CREATE TABLE table_71485 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | For a Team 1 of Al-Merrikh, what was the aggregate? | SELECT "Agg." FROM table_71485 WHERE "Team 1" = 'al-merrikh' | 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... | how many patients whose days of hospital stay is greater than 5 and drug type is additive? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "5" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_204_461 (
id number,
"res." text,
"record" text,
"opponent" text,
"method" text,
"event" text,
"date" text,
"round" number,
"time" text,
"location" text,
"notes" text
) | how did the match between zwick and william richley last ? | SELECT "time" FROM table_204_461 WHERE "opponent" = 'william richey' | squall |
CREATE TABLE table_name_67 (
weight__kg_ INTEGER,
jersey__number VARCHAR
) | What was the lowest Weight (kg) for a player that had Jersey #10? | SELECT MIN(weight__kg_) FROM table_name_67 WHERE jersey__number = 10 | sql_create_context |
CREATE TABLE table_55131 (
"Name" text,
"Actual version" text,
"System" text,
"Platform" text,
"License" text
) | Which name has a License of gpl, and a Platform of windows? | SELECT "Name" FROM table_55131 WHERE "License" = 'gpl' AND "Platform" = 'windows' | wikisql |
CREATE TABLE genres (
id INTEGER,
name VARCHAR(120)
)
CREATE TABLE playlists (
id INTEGER,
name VARCHAR(120)
)
CREATE TABLE artists (
id INTEGER,
name VARCHAR(120)
)
CREATE TABLE employees (
id INTEGER,
last_name VARCHAR(20),
first_name VARCHAR(20),
title VARCHAR(30),
repo... | Bar chart x axis name y axis how many name, display in asc by the names. | SELECT name, COUNT(name) FROM playlists GROUP BY name ORDER BY name | nvbench |
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 scatter chart about the correlation between Team_ID and School_ID , and group by attribute ACC_Regular_Season. | SELECT Team_ID, School_ID FROM basketball_match GROUP BY ACC_Regular_Season | nvbench |
CREATE TABLE table_name_34 (
game INTEGER,
team VARCHAR,
high_assists VARCHAR
) | What is the highest Game, when Team is 'Celtics', and when High Assists is 'Hedo T rko lu (4)'? | SELECT MAX(game) FROM table_name_34 WHERE team = "celtics" AND high_assists = "hedo türkoğlu (4)" | sql_create_context |
CREATE TABLE table_4660 (
"Date" text,
"Result" text,
"Score" text,
"Stadium" text,
"City" text,
"Crowd" real
) | What was the result of the match that took place in Perth, featuring a score of 48-12? | SELECT "Result" FROM table_4660 WHERE "Score" = '48-12' AND "City" = 'perth' | wikisql |
CREATE TABLE table_38774 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the Name of the Quarterback with a Pick # less than 11? | SELECT "Name" FROM table_38774 WHERE "Pick #" < '11' AND "Position" = 'quarterback' | wikisql |
CREATE TABLE table_name_21 (
category VARCHAR,
year INTEGER
) | What is a category before 2012? | SELECT category FROM table_name_21 WHERE year < 2012 | sql_create_context |
CREATE TABLE table_name_16 (
appearances INTEGER,
team VARCHAR,
rank VARCHAR
) | How many appearances for psv eindhoven ranked above 11? | SELECT SUM(appearances) FROM table_name_16 WHERE team = "psv eindhoven" AND rank < 11 | sql_create_context |
CREATE TABLE table_name_40 (
gold INTEGER,
silver VARCHAR,
total VARCHAR
) | What is the highest gold with 1 silver, and more than 1 altogether? | SELECT MAX(gold) FROM table_name_40 WHERE silver = 1 AND total > 1 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text... | 号码是75590344936的住院患者开出的检验报告单是多少份? | SELECT COUNT(*) FROM zyjybgb WHERE zyjybgb.JZLSH = '75590344936' UNION SELECT COUNT(*) FROM mzjybgb WHERE mzjybgb.JZLSH = '75590344936' | css |
CREATE TABLE table_name_16 (
opponent VARCHAR,
score VARCHAR
) | Who was the opponent at the game with a score of 7 6? | SELECT opponent FROM table_name_16 WHERE score = "7–6" | 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... | 患者55593756的哪些编号的检验报告单对应的检验结果指标均不合格? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info... | css |
CREATE TABLE table_14426 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" real,
"Time" text
) | Which Record has a Method of submission (heel hook), a Round larger than 1, and a Time of 2:28? | SELECT "Record" FROM table_14426 WHERE "Method" = 'submission (heel hook)' AND "Round" > '1' AND "Time" = '2:28' | wikisql |
CREATE TABLE table_21644 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | What is the minimum attendance on games of record 0-2-1 | SELECT MIN("Attendance") FROM table_21644 WHERE "Record" = '0-2-1' | wikisql |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | Best time for an answer. | WITH tmp AS (SELECT TimeDiff = DATEDIFF(minute, q.CreationDate, CreationDate), Period = ROUND((CAST(DATEPART('weekday', q.CreationDate) AS DECIMAL) + CAST(DATEPART('hour', q.CreationDate) AS DECIMAL) / 24), 2) FROM Posts AS q LEFT OUTER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE q.AcceptedAnswerId > 0 AND q.Cre... | sede |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
... | The longest post that don't contain awesome newlines.. For some people, the enter key seems to be broken... | SELECT ph1.PostId AS "post_link", LENGTH(ph1.Text) FROM PostHistory AS ph1 WHERE NOT REPLACE(REPLACE(ph1.Text, CHAR(13), 'AWESOMENEWLINE'), CHAR(10), 'AWESOMENEWLINE') LIKE '%AWESOMENEWLINE%' AND NOT EXISTS(SELECT ph2.Id FROM PostHistory AS ph2 WHERE ph2.PostId = ph1.PostId AND ph2.CreationDate > ph1.CreationDate) ORDE... | sede |
CREATE TABLE table_204_737 (
id number,
"year" number,
"order" text,
"quantity" number,
"ger nos." text
) | how mans years have ger nos below 900 ? | SELECT COUNT(DISTINCT "year") FROM table_204_737 WHERE "ger nos." < 900 | squall |
CREATE TABLE wdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | 在57012186438出院的时候哪个科室为其办理的手续科室的代号是啥? | SELECT wdmzjzjlb.CYKSDM, wdmzjzjlb.CYKSMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '57012186438' UNION SELECT bdmzjzjlb.CYKSDM, bdmzjzjlb.CYKSMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '57012186438' | css |
CREATE TABLE table_name_86 (
player VARCHAR,
round VARCHAR,
overall VARCHAR
) | Who is the player on round 7 with an overall ranking of #195? | SELECT player FROM table_name_86 WHERE round = "7" AND overall = "#195" | 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... | Provide the number of white ethnic background patients for whom a total protein body fluid lab test has been ordered. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE" AND lab.label = "Total Protein, Body Fluid" | mimicsql_data |
CREATE TABLE table_name_71 (
game VARCHAR,
record VARCHAR
) | What is the Game with a Record of 19-15? | SELECT game FROM table_name_71 WHERE record = "19-15" | 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 admission type and diagnoses short title of subject id 2560? | SELECT demographic.admission_type, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
g... | what is the maximum hospital cost for a drug with a name called actonel? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'actonel') GROUP BY cost.hadm_id) AS t1 | mimic_iii |
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... | 哪个项目在医疗机构7821897的使用次数排第二? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '7821897' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 2 | css |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
oth... | what are total transaction amounts for each transaction type?, show by the x axis in desc please. | SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.