context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_33258 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the home teams score agains the team that scored 7.15 (57)? | SELECT "Home team score" FROM table_33258 WHERE "Away team score" = '7.15 (57)' | 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... | 在2009年06月17日到2018年12月02日期间,医疗机构7756841一共有多少医疗费 | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '7756841' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-06-17' AND '2018-12-02' | css |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId... | find all posts from a user. | SELECT p.Id AS "post_link" FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE u.Id = @UserId | sede |
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,
... | provide the number of patients whose marital status is widowed and diagnoses long title is chronic kidney disease, stage iv (severe)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "WIDOWED" AND diagnoses.long_title = "Chronic kidney disease, Stage IV (severe)" | mimicsql_data |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | 在医院2125522就诊的所有患者的医疗就诊记录中按照科室编码和入院诊断疾病名称的不同得出的患者平均年龄是什么? | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2125522' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM | css |
CREATE TABLE table_name_31 (
score VARCHAR,
opponent VARCHAR,
decision VARCHAR,
november VARCHAR
) | What is the Score of the game with a decision of Lundqvist, the November less than 28, and opponent was Boston Bruins? | SELECT score FROM table_name_31 WHERE decision = "lundqvist" AND november < 28 AND opponent = "boston bruins" | sql_create_context |
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 ... | how many hours have passed since the first time that patient 97330 stayed during their current hospital encounter in the careunit sicu? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97330 AND admissions.dischtime IS NULL) AND transfers.careunit = 'sicu' ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE restrict... | what flights go from PHILADELPHIA to SAN FRANCISCO via DALLAS | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... | atis |
CREATE TABLE table_1131183_2 (
number_of_jews__asarb_ VARCHAR,
metro_area VARCHAR
) | What is the number of jews asarb where the metro area is philadelphia? | SELECT number_of_jews__asarb_ FROM table_1131183_2 WHERE metro_area = "Philadelphia" | sql_create_context |
CREATE TABLE table_51190 (
"Player" text,
"Position" text,
"First-Team Appearances" text,
"First-Team Goals" text,
"Current Club" text
) | What is the name of the club that has ongoing first-team appearances, a midfielder, and whose player is Samir Carruthers? | SELECT "Current Club" FROM table_51190 WHERE "First-Team Appearances" = 'ongoing' AND "Position" = 'midfielder' AND "Player" = 'samir carruthers' | wikisql |
CREATE TABLE table_name_94 (
money___$__ VARCHAR,
place VARCHAR,
country VARCHAR
) | What was the money for place t3 and United States? | SELECT money___$__ FROM table_name_94 WHERE place = "t3" AND country = "united states" | sql_create_context |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
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 re... | For the attribute Sex and the amount of Sex, show their proportion by a pie chart. | SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_24732149_2 (
date VARCHAR,
fastest_lap VARCHAR
) | What date did Mike Rockenfeller have the fastest lap? | SELECT date FROM table_24732149_2 WHERE fastest_lap = "Mike Rockenfeller" | sql_create_context |
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
)
... | how many patients whose gender is f and item id is 51345? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.itemid = "51345" | mimicsql_data |
CREATE TABLE table_61992 (
"Source" text,
"Date" text,
"Kaine (D)" text,
"Kilgore (R)" text,
"Potts (I)" text
) | What was Kilgore's percentage when Potts (I) had 4% and Kaine (D) 47%, in the poll from October 30, 2005? | SELECT "Kilgore (R)" FROM table_61992 WHERE "Potts (I)" = '4%' AND "Kaine (D)" = '47%' AND "Date" = 'october 30, 2005' | wikisql |
CREATE TABLE table_name_24 (
away_team VARCHAR,
venue VARCHAR
) | What did the away team score at Moorabbin Oval? | SELECT away_team AS score FROM table_name_24 WHERE venue = "moorabbin oval" | sql_create_context |
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
)
... | what is the dicharge time and diagnosis icd9 code of the patient id 93033? | SELECT demographic.dischtime, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "93033" | mimicsql_data |
CREATE TABLE table_42347 (
"Date" text,
"Result" text,
"Score" text,
"Brazil scorers" text,
"Competition" text
) | Which competition had a 4-3 score? | SELECT "Competition" FROM table_42347 WHERE "Score" = '4-3' | wikisql |
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... | Test query - get user count. | SELECT COUNT(*) FROM Users WHERE Location LIKE '%korea%' | sede |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
per... | Find the dates of the tests taken with result 'Pass', and count them by a bar chart, and rank names in descending order. | SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" GROUP BY date_test_taken ORDER BY date_test_taken DESC | nvbench |
CREATE TABLE table_203_455 (
id number,
"round" number,
"#" number,
"player" text,
"nationality" text,
"college/junior/club team (league)" text
) | patrick murphy and who else was drafted in round seven ? | SELECT "player" FROM table_203_455 WHERE "player" <> 'patrick murphy' AND "round" = 7 | squall |
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 ... | find the number of patients admitted in the emergency room under procedure icd9 code 9229. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.icd9_code = "9229" | mimicsql_data |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
Accepted... | Tags existing as both tags and as synonyms. | SELECT TagName AS Tag FROM Tags INTERSECT SELECT SourceTagName AS Tag FROM TagSynonyms | sede |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayNa... | Limiting Posts by Date and Rep, Parameterized, with Links (Tutorial). | SELECT p.Id AS "post_link", u.Id AS "user_link", u.Reputation FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.CreationDate BETWEEN '##StartDate:string##' AND '##EndDate:string##' AND p.PostTypeId = 1 AND u.Reputation < '##MaxReputation:int##' | sede |
CREATE TABLE table_10426 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When the away team scored 18.13 (121), what was the largest crowd size? | SELECT MAX("Crowd") FROM table_10426 WHERE "Away team score" = '18.13 (121)' | wikisql |
CREATE TABLE table_67816 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | Which course has km (mi) as a type? | SELECT "Course" FROM table_67816 WHERE "Type" = 'km (mi)' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | get me the name of the drug and the drug code that patient with patient id 11221 is taking. | SELECT prescriptions.drug, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.subject_id = "11221" | mimicsql_data |
CREATE TABLE table_35984 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | When the surface is clay, and the tournament of barcelona what is the score? | SELECT "Score" FROM table_35984 WHERE "Surface" = 'clay' AND "Tournament" = 'barcelona' | 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... | 在哪几次医疗记录中患者21485426被开出的均低于7162.91元的药品?列出医疗就诊编号是什么? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '21485426' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 7162.91) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '21485426' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_... | css |
CREATE TABLE table_46167 (
"Rank" text,
"July 1, 2013 projection" real,
"% of pop." real,
"Average relative annual growth (%)" real,
"Average absolute annual growth" real
) | What is the Average relative annual growth (%) for the country that ranks 41 and has a July 1, 2013 projection larger than 2,204,000? | SELECT COUNT("Average relative annual growth (%)") FROM table_46167 WHERE "Rank" = '41' AND "July 1, 2013 projection" > '2,204,000' | wikisql |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIG... | Return a bar chart on what is the number of professors for different school?, and could you list by the bar from low to high? | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY SCHOOL_CODE | nvbench |
CREATE TABLE table_10638 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What date was Richmond the home team? | SELECT "Date" FROM table_10638 WHERE "Home team" = 'richmond' | wikisql |
CREATE TABLE table_name_10 (
to_par VARCHAR,
score VARCHAR
) | Which To par is scored at 70? | SELECT to_par FROM table_name_10 WHERE score = 70 | 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... | calculat the number of patients diagnosed with icd9 code 03849 who were unmarried. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.icd9_code = "03849" | mimicsql_data |
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
) | How many climbers are from each country? | SELECT country, COUNT(*) FROM climber GROUP BY country | spider |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 团伙成员70821376号的常开药品的顺序是啥样的? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '70821376' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_27511 (
"Song" text,
"Singer" text,
"Co-Singers" text,
"Music Director" text,
"Lyricist" text,
"Co-Stars" text,
"Movie/Album" text,
"Year" real,
"Additional Info" text
) | Who was the lyricist for the song with music directed by madan mohan kohli? | SELECT "Lyricist" FROM table_27511 WHERE "Music Director" = 'Madan Mohan Kohli' | wikisql |
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CR... | i need a flight from TAMPA to MONTREAL | 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 = 'TAMPA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MONTREAL... | atis |
CREATE TABLE table_51655 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text
) | Which county is named broderick wood products? | SELECT "County" FROM table_51655 WHERE "Name" = 'broderick wood products' | wikisql |
CREATE TABLE table_55390 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the visitor team of the game with Chicago as the home team? | SELECT "Visitor" FROM table_55390 WHERE "Home" = 'chicago' | wikisql |
CREATE TABLE table_37780 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the team's record in games against the Hartford Whalers? | SELECT "Record" FROM table_37780 WHERE "Opponent" = 'hartford whalers' | wikisql |
CREATE TABLE table_203_724 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the only country ranked in the top ten that did not earn a silver medal ? | SELECT "nation" FROM table_203_724 WHERE "rank" <= 10 AND "silver" = 0 | squall |
CREATE TABLE table_18933037_3 (
b_52_model VARCHAR,
unit VARCHAR
) | When 7th bw attached to 43rd sw is the unit what is the b-52 model? | SELECT b_52_model FROM table_18933037_3 WHERE unit = "7th BW attached to 43rd SW" | sql_create_context |
CREATE TABLE table_name_96 (
english_title VARCHAR,
romanization VARCHAR
) | What English title for the Romanization of lee jae-su-eui nan? | SELECT english_title FROM table_name_96 WHERE romanization = "lee jae-su-eui nan" | sql_create_context |
CREATE TABLE table_name_38 (
tournament VARCHAR,
margin_of_victory VARCHAR
) | Which Tournament has a Margin of victory of 7 strokes | SELECT tournament FROM table_name_38 WHERE margin_of_victory = "7 strokes" | sql_create_context |
CREATE TABLE table_204_800 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many silver medals did venezuela win ? | SELECT "silver" FROM table_204_800 WHERE "nation" = 'venezuela' | squall |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,... | 在患者81881911的诊疗记录里,从00年9月13日到12年2月14日这期间,为其检测转铁蛋白的医务人员有哪几位,报一下工号及姓名 | (SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb... | css |
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, a bar chart shows the distribution of hire_date and the average of employee_id bin hire_date by time. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
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 Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid... | Plot mean age by grouped by sex as a bar graph | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex | nvbench |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
g... | Name the requirements for CS-LSA degree . | SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id | advising |
CREATE TABLE table_61035 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" real
) | Which Country has a Money ($) of 0, and a Place of t10? | SELECT "Country" FROM table_61035 WHERE "Money ( $ )" = '0' AND "Place" = 't10' | wikisql |
CREATE TABLE table_16010 (
"Nomination" text,
"Actors Name" text,
"Film Name" text,
"Director" text,
"Country" text
) | What was the actors name that vadim ilyenko directed? | SELECT "Actors Name" FROM table_16010 WHERE "Director" = 'Vadim Ilyenko' | wikisql |
CREATE TABLE table_test_11 (
"id" int,
"left_ventricular_ejection_fraction_lvef" int,
"systolic_blood_pressure_sbp" int,
"tachycardia" int,
"bradycardia" int,
"renal_disease" bool,
"allergy_to_aspirin" bool,
"temperature" float,
"creatinine_clearance_cl" float,
"diastolic_blood_p... | tympanic temperature < 35 c prior to enrolment | SELECT * FROM table_test_11 WHERE temperature < 35 | criteria2sql |
CREATE TABLE table_203_716 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many gold medals did puerto rico earn ? | SELECT "gold" FROM table_203_716 WHERE "nation" = 'puerto rico' | squall |
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 All_Games and ACC_Percent in a bar chart, and list from low to high by the total number please. | SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY ACC_Percent | nvbench |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS va... | For those employees who did not have any job in the past, give me the trend about employee_id over hire_date , display by the x axis from high to low. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_33540 (
"Rank" real,
"Name" text,
"Population ( 2011 Census )" real,
"Percent of national population" text,
"% growth (2006\u201311)" text,
"Land area (km\u00b2)" real,
"Population density (/km 2 )" real,
"House of Commons seats" real,
"House of Commons seats (%)" ... | What was the July 2013 population estimate of the location which had a population density larger than 14.1? | SELECT COUNT("2013 population (July est.)") FROM table_33540 WHERE "Population density (/km 2 )" > '14.1' | wikisql |
CREATE TABLE table_203_444 (
id number,
"week" number,
"start date" text,
"type" text,
"tournament" text,
"surface" text,
"town" text,
"country" text,
"continent" text,
"prize money" text
) | which tournament is the last one of the year ? | SELECT "tournament" FROM table_203_444 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_21898 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | What is the record for November 26, 1961? | SELECT "Record" FROM table_21898 WHERE "Date" = 'November 26, 1961' | wikisql |
CREATE TABLE table_name_30 (
nationality VARCHAR,
college_junior_club_team VARCHAR,
player VARCHAR
) | What is the Nationality for the university of wisconsin (wcha), and a Player of bob lundeen? | SELECT nationality FROM table_name_30 WHERE college_junior_club_team = "university of wisconsin (wcha)" AND player = "bob lundeen" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
ro... | how many patients were staying in 50 wards in 2105? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 50 AND STRFTIME('%y', transfers.intime) = '2105') | mimic_iii |
CREATE TABLE table_name_49 (
opponent VARCHAR,
attendance VARCHAR
) | Who was the opponent when 48,121 people attended? | SELECT opponent FROM table_name_49 WHERE attendance = "48,121" | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational... | Before noon , what all upper level electives are being offered ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.end_time <= '12:00:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semest... | advising |
CREATE TABLE table_name_92 (
home_team VARCHAR
) | What is the team of Essendon's score in the game where they were the home team? | SELECT home_team AS score FROM table_name_92 WHERE home_team = "essendon" | sql_create_context |
CREATE TABLE table_name_34 (
gold INTEGER,
bronze VARCHAR,
silver VARCHAR,
nation VARCHAR
) | What is the lowest gold that has a silver less than 2, Zimbabwe as the nation, and a bronze less than 1? | SELECT MIN(gold) FROM table_name_34 WHERE silver < 2 AND nation = "zimbabwe" AND bronze < 1 | sql_create_context |
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... | provide the number of patients who had other body fluid lab test and were hospitalized for more than 2 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_63226 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the highest bronze for less than 2 total trophies? | SELECT MAX("Bronze") FROM table_63226 WHERE "Total" < '2' | wikisql |
CREATE TABLE table_203_461 (
id number,
"dvd title" text,
"discs" number,
"year" text,
"no. of ep." number,
"dvd release\nregion 2" text,
"dvd release\nregion 4" text
) | what is previous to complete series 10 ? | SELECT "dvd title" FROM table_203_461 WHERE id = (SELECT id FROM table_203_461 WHERE "dvd title" = 'complete series 10') - 1 | squall |
CREATE TABLE table_16390001_2 (
average VARCHAR,
country VARCHAR
) | What are the average scores of contestants whose home state is Pennsylvania? | SELECT average FROM table_16390001_2 WHERE country = "Pennsylvania" | sql_create_context |
CREATE TABLE table_name_74 (
frame_size VARCHAR,
height VARCHAR,
max_fps VARCHAR,
width VARCHAR
) | What frame size corresponds the selection with a max fps of 120, a width of 2048, and height of 1024? | SELECT frame_size FROM table_name_74 WHERE max_fps = 120 AND width = 2048 AND height = 1024 | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | Questions where answer was accepted before a bounty was started. | SELECT p.Id AS "post_link", p.AcceptedAnswerId, bs.CreationDate, ac.CreationDate, p.CreationDate, url = 'site://posts/' + CAST(p.Id AS TEXT) + '/revisions', url = 'site://posts/' + CAST(p.Id AS TEXT) + '/timeline' FROM Posts AS p INNER JOIN Votes AS bs ON (p.Id = bs.PostId AND bs.VoteTypeId = 8) LEFT JOIN Votes AS ac O... | sede |
CREATE TABLE table_5560 (
"Election" text,
"Date" text,
"Mayor" text,
"Ward seats" text,
"Votes" text
) | How many votes were there on November 10? | SELECT "Votes" FROM table_5560 WHERE "Date" = 'november 10' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | when patient 002-20631 came to the hospital for the first time via the operating room? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '002-20631' AND patient.hospitaladmitsource = 'operating room' ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_71580 (
"Elector" text,
"Order" text,
"Title" text,
"Elevated" text,
"Elevator" text
) | What is listed as the Elector with the Title of Deacon of S. Maria in Domnica? | SELECT "Elector" FROM table_71580 WHERE "Title" = 'deacon of s. maria in domnica' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH te... | 那个叫俞慧艳的人其检验报告单上面的检验结果指标全部不正常的单号都有什么? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '俞慧艳' AND NOT ... | css |
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,
... | 05037621患者的颈部的各项指标检验结果的数据是什么样子的? | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ... | css |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 13253905900这次门诊就诊的中医诊断结果如何?列出编号和名称 | SELECT mzjzjlb.MZZYZDZZBM, mzjzjlb.MZZYZDZZMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '13253905900' | css |
CREATE TABLE table_30556 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Which team drafted Joakim Persson? | SELECT "NHL team" FROM table_30556 WHERE "Player" = 'Joakim Persson' | wikisql |
CREATE TABLE table_30662 (
"Stage" text,
"Unit Number" real,
"Installed Capacity ( MW )" text,
"Date of Commissioning" text,
"Status" text,
"TG set Provider" text,
"Boiler Provider" text
) | What is the boiler provider for Bhel, India's TG Set provider? | SELECT "Boiler Provider" FROM table_30662 WHERE "TG set Provider" = 'BHEL, India' | wikisql |
CREATE TABLE table_56403 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | I wan the date of vacancy for departure of resigned and outgoing manager of gordon wylde | SELECT "Date of vacancy" FROM table_56403 WHERE "Manner of departure" = 'resigned' AND "Outgoing manager" = 'gordon wylde' | wikisql |
CREATE TABLE table_73875 (
"Branding" text,
"Callsign" text,
"Ch. #" text,
"Station Type" text,
"Power kW (ERP)" text,
"Location (Transmitter Site)" text
) | What is the branding of the callsign DWCI-TV? | SELECT "Branding" FROM table_73875 WHERE "Callsign" = 'DWCI-TV' | wikisql |
CREATE TABLE table_name_70 (
remixed_by VARCHAR,
version VARCHAR
) | Who was the Radio Edit Version remixed by? | SELECT remixed_by FROM table_name_70 WHERE version = "radio edit" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | get all activity in past timeframe. | SELECT Posts.Id AS post_id, Posts.CreationDate FROM Posts | sede |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE gsi (
course_offeri... | List all upper-level class that are 1 credits . | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 1 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE table_name_14 (
assist_pass VARCHAR,
score VARCHAR,
competition VARCHAR
) | Which Assist/pass has a Score of 1-0,a Competition of 2010 concacaf world cup qualifying group stage? | SELECT assist_pass FROM table_name_14 WHERE score = "1-0" AND competition = "2010 concacaf world cup qualifying – group stage" | sql_create_context |
CREATE TABLE bdmzjzjlb (
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... | 68219114345这个门诊就诊的医生有哪些?首诊医生和其他接诊医生的工号是什么 | SELECT wdmzjzjlb.ZZYSGH, wdmzjzjlb.QTJZYSGH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '68219114345' UNION SELECT bdmzjzjlb.ZZYSGH, bdmzjzjlb.QTJZYSGH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '68219114345' | css |
CREATE TABLE table_78723 (
"Team" text,
"2004\u201305 Pts" text,
"2005\u201306 Pts" text,
"2006\u201307 Pts" real,
"Total Pts" real,
"Total Pld" real
) | What is the average total pld with 45 points in 2005-06, and more than 52 points in 2006-07? | SELECT AVG("Total Pld") FROM table_78723 WHERE "2005\u201306 Pts" = '45' AND "2006\u201307 Pts" > '52' | wikisql |
CREATE TABLE table_name_5 (
byes INTEGER,
draws VARCHAR,
against VARCHAR,
wins VARCHAR
) | What are the average byes that are greater than 1479, wins greater than 5 and 0 draws? | SELECT AVG(byes) FROM table_name_5 WHERE against > 1479 AND wins > 5 AND draws < 0 | sql_create_context |
CREATE TABLE table_45243 (
"Season" real,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
) | If the Season is later than 2008 and Races is 11, what ate the Points? | SELECT "Points" FROM table_45243 WHERE "Races" = '11' AND "Season" > '2008' | wikisql |
CREATE TABLE table_name_30 (
opponent VARCHAR,
round INTEGER
) | Who was the opponent when the round was more than 2? | SELECT opponent FROM table_name_30 WHERE round > 2 | sql_create_context |
CREATE TABLE table_25474 (
"Date" text,
"Location" text,
"Opponent" text,
"Irish Points" real,
"Opp. Points" real,
"Record" text
) | Name the number of location for 22-1 | SELECT COUNT("Location") FROM table_25474 WHERE "Record" = '22-1' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | For all employees who have the letters D or S in their first name, visualize a scatter chart about the correlation between salary and department_id . | SELECT SALARY, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_26482 (
"World record" text,
"Olimpiada Ivanova ( RUS )" text,
"1:25:41" text,
"Helsinki , Finland" text,
"7 August 2005" text
) | Name the 1:25 for 7 august 2005 being 19 november 2001 | SELECT "1:25:41" FROM table_26482 WHERE "7 August 2005" = '19 November 2001' | wikisql |
CREATE TABLE table_25930 (
"No." real,
"#" real,
"Original airdate" text,
"Performer 1" text,
"Performer 2" text,
"Performer 3" text,
"Performer 4" text,
"U.S. viewers (millions)" text
) | How many millions of people in the US saw the episode number 226? | SELECT "U.S. viewers (millions)" FROM table_25930 WHERE "No." = '226' | wikisql |
CREATE TABLE table_name_28 (
prothrombin_time VARCHAR,
partial_thromboplastin_time VARCHAR,
platelet_count VARCHAR,
bleeding_time VARCHAR
) | Which Prothrombin time has a Platelet count of unaffected, and a Bleeding time of unaffected, and a Partial thromboplastin time of normal or mildly prolonged? | SELECT prothrombin_time FROM table_name_28 WHERE platelet_count = "unaffected" AND bleeding_time = "unaffected" AND partial_thromboplastin_time = "normal or mildly prolonged" | 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 average age of patients whose death status is 0 and admission year is greater than or equal to 2121? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admityear >= "2121" | mimicsql_data |
CREATE TABLE table_name_56 (
gold VARCHAR,
rank VARCHAR,
total VARCHAR
) | How many gold are a rank 1 and larger than 16? | SELECT COUNT(gold) FROM table_name_56 WHERE rank = "1" AND total > 16 | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | what are the methods of consumption of carvedilol 3.125 mg tab? | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'carvedilol 3.125 mg tab' | eicu |
CREATE TABLE table_6359 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | How many of lost have 11 as the points, and a drawn greater than 1? | SELECT COUNT("Lost") FROM table_6359 WHERE "Points" = '11' AND "Drawn" > '1' | wikisql |
CREATE TABLE table_7573 (
"Date (CE)" text,
"Text" text,
"Simplified characters" text,
"Traditional characters" text,
"Pinyin" text,
"Wade-Giles" text,
"Literal meaning" text
) | Which text has simplified characters of ? | SELECT "Text" FROM table_7573 WHERE "Simplified characters" = '心猿 … 意马' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.