context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | 疾病S14.067的病号郑思源在门诊诊断时的氨基末端B型利钠肽的结果定量及其单位分别是多少? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ... | css |
CREATE TABLE table_53824 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What was the Winning score for the Mynavi ABC Championship Tournament? | SELECT "Winning score" FROM table_53824 WHERE "Tournament" = 'mynavi abc championship' | wikisql |
CREATE TABLE artist (
artist_name varchar2(50),
country varchar2(20),
gender varchar2(20),
preferred_genre varchar2(50)
)
CREATE TABLE files (
f_id number(10),
artist_name varchar2(50),
file_size varchar2(20),
duration varchar2(20),
formats varchar2(20)
)
CREATE TABLE song (
so... | What countries are the female artists who sung in the language Bangla from, and count them by a bar chart, and display Y-axis from high to low order. | SELECT T1.country, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla" GROUP BY T1.country ORDER BY T1.country 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... | Finds Posts with images ranked by score. | SELECT Score AS "Score", Id AS "post_link" FROM Posts WHERE PostTypeId = 2 AND Body LIKE '%http://i.imgur.com/%' ORDER BY Score | sede |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | in this year, how many patients were prescribed with hydrochlorothiazide within 2 months after receiving appl ext fix-tib/fibula? | SELECT COUNT(DISTINCT t1.subject_id) 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 WHERE d_icd_procedures.short_title = 'appl ext fi... | mimic_iii |
CREATE TABLE table_10017 (
"Rank" text,
"Team" text,
"Athletes" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Run 4" text,
"Final" text
) | What is Team, when Run 3 is 1:24.00? | SELECT "Team" FROM table_10017 WHERE "Run 3" = '1:24.00' | wikisql |
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
date_of_birth text
)
CREATE TABLE entrepreneur (
entrepreneur_id number,
people_id number,
company text,
money_requested number,
investor text
) | What are the investors who have invested in both entrepreneurs who requested more than 140000 and entrepreneurs who requested less than 120000? | SELECT investor FROM entrepreneur WHERE money_requested > 140000 INTERSECT SELECT investor FROM entrepreneur WHERE money_requested < 120000 | spider |
CREATE TABLE table_name_18 (
tournament VARCHAR
) | What was 2009, when 2012 was A, when 2003 was A, and then the Tournament was the Madrid Masters? | SELECT 2009 FROM table_name_18 WHERE 2012 = "a" AND 2003 = "a" AND tournament = "madrid masters" | sql_create_context |
CREATE TABLE table_27569 (
"Player" text,
"Games Played" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
) | Which player had 6 assists? | SELECT "Player" FROM table_27569 WHERE "Assists" = '6' | wikisql |
CREATE TABLE table_name_87 (
tries_for VARCHAR,
lost VARCHAR
) | How many tries were for the 7 lost? | SELECT tries_for FROM table_name_87 WHERE lost = "7" | sql_create_context |
CREATE TABLE table_25947046_1 (
jews_and_others_1 INTEGER
) | What is the highest Jews and others 1? | SELECT MAX(jews_and_others_1) FROM table_25947046_1 | 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... | find out the number of patients with procedure icd9 code 9961 who have been discharged to skilled nursing facility. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SNF" AND procedures.icd9_code = "9961" | mimicsql_data |
CREATE TABLE table_name_86 (
Id VARCHAR
) | Which 2010 has a 2009 of 0 / 4? | SELECT 2010 FROM table_name_86 WHERE 2009 = "0 / 4" | sql_create_context |
CREATE TABLE table_13343 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
) | what is the latitude for the berlin township with a geo id less than 3801706260 | SELECT COUNT("Latitude") FROM table_13343 WHERE "Township" = 'berlin' AND "GEO ID" < '3801706260' | wikisql |
CREATE TABLE table_755 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | In what year was Phil J. Welch first elected? | SELECT "First elected" FROM table_755 WHERE "Incumbent" = 'Phil J. Welch' | wikisql |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Draw a bar chart about the distribution of Name and Weight , rank by the X in asc. | SELECT Name, Weight FROM people ORDER BY Name | nvbench |
CREATE TABLE table_10272 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the away team from st kilda? | SELECT "Away team" FROM table_10272 WHERE "Home team" = 'st kilda' | wikisql |
CREATE TABLE table_name_7 (
rank INTEGER,
lane VARCHAR,
nationality VARCHAR
) | What is the total average for Rank entries where the Lane listed is smaller than 4 and the Nationality listed is San Marino? | SELECT AVG(rank) FROM table_name_7 WHERE lane < 4 AND nationality = "san marino" | sql_create_context |
CREATE TABLE table_45897 (
"Name" text,
"Listed" text,
"Location" text,
"County" text,
"Type" text
) | What bridge is a pratt pony through truss tyoe bridge? | SELECT "Name" FROM table_45897 WHERE "Type" = 'pratt pony through truss' | wikisql |
CREATE TABLE table_name_59 (
quantity VARCHAR,
type VARCHAR
) | What is the Quantity of type 2-4-2t? | SELECT COUNT(quantity) FROM table_name_59 WHERE type = "2-4-2t" | sql_create_context |
CREATE TABLE table_name_5 (
record VARCHAR,
game VARCHAR,
opponent VARCHAR
) | What is the Record of the Game after 40 with New York Rangers as Opponent? | SELECT record FROM table_name_5 WHERE game > 40 AND opponent = "new york rangers" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 列出医院9767993所有医疗就诊记录的民政补助与医疗费总额的比值有什么最大值,在不同科室编码和入院诊断疾病名称下,并降序排序? | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY / 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 = '9767993' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) D... | css |
CREATE TABLE table_24786958_2 (
week INTEGER,
kickoff VARCHAR
) | What week had kickoff time at 6:00 p.m.? | SELECT MIN(week) FROM table_24786958_2 WHERE kickoff = "6:00 p.m." | sql_create_context |
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... | Bar chart x axis acc road y axis how many acc road, and sort Y in asc order. | SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY COUNT(ACC_Road) | nvbench |
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 ... | calculate the average age of self pay insurance patients who had urgent hospital admission. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.insurance = "Self Pay" | mimicsql_data |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id, and order by the y-axis from high to low. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC | nvbench |
CREATE TABLE table_68281 (
"Representative" text,
"Title" text,
"Presentation of credentials" text,
"Termination of mission" text,
"Appointed by" text
) | Name the representative with presentation of credentials of august 16, 1928 | SELECT "Representative" FROM table_68281 WHERE "Presentation of credentials" = 'august 16, 1928' | wikisql |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 看看被门诊诊断为疾病U99.814的患者柏志国的检测指标095190的结果定量是什么?单位又是什么 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ... | css |
CREATE TABLE table_name_71 (
tournament VARCHAR
) | What is the 2013 of the grand slam tournaments? | SELECT 2013 FROM table_name_71 WHERE tournament = "grand slam tournaments" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId numb... | Questions with comments but no answers. | SELECT Id AS "post_link", Score, CreationDate AS "posted_on", CommentCount AS "number_of_comments" FROM Posts AS p WHERE AnswerCount = 0 AND CommentCount > 0 AND ClosedDate IS NULL ORDER BY CommentCount DESC | sede |
CREATE TABLE table_name_9 (
case_length VARCHAR,
name VARCHAR
) | A .416 barrett has which Case Length? | SELECT case_length FROM table_name_9 WHERE name = ".416 barrett" | sql_create_context |
CREATE TABLE table_name_59 (
venue VARCHAR,
date VARCHAR,
status VARCHAR,
against VARCHAR
) | Which venue had a status of five nations, an against larger than 12 and took place on 15/02/1975? | SELECT venue FROM table_name_59 WHERE status = "five nations" AND against > 12 AND date = "15/02/1975" | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
... | show me the flights from DENVER to WESTCHESTER COUNTY | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WESTCHE... | atis |
CREATE TABLE table_29114 (
"Event" text,
"Start Date" text,
"Finish Date" text,
"Start" text,
"Finish" text,
"Distance" text,
"Abu Dhabi" text,
"Camper" real,
"Groupama" real,
"Puma" text,
"Sanya" text,
"Telef\u00f3nica" real
) | If puma is 12, what is camper? | SELECT MIN("Camper") FROM table_29114 WHERE "Puma" = '12' | wikisql |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many patients born before the year 2146 had an item id 51352? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2146" AND lab.itemid = "51352" | mimicsql_data |
CREATE TABLE table_name_90 (
wins VARCHAR,
club VARCHAR,
draws VARCHAR
) | How many wins did Cobden have when draws were more than 0? | SELECT COUNT(wins) FROM table_name_90 WHERE club = "cobden" AND draws > 0 | sql_create_context |
CREATE TABLE table_name_59 (
visiting_team VARCHAR,
date VARCHAR
) | Who was the visiting team on October 15, 2006? | SELECT visiting_team FROM table_name_59 WHERE date = "october 15, 2006" | sql_create_context |
CREATE TABLE table_3804 (
"Stage" real,
"Winner" text,
"General classification" text,
"Mountains Classification" text,
"Points classification" text,
"Sprints Classification" text,
"Team Classification" text
) | If the winner is Rui Costa, who made the mountains classification? | SELECT "Mountains Classification" FROM table_3804 WHERE "Winner" = 'Rui Costa' | wikisql |
CREATE TABLE table_32585 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What is the sum of all rounds where a Tennessee State player with an overall rank less than 261 was drafted? | SELECT COUNT("Round") FROM table_32585 WHERE "School/Club Team" = 'tennessee state' AND "Overall" < '261' | wikisql |
CREATE TABLE table_23075 (
"Region" text,
"Wing" text,
"Inspection" real,
"Standard" real,
"Indoor" real,
"Outdoor" real,
"Written" real,
"Panel Quiz" real,
"Mile Run" real,
"Points" real,
"Overall" text
) | What is the indoor number for the NER region? | SELECT COUNT("Indoor") FROM table_23075 WHERE "Region" = 'NER' | wikisql |
CREATE TABLE table_name_48 (
score VARCHAR,
visitor VARCHAR
) | What's the score in the home game against the Charlotte Bobcats? | SELECT score FROM table_name_48 WHERE visitor = "charlotte bobcats" | sql_create_context |
CREATE TABLE table_63255 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
) | What date was the score 'score'? | SELECT "Date" FROM table_63255 WHERE "Score" = 'score' | wikisql |
CREATE TABLE table_34212 (
"Rank" text,
"Country" text,
"2009" text,
"2010" text,
"2011" text
) | What country was rank 4? | SELECT "Country" FROM table_34212 WHERE "Rank" = '4' | wikisql |
CREATE TABLE table_train_220 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"fasting_plasma_glucose" int,
"hba1c" float,
"serum_creatinine" float,
"body_mass_index_bmi" float,
"NOUSE" float
) | fasting plasma glucose > 270 mg / dl | SELECT * FROM table_train_220 WHERE fasting_plasma_glucose > 270 | criteria2sql |
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, return a bar chart about the distribution of name and price , and group by attribute name, and list in asc by the bars. | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 患者凤英发哪些检验报告的结果指标全部正常?看看这些检验报告的单号 | SELECT zyjybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_info.XM = '凤英发' ... | css |
CREATE TABLE table_name_77 (
matches VARCHAR,
_percentage_won VARCHAR
) | Which Match has the percentage won 52.38? | SELECT matches FROM table_name_77 WHERE _percentage_won = "52.38" | sql_create_context |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airp... | list all round trip flights between INDIANAPOLIS and ORLANDO on the 27 of 12 | 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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((DATE_DAY_0.day_number = 27 AND DATE_DAY_0.month_... | atis |
CREATE TABLE table_13347 (
"Class to 1928" text,
"Class from 1928" text,
"Seats" text,
"Quantity" real,
"Year(s) of Manufacture" text
) | What Class to 1928 has the Quantity smaller than 440 and Seats of 29/29? | SELECT "Class to 1928" FROM table_13347 WHERE "Quantity" < '440' AND "Seats" = '29/29' | wikisql |
CREATE TABLE table_name_42 (
fleet_number_s_ VARCHAR,
quantity_made VARCHAR
) | What fleet number had 3 made? | SELECT fleet_number_s_ FROM table_name_42 WHERE quantity_made = "3" | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | Plot total number of salary by grouped by hire date as a bar graph, could you display in ascending by the Y-axis? | SELECT HIRE_DATE, SUM(SALARY) FROM employees ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_43965 (
"Bank type" text,
"Number of branches" real,
"On-site ATMs" real,
"Off-site ATMs" real,
"Total ATMs" real
) | With foreign banks as the bank type, and on-site ATMS less than 218, what is the average off-site ATMs? | SELECT AVG("Off-site ATMs") FROM table_43965 WHERE "Bank type" = 'foreign banks' AND "On-site ATMs" < '218' | wikisql |
CREATE TABLE table_76647 (
"Target/Approach" text,
"Candidate Name" text,
"Trial Phase" text,
"Trial Start Date" text,
"Expected End Date" text
) | What is Trial Start Date, when Candidate Name is PBT2? | SELECT "Trial Start Date" FROM table_76647 WHERE "Candidate Name" = 'pbt2' | wikisql |
CREATE TABLE Research_Outcomes (
outcome_code VARCHAR(10),
outcome_description VARCHAR(255)
)
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)
CREATE TABLE Tasks (
task_id INTEGER,
project_id INTEGER,
task_details VARCHAR(255),
... | What details are there on the research staff? List the result in ascending alphabetical order, and count them by a bar chart | SELECT staff_details, COUNT(staff_details) FROM Research_Staff GROUP BY staff_details ORDER BY staff_details | nvbench |
CREATE TABLE table_29465 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | How many outgoing managers were replaced by Bob Peeters? | SELECT COUNT("Outgoing manager") FROM table_29465 WHERE "Replaced by" = 'Bob Peeters' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 复方甲氧那明胶囊是按哪个收费项目等级收费的,在编号10358065528的医疗就诊中 | SELECT CHA_ITEM_LEV FROM t_kc22 WHERE MED_CLINIC_ID = '10358065528' AND SOC_SRT_DIRE_NM = '复方甲氧那明胶囊' | css |
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(2... | What is the sum of credit value of courses with more than one prerequisite for each department? Return a bar chart, and sort by the y axis in desc please. | SELECT dept_name, SUM(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY dept_name ORDER BY SUM(credits) DESC | nvbench |
CREATE TABLE table_name_64 (
player VARCHAR,
pl_gp INTEGER
) | What player has a number of playoff games played greater than 0? | SELECT player FROM table_name_64 WHERE pl_gp > 0 | sql_create_context |
CREATE TABLE table_204_788 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | who is the last constructor ? | SELECT "constructor" FROM table_204_788 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_2101431_1 (
episode VARCHAR,
viewers__in_millions_ VARCHAR
) | Which episode was watched by 7.2 million viewers? | SELECT episode FROM table_2101431_1 WHERE viewers__in_millions_ = "7.2" | sql_create_context |
CREATE TABLE table_name_31 (
races INTEGER,
points INTEGER
) | What is the least number of Races for a Racer with less than 0 Points? | SELECT MIN(races) FROM table_name_31 WHERE points < 0 | sql_create_context |
CREATE TABLE table_46788 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is Fonsi Nieto's average grid when he's riding a Suzuki GSX-R1000? | SELECT AVG("Grid") FROM table_46788 WHERE "Bike" = 'suzuki gsx-r1000' AND "Rider" = 'fonsi nieto' | wikisql |
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,
... | 患者秦承平的门诊诊断之前是什么样的? | SELECT zzmzjzjlb.JZZDBM, zzmzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '秦承平' UNION SELECT fzzmzjzjlb.JZZDBM, fzzmzjzjlb.JZZDSM FROM person_info JO... | css |
CREATE TABLE table_name_52 (
attendance VARCHAR,
record VARCHAR
) | What is the attendance number for the record of 17-22? | SELECT attendance FROM table_name_52 WHERE record = "17-22" | sql_create_context |
CREATE TABLE table_76079 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average Bronze for rank 3 and total is more than 8? | SELECT AVG("Bronze") FROM table_76079 WHERE "Rank" = '3' AND "Total" > '8' | wikisql |
CREATE TABLE table_name_94 (
country VARCHAR,
iata VARCHAR
) | What is the Country when the IATA was osl? | SELECT country FROM table_name_94 WHERE iata = "osl" | sql_create_context |
CREATE TABLE table_41642 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | What is the Away captain when the Result was draw, and a Venue of lord's? | SELECT "Away captain" FROM table_41642 WHERE "Result" = 'draw' AND "Venue" = 'lord''s' | wikisql |
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 medication (
medi... | has patient 003-48563 received a vasopressors - phenylephrine (neosynephrine) procedure in other hospitals this year? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '003-48563' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '003-48563' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
CREATE TABLE table_name_93 (
discipline VARCHAR,
session VARCHAR
) | What type of motorsport has a session of pre-race test? | SELECT discipline FROM table_name_93 WHERE session = "pre-race test" | sql_create_context |
CREATE TABLE table_42322 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
) | What is the partially deleted result for Bunker Hill Mining & Metallurgical? | SELECT "Partially deleted" FROM table_42322 WHERE "Name" = 'bunker hill mining & metallurgical' | wikisql |
CREATE TABLE table_name_52 (
record VARCHAR,
score VARCHAR
) | What was the record during the game with a score of 78-59? | SELECT record FROM table_name_52 WHERE score = "78-59" | sql_create_context |
CREATE TABLE table_name_68 (
bronze VARCHAR,
total VARCHAR,
rank VARCHAR
) | What is the total of bronze medals from nations with more than 16 total medals and ranks larger than 3? | SELECT COUNT(bronze) FROM table_name_68 WHERE total = 16 AND rank > 3 | sql_create_context |
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
)
... | what is the average age of patients whose admission type is elective and who have stayed in the hospital for 20 days? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.days_stay = "20" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | how much does patient 010-20205 have a change in his or her anion gap last measured on the first hospital visit compared to the value second to last measured on the first hospital visit? | SELECT (SELECT 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 = '010-20205' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE table_name_38 (
erp_w INTEGER,
frequency_mhz VARCHAR
) | What is the highest erp w with a 90.5 frequency mhz? | SELECT MAX(erp_w) FROM table_name_38 WHERE frequency_mhz = 90.5 | sql_create_context |
CREATE TABLE qtb (
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... | 以前这位患者82162201有什么疾病? | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '82162201' UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '82162201' UNION SELECT zyb.IN_DIAG_DIS_CD, zyb.IN_DIAG_DIS_NM FROM zyb WHERE zyb.PERSON_ID = '82162201' UNION SELECT mzb.IN_DIAG_DIS_CD, mzb.IN_DIAG... | css |
CREATE TABLE table_name_88 (
others_number VARCHAR,
kerry_percentage VARCHAR
) | When Kerry is at 36.7%, what is the total number of others? | SELECT COUNT(others_number) FROM table_name_88 WHERE kerry_percentage = "36.7%" | sql_create_context |
CREATE TABLE table_53273 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
) | Name the venue when the away team was richmond | SELECT "Venue" FROM table_53273 WHERE "Away team" = 'richmond' | wikisql |
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Student... | Show me about the distribution of password and author_id in a bar chart. | SELECT password, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_24446718_7 (
awardee_s_ VARCHAR,
name_of_award VARCHAR
) | Name the awardee for best editing | SELECT awardee_s_ FROM table_24446718_7 WHERE name_of_award = "Best Editing" | sql_create_context |
CREATE TABLE table_15464 (
"Ride Name" text,
"Type" text,
"Opened in" real,
"Themed Land" text,
"Manufacture" text
) | What is the latest year a ride opened that was manufactured by Zamperla, was a convoy ride, and had a name of Tiny Truckers? | SELECT MAX("Opened in") FROM table_15464 WHERE "Manufacture" = 'zamperla' AND "Type" = 'convoy ride' AND "Ride Name" = 'tiny truckers' | wikisql |
CREATE TABLE table_name_91 (
earnings___ INTEGER,
events VARCHAR,
rank VARCHAR
) | Events of 22, and a Rank smaller than 4 involved which of the lowest earnings ($)? | SELECT MIN(earnings___) AS $__ FROM table_name_91 WHERE events = 22 AND rank < 4 | sql_create_context |
CREATE TABLE table_62076 (
"Dam constructed" text,
"Year completed" real,
"Impounded body of water" text,
"Reservoir capacity" text,
"Dam wall height" text,
"Dam type" text
) | Which Year completed has a Dam type of earthfill embankment, and a Dam constructed of khancoban dam? | SELECT MAX("Year completed") FROM table_62076 WHERE "Dam type" = 'earthfill embankment' AND "Dam constructed" = 'khancoban dam' | wikisql |
CREATE TABLE table_name_82 (
region VARCHAR,
village VARCHAR
) | Which Reigon has a Village of Chassagne-Montrachet? | SELECT region FROM table_name_82 WHERE village = "chassagne-montrachet" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Return a bar chart about the distribution of All_Home and the sum of School_ID , and group by attribute All_Home, and display by the y axis in descending. | SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(School_ID) DESC | nvbench |
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... | 自2000年3月8日起,到2019年1月15日,医院2640814涉及医疗费总额不多于3787.33元的科室有多少 | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2640814' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-03-08' AND '2019-01-15' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 3787.33) AS T | css |
CREATE TABLE table_name_20 (
record VARCHAR,
event VARCHAR
) | What is his record at ufc 67? | SELECT record FROM table_name_20 WHERE event = "ufc 67" | sql_create_context |
CREATE TABLE table_72394 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the party for tim lee hall | SELECT "Party" FROM table_72394 WHERE "Incumbent" = 'Tim Lee Hall' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Show me about the distribution of Team_Name and ACC_Percent in a bar chart, list X in asc order please. | SELECT Team_Name, ACC_Percent FROM basketball_match ORDER BY Team_Name | nvbench |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 列出医疗记录中对于10674984患者医疗费总额不少于3779.26元的出院诊断疾病编码和名称分别是什么? | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '10674984' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 3779.26) | css |
CREATE TABLE ftxmzjzjlb (
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,
MZZYZD... | 病人69954049的身高与体重分别达到多少? | SELECT txmzjzjlb.SG, txmzjzjlb.TZ FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '69954049' UNION SELECT ftxmzjzjlb.SG, ftxmzjzjlb.TZ FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AND hz_info.KH = f... | css |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | K71.024病人在医院9062886出院时的医疗记录中最低和最高医疗费一共是多少钱? | SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '9062886' AND OUT_DIAG_DIS_CD = 'K71.024') | css |
CREATE TABLE table_51529 (
"Feb 2010" text,
"Mar 2010" text,
"May 2010" real,
"Jun 2010" real,
"Jul 2010" real,
"Aug 2010" real,
"Sep 2010" real,
"Oct 2010" real,
"Nov 2010" real,
"Dec 2010" real,
"Jan 2011" real,
"Feb 2011" real,
"Mar 2011" real,
"Apr 2011" real,... | What is the average Apr 2013 with a Jun 2011 less than 14? | SELECT AVG("Apr 2013") FROM table_51529 WHERE "Jun 2011" < '14' | wikisql |
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_DIRE_CD text,
MED_DIRE_NM text,... | 列出医院4553560中根据出院诊断疾病编码,不同疾病的平均患者年龄是多大? | SELECT t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4553560' GROUP BY t_kc21.OUT_DIAG_DIS_CD | css |
CREATE TABLE table_name_99 (
place VARCHAR,
name VARCHAR
) | What play did henry s. uber / betty uber (eng) finish in? | SELECT COUNT(place) FROM table_name_99 WHERE name = "henry s. uber / betty uber (eng)" | sql_create_context |
CREATE TABLE table_4611 (
"Team" text,
"Chassis" text,
"Engine" text,
"Tires" text,
"Drivers" text
) | What engine does Chip Mead of Parts Washer Service use? | SELECT "Engine" FROM table_4611 WHERE "Team" = 'parts washer service' AND "Drivers" = 'chip mead' | wikisql |
CREATE TABLE table_203_593 (
id number,
"tenure" text,
"coach" text,
"years" number,
"record" text,
"pct." number,
"ncaa tournament" number
) | what was the difference in win percentage between john pawlowski and porter grant ? | SELECT (SELECT "pct." FROM table_203_593 WHERE "coach" = 'john pawlowski') - (SELECT "pct." FROM table_203_593 WHERE "coach" = 'porter grant') | squall |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | what is minimum age for different job title?, order x-axis in ascending order please. | SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job | nvbench |
CREATE TABLE table_44746 (
"Date" text,
"Series" text,
"Circuit" text,
"City / State" text,
"Winner" text,
"Team" text
) | What is Winner, when Date is 5 Sep? | SELECT "Winner" FROM table_44746 WHERE "Date" = '5 sep' | wikisql |
CREATE TABLE table_74625 (
"Total tenure rank" real,
"Uninterrupted rank" real,
"Name" text,
"Total tenure time" text,
"Uninterrupted time" text
) | How many uninterrupted ranks does john dingell have? | SELECT COUNT("Uninterrupted rank") FROM table_74625 WHERE "Name" = 'john dingell' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.