context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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 products with a price between 60 and 120, what is the relationship between price and manufacturer ? | SELECT Price, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 | nvbench |
CREATE TABLE table_61094 (
"Name" text,
"Date" text,
"Year" real,
"Location" text,
"Killed" text,
"Injured" text
) | What is Year, when Name is 'Dong Shihou, 29 ( )'? | SELECT "Year" FROM table_61094 WHERE "Name" = 'dong shihou, 29 (董世侯)' | wikisql |
CREATE TABLE table_23286158_9 (
high_points VARCHAR,
team VARCHAR
) | Who led with the highest points during the game against Indiana? | SELECT high_points FROM table_23286158_9 WHERE team = "Indiana" | sql_create_context |
CREATE TABLE table_train_6 (
"id" int,
"bleeding" int,
"systolic_blood_pressure_sbp" int,
"mean_arterial_pressure_map" int,
"active_infection" bool,
"hypotension" bool,
"age" float,
"NOUSE" float
) | suspected source of infection as etiology for hypotension | SELECT * FROM table_train_6 WHERE active_infection = 1 AND hypotension = 1 | criteria2sql |
CREATE TABLE table_name_25 (
nationality___opponent VARCHAR,
date VARCHAR
) | Name Nationality / Opponent on 10 january 1998? | SELECT nationality___opponent FROM table_name_25 WHERE date = "10 january 1998" | sql_create_context |
CREATE TABLE Documents (
document_code VARCHAR(15),
document_structure_code VARCHAR(15),
document_type_code VARCHAR(15),
access_count INTEGER,
document_name VARCHAR(80)
)
CREATE TABLE Images (
image_id INTEGER,
image_alt_text VARCHAR(80),
image_name VARCHAR(40),
image_url VARCHAR(25... | Return a histogram on what are the different role codes for users, and how many users have each?, could you rank by the role_code in desc? | SELECT role_code, COUNT(*) FROM Users GROUP BY role_code ORDER BY role_code DESC | nvbench |
CREATE TABLE table_name_51 (
scoring_average INTEGER,
top_10s VARCHAR
) | What was the average scoring the the top 10s is 4? | SELECT AVG(scoring_average) FROM table_name_51 WHERE top_10s = 4 | 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 drug type of subject name jerry deberry? | SELECT prescriptions.drug_type FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | provide the number of patients whose ethnicity is black/cape verdean and lab test name is pco2? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND lab.label = "pCO2" | mimicsql_data |
CREATE TABLE table_2224692_1 (
hp__hr_gal VARCHAR,
gge VARCHAR
) | What's the HP -hr/gal of the fuel whose GGE is 0.9000? | SELECT hp__hr_gal FROM table_2224692_1 WHERE gge = "0.9000" | sql_create_context |
CREATE TABLE table_32591 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the largest crowd at princes park? | SELECT MAX("Crowd") FROM table_32591 WHERE "Venue" = 'princes park' | wikisql |
CREATE TABLE table_34627 (
"Award" text,
"Year" real,
"Category" text,
"Work" text,
"Result" text
) | Which Year is the highest one that has a Work of the clone, and an Award of contigo award? | SELECT MAX("Year") FROM table_34627 WHERE "Work" = 'the clone' AND "Award" = 'contigo award' | wikisql |
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... | 门诊上一般被诊断为疾病O32.933的患者的检测指标830460数值的平均值以及最值会是怎样的数据 | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'O32.933' AND jyjgzbb.JCZBDM = '830460' | css |
CREATE TABLE table_204_26 (
id number,
"name" text,
"position" text,
"birth date/age at start of campaign" text,
"games in campaign" text,
"club" text
) | which position is listed the most on this chart ? | SELECT "position" FROM table_204_26 GROUP BY "position" ORDER BY COUNT(*) DESC 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,
... | count the number of patients whose year of death is less than or equal to 2115 and procedure long title is other endoscopy of small intestine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2115.0" AND procedures.long_title = "Other endoscopy of small intestine" | mimicsql_data |
CREATE TABLE branch (
Branch_ID int,
Name text,
Open_year text,
Address_road text,
City text,
membership_amount text
)
CREATE TABLE membership_register_branch (
Member_ID int,
Branch_ID text,
Register_Year text
)
CREATE TABLE purchase (
Member_ID int,
Branch_ID text,
Ye... | Count the hometown by hometown using a bar chart, show total number in asc order. | SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown ORDER BY COUNT(Hometown) | nvbench |
CREATE TABLE table_1341522_24 (
opponent VARCHAR,
district VARCHAR
) | Who are the opponents in Massachusetts5 district? | SELECT opponent FROM table_1341522_24 WHERE district = "Massachusetts5" | sql_create_context |
CREATE TABLE table_55871 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | What is Reuben Foster's college? | SELECT "College" FROM table_55871 WHERE "Player" = 'reuben foster' | 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,
... | 70649441899那个门诊在哪年哪月的哪一天就诊 | SELECT zzmzjzjlb.JZKSRQ FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '70649441899' UNION SELECT fzzmzjzjlb.JZKSRQ FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '70649441899' | css |
CREATE TABLE table_name_57 (
player VARCHAR,
to_par VARCHAR,
country VARCHAR
) | Who was the player for Japan when the to par was smaller than 7? | SELECT player FROM table_name_57 WHERE to_par < 7 AND country = "japan" | sql_create_context |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 哪几个医院为患者吴泰和开过编号为772079171的药物 | SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_NM = '吴泰和' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '772079171') UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_NM = '吴泰和' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22... | css |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | how many hours has it been since patient 017-16041 was admitted to icu? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '017-16041' AND patient.unitdischargetime IS NULL | eicu |
CREATE TABLE table_4180 (
"Position" real,
"Top MC" text,
"Year inducted" real,
"Appearances" real,
"Peak ranking" real
) | How many appearances by Meek Mill? | SELECT MAX("Appearances") FROM table_4180 WHERE "Top MC" = 'Meek Mill' | wikisql |
CREATE TABLE table_name_42 (
season INTEGER,
wins VARCHAR,
ties VARCHAR,
team VARCHAR
) | Which Season has Ties smaller than 1, and a Team of vancouver grizzlies, and Wins smaller than 1? | SELECT SUM(season) FROM table_name_42 WHERE ties < 1 AND team = "vancouver grizzlies" AND wins < 1 | sql_create_context |
CREATE TABLE table_38711 (
"Task No." real,
"Date given" text,
"Head of Household" text,
"Hand Grenade User" text,
"Hand Grenade Recipient" text
) | What date was Rica head of household? | SELECT "Date given" FROM table_38711 WHERE "Head of Household" = 'rica' | wikisql |
CREATE TABLE table_69700 (
"Date" text,
"Opponents" text,
"Result F\u2013A" text,
"Attendance" real,
"Group position" text
) | Result F A of 2 0 had what group position? | SELECT "Group position" FROM table_69700 WHERE "Result F\u2013A" = '2–0' | wikisql |
CREATE TABLE table_name_8 (
record VARCHAR,
head_coach VARCHAR
) | What was the record of the team with head coach Steve Spurrier? | SELECT record FROM table_name_8 WHERE head_coach = "steve spurrier" | sql_create_context |
CREATE TABLE table_204_969 (
id number,
"composer" text,
"title" text,
"genre" text,
"date" number,
"notes" text
) | what is the difference in years of granville bantock 's work compared to pete dohert ? | SELECT ABS((SELECT "date" FROM table_204_969 WHERE "composer" = 'granville bantock') - (SELECT "date" FROM table_204_969 WHERE "composer" = 'pete doherty')) | squall |
CREATE TABLE table_2308 (
"#" real,
"Date" text,
"at/vs." text,
"Opponent" text,
"Score" text,
"Attendance" real,
"Record" text
) | Name the date for attendance 9372 | SELECT "Date" FROM table_2308 WHERE "Attendance" = '9372' | wikisql |
CREATE TABLE table_51353 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How much did the away team Melbourne score? | SELECT "Away team score" FROM table_51353 WHERE "Away team" = 'melbourne' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | what is the top three most common medications that followed within 2 months for patients who received cont inv mec ven 96+ hrs until 4 years ago? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ... | mimic_iii |
CREATE TABLE table_12713 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" text
) | What is the to par for the player with winnings of 49,500? | SELECT "To par" FROM table_12713 WHERE "Money ( \u00a3 )" = '49,500' | wikisql |
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... | 医疗就诊43665866915在其出院时经过诊断的疾病它编号以及其名称分别是什么? | SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '43665866915' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '43665866915' | css |
CREATE TABLE teaches (
id text,
course_id text,
sec_id text,
semester text,
year number
)
CREATE TABLE time_slot (
time_slot_id text,
day text,
start_hr number,
start_min number,
end_hr number,
end_min number
)
CREATE TABLE takes (
id text,
course_id text,
sec_i... | Find the year which offers the largest number of courses. | SELECT year FROM section GROUP BY year ORDER BY COUNT(*) DESC LIMIT 1 | spider |
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 (
... | how many patients whose item id is 51257 and lab test abnormal status is delta? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51257" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_name_45 (
year INTEGER,
points VARCHAR,
rank VARCHAR
) | What is year that has points larger than 46, and a rank of 6th? | SELECT SUM(year) FROM table_name_45 WHERE points > 46 AND rank = "6th" | sql_create_context |
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... | 医院6248314全部诊疗记录里参照科室编码的不同算算看统筹基金的花费比上医疗总费用的平均比值 | SELECT t_kc21.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '6248314' GROUP BY t_kc21.MED_ORG_DEPT_CD | css |
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's the name of the specimen test that patient 73693 last got last month? | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73693) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY microbiology... | mimic_iii |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of email and department_id , I want to list Y-axis from high to low order please. | SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC | nvbench |
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptroller text,
attorney_general text,
us_senate text
)
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE el... | Return all the committees that have delegates from Democratic party. | SELECT T1.committee FROM election AS T1 JOIN party AS T2 ON T1.party = T2.party_id WHERE T2.party = "Democratic" | spider |
CREATE TABLE table_204_988 (
id number,
"responsible minister(s)" text,
"crown entities" text,
"monitoring department(s)" text,
"category / type" text,
"empowering legislation" text
) | how many entities have finance as a responsible minister ? | SELECT COUNT("crown entities") FROM table_204_988 WHERE "responsible minister(s)" = 'finance' | squall |
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 the relationship between code and revenue , and group by attribute founder. | SELECT T1.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
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 2182? | SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2182" | mimicsql_data |
CREATE TABLE table_204_957 (
id number,
"year" number,
"team" text,
"games" number,
"combined tackles" number,
"tackles" number,
"assisted tackles" number,
"sacks" number,
"forced fumbles" number,
"fumble recoveries" number,
"fumble return yards" number,
"interceptions" n... | what team did he play for the least amount of years ? | SELECT "team" FROM table_204_957 GROUP BY "team" ORDER BY COUNT("year") LIMIT 1 | squall |
CREATE TABLE table_21676617_1 (
year VARCHAR,
odds_of_winner VARCHAR
) | When were the odds of winner 16.66? | SELECT year FROM table_21676617_1 WHERE odds_of_winner = "16.66" | sql_create_context |
CREATE TABLE table_204_129 (
id number,
"place" number,
"team" text,
"titles" number,
"runners-up" number,
"winning years" text
) | how many total titles were won ? | SELECT SUM("titles") FROM table_204_129 | squall |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | what are the three most commonly prescribed medications in a year before for patients who were previously diagnosed with oth lymp unsp xtrndl org during the same month? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)... | when was the last time that patient 18159 had 2 int mam-cor art bypass's since 2101? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = '2 int mam-cor art bypass') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18159) AND... | mimic_iii |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABL... | Top 20 users called Nathan. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE DisplayName LIKE '%Nathan%' ORDER BY Reputation DESC LIMIT 20 | sede |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,... | Posts with the highest answer count. | SELECT ParentId, COUNT(ParentId) FROM Posts WHERE PostTypeId = 2 GROUP BY ParentId ORDER BY COUNT(ParentId) DESC LIMIT 500 | sede |
CREATE TABLE table_61713 (
"Date" text,
"Opponent#" text,
"Rank #" text,
"Site" text,
"Result" text,
"Attendance" text
) | Who was the opponent when the attendance was 87,453? | SELECT "Opponent#" FROM table_61713 WHERE "Attendance" = '87,453' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId ... | Get question and answer votes. | SELECT Id, Score FROM Posts WHERE Id IN (9437139, 10546229) | sede |
CREATE TABLE table_15944_5 (
specific_impulse__s_ INTEGER,
effective_exhaust_velocity__m_s_ VARCHAR
) | What is the maximum specific impulse with a 4423 m/s effective exhaust velocity? | SELECT MAX(specific_impulse__s_) FROM table_15944_5 WHERE effective_exhaust_velocity__m_s_ = 4423 | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE month (
month_number int,
... | does YX serve PHILADELPHIA | 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 ((flight.to_airport = AIRPORT_SERVICE_0.airport_code AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA') OR (flight.from_ai... | atis |
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 (
... | what is the number of patients whose age is less than 59 and days of hospital stay is greater than 1? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "59" AND demographic.days_stay > "1" | mimicsql_data |
CREATE TABLE table_38409 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | How many Wins has a Scored of 27 and Draws smaller than 5? | SELECT COUNT("Wins") FROM table_38409 WHERE "Scored" = '27' AND "Draws" < '5' | wikisql |
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE appellations (
no number,
appelation text,
county text,
state text,
area text,... | What are the names of wines made from red grapes? | SELECT DISTINCT T2.name FROM grapes AS T1 JOIN wine AS T2 ON T1.grape = T2.grape WHERE T1.color = "Red" | spider |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test... | Find the number of courses for each subject in a pie chart. | SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id | nvbench |
CREATE TABLE table_2761641_1 (
rebounds_per_game VARCHAR,
tournament VARCHAR
) | How many rebounds per game did he have at the 2006 fiba world championship? | SELECT rebounds_per_game FROM table_2761641_1 WHERE tournament = "2006 FIBA World Championship" | sql_create_context |
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER... | Plot calendar date by how many calendar date as a line chart, rank X in asc order please. | SELECT Calendar_Date, COUNT(Calendar_Date) FROM Ref_Calendar ORDER BY Calendar_Date | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | count the number of patients whose death status is 0 and year of birth is less than 2114? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2114" | mimicsql_data |
CREATE TABLE table_2446333_2 (
circuit VARCHAR,
country VARCHAR
) | Name the circuit for united arab emirates | SELECT circuit FROM table_2446333_2 WHERE country = "United Arab Emirates" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | when had patient 002-52932 had urinary catheter output: indwelling/continuous ure output for the last time on the first intensive care unit visit? | SELECT 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 = '002-52932') AND NOT patient.unitdischargetime IS NULL... | eicu |
CREATE TABLE table_24143253_1 (
deceased_spouse VARCHAR,
name VARCHAR
) | Name the decease spouse for carol deluise | SELECT deceased_spouse FROM table_24143253_1 WHERE name = "Carol DeLuise" | sql_create_context |
CREATE TABLE table_9904 (
"Generation" text,
"Birthday" text,
"Birthplace" text,
"Blood Type" text,
"Agency" text
) | What's the blood type of the member from the vision factory agency? | SELECT "Blood Type" FROM table_9904 WHERE "Agency" = 'vision factory' | wikisql |
CREATE TABLE table_name_2 (
silver VARCHAR,
rank VARCHAR
) | How many Silvers that have a Rank of 2? | SELECT COUNT(silver) FROM table_name_2 WHERE rank = "2" | sql_create_context |
CREATE TABLE table_7030 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the sum of Bronze when the rank is 7, and the total is more than 22? | SELECT SUM("Bronze") FROM table_7030 WHERE "Rank" = '7' AND "Total" > '22' | wikisql |
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... | 看看给患者陈建元开药品6907的医院有哪些 | SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '陈建元' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '6907') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '陈建元' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID F... | css |
CREATE TABLE table_51310 (
"Player" text,
"Team" text,
"Opponent" text,
"Year" real,
"Score" text
) | Which team did daniel bradshaw play for after 1935? | SELECT "Team" FROM table_51310 WHERE "Year" > '1935' AND "Player" = 'daniel bradshaw' | wikisql |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
a... | Show the number of male and female assistant professors with a pie chart. | SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex | nvbench |
CREATE TABLE table_62759 (
"Team" text,
"Country" text,
"Home" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
) | Who is the third on the team from Madison, Wisconsin that has Craig Brown as skip? | SELECT "Third" FROM table_62759 WHERE "Home" = 'madison, wisconsin' AND "Skip" = 'craig brown' | wikisql |
CREATE TABLE table_44969 (
"Pollutant" text,
"Type" text,
"Standard" text,
"Averaging Time" text,
"Regulatory Citation" text
) | what is the type when the averaging time is 1-hour and the standard is 0.12 ppm (235 g/m )? | SELECT "Type" FROM table_44969 WHERE "Averaging Time" = '1-hour' AND "Standard" = '0.12 ppm (235 μg/m³)' | wikisql |
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_host... | Show different nationalities along with the number of hosts of each nationality in a bar chart, and display y-axis in desc order. | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY COUNT(*) DESC | nvbench |
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,
... | 通过检验报告单显示患者05865201的哪些检验结果上的指标是正常的?检验报告单上面的号码是多少呀? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ... | css |
CREATE TABLE table_1139835_9 (
runner_up VARCHAR,
score VARCHAR
) | Who are all the runner ups when the score is 9.12 (66) 5.6 (36)? | SELECT runner_up FROM table_1139835_9 WHERE score = "9.12 (66) – 5.6 (36)" | sql_create_context |
CREATE TABLE table_1341865_11 (
district VARCHAR,
incumbent VARCHAR
) | What district did Donald Ray Matthews belong to? | SELECT district FROM table_1341865_11 WHERE incumbent = "Donald Ray Matthews" | sql_create_context |
CREATE TABLE table_2127 (
"Rank" real,
"Couple" text,
"Judges" real,
"Public" real,
"Total" real,
"Vote percentage" text,
"Result" text
) | What couple had a vote percentage of 7.691% | SELECT "Couple" FROM table_2127 WHERE "Vote percentage" = '7.691%' | wikisql |
CREATE TABLE table_75620 (
"Source" text,
"Date" text,
"Goldberg" text,
"Murray" text,
"Silbert" text,
"Undecided" text
) | What is the date of the poll with Silbert at 18%? | SELECT "Date" FROM table_75620 WHERE "Silbert" = '18%' | wikisql |
CREATE TABLE table_2263152_1 (
release_date VARCHAR,
security_issues VARCHAR,
distribution_mechanism VARCHAR
) | If the security issues is 99-025 and the distribution mechanism is the Microsoft website, what is the release date total number? | SELECT COUNT(release_date) FROM table_2263152_1 WHERE security_issues = "99-025" AND distribution_mechanism = "Microsoft website" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | what is admission type and drug code of subject id 2560? | SELECT demographic.admission_type, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_19310 (
"Team" text,
"Average" text,
"Points" real,
"Played" real,
"1989-90" text,
"1990-91" text,
"1991-1992" real
) | Name the least points where 1989-90 is 31 | SELECT MIN("Points") FROM table_19310 WHERE "1989-90" = '31' | wikisql |
CREATE TABLE table_17544 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | Who wrote the episode 14 in series? | SELECT "Written by" FROM table_17544 WHERE "No. in series" = '14' | wikisql |
CREATE TABLE table_name_82 (
attendance INTEGER,
week VARCHAR
) | what is the highest attendance for week 6? | SELECT MAX(attendance) FROM table_name_82 WHERE week = 6 | sql_create_context |
CREATE TABLE table_1214 (
"Processor Speed (MHz)" real,
"Input Clock (MHz)" text,
"Voltage Center (V)" text,
"Voltage Range (V)" text,
"Part Number" text,
"Clock Multiplier" text,
"S-Spec Number" text
) | What is the processor speed (mhz) for part number a80486dx4-75? | SELECT COUNT("Processor Speed (MHz)") FROM table_1214 WHERE "Part Number" = 'A80486DX4-75' | wikisql |
CREATE TABLE student (
dept_code VARCHAR
) | Find the number of students for each department. | SELECT COUNT(*), dept_code FROM student GROUP BY dept_code | sql_create_context |
CREATE TABLE table_name_14 (
goals VARCHAR,
ends VARCHAR,
since VARCHAR
) | Which Goals have Ends of 30 june 2010, and Since larger than 2007? | SELECT goals FROM table_name_14 WHERE ends = "30 june 2010" AND since > 2007 | sql_create_context |
CREATE TABLE table_61735 (
"7:00 am" text,
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"4:30 pm" text,
"5:00 pm" text,
"6:30 pm" text
) | What 1:00 pm has a 6:30 pm of local programs, and a 7:30 am of animaniacs? | SELECT "1:00 pm" FROM table_61735 WHERE "6:30 pm" = 'local programs' AND "7:30 am" = 'animaniacs' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
... | what are the four most frequently performed procedures for patients of the 50s in 2100? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND STRFTIME('%y', treatment.treatmenttime) = '2100' GROUP BY treatment.t... | eicu |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
... | Show the faculty id of each faculty member, along with the number of students he or she advises in a scatter chart | SELECT FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.FacID | nvbench |
CREATE TABLE table_103084_4 (
year VARCHAR,
bbc_one_rank VARCHAR
) | How many years did BBC One rank 20th? | SELECT COUNT(year) FROM table_103084_4 WHERE bbc_one_rank = "20th" | sql_create_context |
CREATE TABLE table_name_70 (
surface VARCHAR,
date VARCHAR
) | Name the surface on june 11, 1995 | SELECT surface FROM table_name_70 WHERE date = "june 11, 1995" | sql_create_context |
CREATE TABLE table_204_109 (
id number,
"district" text,
"incumbent" text,
"party" text,
"first\nelected" text,
"result" text,
"candidates" text
) | what is the last party on this chart ? | SELECT "party" FROM table_204_109 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_54223 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Trofeo Fast Team" text
) | Which points classification shares a general classification of Bernard Hinault, a Trofeo Fast Tem of Bianchi, was won by Urs Freuler, and was stage 4? | SELECT "Points classification" FROM table_54223 WHERE "General classification" = 'bernard hinault' AND "Trofeo Fast Team" = 'bianchi' AND "Winner" = 'urs freuler' AND "Stage" = '4' | wikisql |
CREATE TABLE table_28946565_2 (
couple VARCHAR,
week_2 VARCHAR
) | Which couple had a week 2 score of exactly 23? | SELECT couple FROM table_28946565_2 WHERE week_2 = 23 | sql_create_context |
CREATE TABLE table_name_93 (
year VARCHAR,
name VARCHAR
) | What is Year, when Name is 'Dong Shihou, 29 ( )'? | SELECT year FROM table_name_93 WHERE name = "dong shihou, 29 (董世侯)" | sql_create_context |
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 demographic ... | count the number of patients whose age is less than 56 and lab test category is hematology? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "56" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_name_43 (
circuit VARCHAR,
race_name VARCHAR
) | On what circuit was the iii Reims Grand Prix held? | SELECT circuit FROM table_name_43 WHERE race_name = "iii reims grand prix" | sql_create_context |
CREATE TABLE table_27132791_3 (
player VARCHAR,
nfl_team VARCHAR
) | How many different players does the Washington Redskins have? | SELECT COUNT(player) FROM table_27132791_3 WHERE nfl_team = "Washington Redskins" | sql_create_context |
CREATE TABLE table_242813_2 (
league VARCHAR,
strikeouts VARCHAR
) | Name the league for strikeouts being 451 | SELECT league FROM table_242813_2 WHERE strikeouts = 451 | sql_create_context |
CREATE TABLE table_name_41 (
laps VARCHAR,
driver VARCHAR
) | How many laps did Jackie Oliver do? | SELECT laps FROM table_name_41 WHERE driver = "jackie oliver" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.