context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_203_216 (
id number,
"rank" number,
"hospital" text,
"city" text,
"county" text,
"# beds" number,
"type of hospital" text
) | which type of hospitals are the same as grossmont hospital ? | SELECT "type of hospital" FROM table_203_216 WHERE "hospital" = 'grossmont hospital' | squall |
CREATE TABLE table_56579 (
"Player" text,
"Position" text,
"Tries" real,
"Goals" real,
"Points" real
) | How many tries did the player Paul Sykes take when he earned 0 points? | SELECT MAX("Tries") FROM table_56579 WHERE "Player" = 'paul sykes' AND "Points" > '0' | wikisql |
CREATE TABLE table_66986 (
"Ship" text,
"Pennant number" text,
"Laid down" text,
"Launched" text,
"Completed" text
) | Name the laid down for launched being 16 february 1934 | SELECT "Laid down" FROM table_66986 WHERE "Launched" = '16 february 1934' | wikisql |
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(25... | Show me a bar chart for what is the project id and detail for the project with at least two documents?, and order by the y axis from high to low. | SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID ORDER BY T1.Project_ID DESC | nvbench |
CREATE TABLE table_name_94 (
place VARCHAR,
player VARCHAR
) | What was Tim Simpson's place? | SELECT place FROM table_name_94 WHERE player = "tim simpson" | sql_create_context |
CREATE TABLE table_12784134_1 (
verbal_noun VARCHAR,
basic_stem__root_ VARCHAR
) | What's the number of verbal nouns with the basic stem (root) -bil-? | SELECT COUNT(verbal_noun) FROM table_12784134_1 WHERE basic_stem__root_ = "-bil-" | sql_create_context |
CREATE TABLE loan (
cust_id VARCHAR
)
CREATE TABLE customer (
cust_name VARCHAR,
cust_id VARCHAR
) | Find the name of customers who have more than one loan. | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING COUNT(*) > 1 | sql_create_context |
CREATE TABLE table_28918 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | What was the result in the election in the Kentucky 1 district? | SELECT "Result" FROM table_28918 WHERE "District" = 'Kentucky 1' | wikisql |
CREATE TABLE table_50158 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What was the Score of the Spain F32, Gran Canaria Tournament? | SELECT "Score" FROM table_50158 WHERE "Tournament" = 'spain f32, gran canaria' | wikisql |
CREATE TABLE table_name_48 (
power VARCHAR,
callsign VARCHAR
) | What is the Power of the Frequency with a Callsign of DXLL? | SELECT power FROM table_name_48 WHERE callsign = "dxll" | 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
)
... | how many patients whose diagnoses short title is fetal/neonatal jaund nos and lab test abnormal status is abnormal? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Fetal/neonatal jaund NOS" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_47900 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | What was the date of vacancy after the outgoing manager, ralf santelli departed? | SELECT "Date of vacancy" FROM table_47900 WHERE "Outgoing manager" = 'ralf santelli' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDa... | Golden tag badges by owner reputation. | SELECT Users.Id AS "user_link", Users.Id AS UserId, Users.Reputation, Badges.Name AS "tag_link" FROM Badges, Users WHERE Badges.Class = '1' AND Badges.TagBased = '1' AND Badges.UserId = Users.Id ORDER BY Users.Reputation, Users.Id, Badges.Name, Badges.Id | sede |
CREATE TABLE table_36452 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Time" text,
"Att." real,
"Record" text
) | What is the Score on July 18 that has Record of 41-51? | SELECT "Score" FROM table_36452 WHERE "Date" = 'july 18' AND "Record" = '41-51' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
... | what's the three most frequent input event since 3 years ago? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 3) | mimic_iii |
CREATE TABLE table_74211 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What date was the game score w 104-98? | SELECT "Date" FROM table_74211 WHERE "Score" = 'W 104-98' | wikisql |
CREATE TABLE table_name_46 (
tournaments INTEGER,
highest_rank VARCHAR
) | What is the lowest Tournaments with Highest Rank of Maegashira 13? | SELECT MIN(tournaments) FROM table_name_46 WHERE highest_rank = "maegashira 13" | sql_create_context |
CREATE TABLE table_name_57 (
player VARCHAR,
pick VARCHAR
) | What was the name of the player for pick 402? | SELECT player FROM table_name_57 WHERE pick = 402 | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | during their current hospital visit what was the first id of the ward of patient 027-85328? | SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-85328' AND patient.hospitaldischargetime IS NULL) ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE playlist_tracks (
playlist_id number,
track_id number
)
CREATE TABLE sqlite_sequence (
name text,
seq text
)
CREATE TABLE customers (
id number,
first_name text,
last_name text,
company text,
address text,
city text,
state text,
country text,
postal_cod... | What are the different names of the genres? | SELECT DISTINCT name FROM genres | spider |
CREATE TABLE table_56423 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What was the date when the attendance was 48,041? | SELECT "Date" FROM table_56423 WHERE "Attendance" = '48,041' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLin... | London based Angular Bronze Badge. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Users.Id AS "user_link", Reputation, Location FROM Users, Badges WHERE Users.Id = Badges.UserId AND Badges.Class = 3 AND Badges.TagBased = 1 AND Badges.Name = 'angularjs' AND LOWER(Users.Location) LIKE LOWER('%London%') ORDER BY Reputation DESC | sede |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id ... | Is Prof. Robert Donia teaching 452 next Winter ? | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 452 AND instructor.name LIKE '%Robert Donia%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_in... | advising |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | For all employees who have the letters D or S in their first name, show me about the change of department_id over hire_date in a line chart, rank by the X-axis in asc. | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_43131 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Which pick number was there for Jason French? | SELECT "Pick #" FROM table_43131 WHERE "Player" = 'jason french' | wikisql |
CREATE TABLE table_46184 (
"Fin. Pos" text,
"Car No." text,
"Driver" text,
"Team" text,
"Laps" text,
"Time/Retired" text,
"Grid" text,
"Laps Led" text,
"Points" text
) | How many laps did car 23 do? | SELECT "Laps" FROM table_46184 WHERE "Car No." = '23' | wikisql |
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
)... | Show all calendar dates and bin by weekday in a bar chart, I want to rank y axis in desc order. | SELECT Calendar_Date, COUNT(Calendar_Date) FROM Ref_Calendar ORDER BY COUNT(Calendar_Date) DESC | nvbench |
CREATE TABLE table_name_86 (
language VARCHAR,
television_service VARCHAR
) | What is the Language when the Reteconomy is the television service? | SELECT language FROM table_name_86 WHERE television_service = "reteconomy" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 labevents (
ro... | how much weight was patient 12952's first weight on the first hospital visit? | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12952 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.ite... | mimic_iii |
CREATE TABLE table_name_92 (
lane INTEGER,
nationality VARCHAR,
rank VARCHAR
) | How many lanes have a Nationality of france, and a Rank larger than 8? | SELECT SUM(lane) FROM table_name_92 WHERE nationality = "france" AND rank > 8 | sql_create_context |
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | Specify the average age of unmarried patients admitted in or after the year 2156 | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admityear >= "2156" | mimicsql_data |
CREATE TABLE table_2079664_3 (
previous_br_no INTEGER
) | Name the most previous br number | SELECT MAX(previous_br_no) FROM table_2079664_3 | sql_create_context |
CREATE TABLE genres (
id number,
name text
)
CREATE TABLE playlists (
id number,
name text
)
CREATE TABLE employees (
id number,
last_name text,
first_name text,
title text,
reports_to number,
birth_date time,
hire_date time,
address text,
city text,
state text,... | List all different genre types. | SELECT DISTINCT name FROM genres | spider |
CREATE TABLE table_72680 (
"Player" text,
"G" real,
"Tackles" real,
"Solo" real,
"Assts" real,
"Sacks" text,
"Int" real,
"Int yards" real,
"Int avg." text,
"Int TD" real,
"Fum. rec" real,
"Fum. rec TD" real
) | Name the least int yards when sacks is 11.5 | SELECT MIN("Int yards") FROM table_72680 WHERE "Sacks" = '11.5' | wikisql |
CREATE TABLE table_18905 (
"Rnd" real,
"Circuit" text,
"GTO Winning Team" text,
"GTU Winning Team" text,
"TO Winning Team" text,
"TU Winning Team" text,
"Results" text
) | Who is Gene Felton's TO Winning Team? | SELECT "TO Winning Team" FROM table_18905 WHERE "GTO Winning Team" = 'Gene Felton' | wikisql |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | Draw a bar chart about the distribution of meter_200 and the average of meter_100 , and group by attribute meter_200, and show by the x-axis from low to high. | SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 | nvbench |
CREATE TABLE table_30156 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production" text,
"U.S. viewers (in millions)" text
) | What is the lowest numbered episode in the series? | SELECT MIN("No. in series") FROM table_30156 | wikisql |
CREATE TABLE table_71691 (
"Year" real,
"Class" text,
"Vehicle" text,
"Position" text,
"Stages won" text
) | What is the average year that has a car that won 0 stages with a position of DNF? | SELECT AVG("Year") FROM table_71691 WHERE "Class" = 'car' AND "Stages won" = '0' AND "Position" = 'dnf' | wikisql |
CREATE TABLE table_54867 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Who did the Cubs play when they had a record of 4-4? | SELECT "Opponent" FROM table_54867 WHERE "Record" = '4-4' | wikisql |
CREATE TABLE table_name_89 (
player VARCHAR,
to_par VARCHAR,
score VARCHAR
) | What player has a To Par of +1 with a score of 71-67-73=211? | SELECT player FROM table_name_89 WHERE to_par = "+1" AND score = 71 - 67 - 73 = 211 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | give me the number of patients whose age is less than 64 and diagnoses icd9 code is v6284? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "64" AND diagnoses.icd9_code = "V6284" | mimicsql_data |
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... | Give me the comparison about the average of School_ID over the ACC_Road , and group by attribute ACC_Road by a bar chart, order X-axis in descending order please. | SELECT ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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... | 病患郑自珍大腿的检测各项指标结果如何? | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJG... | css |
CREATE TABLE table_16483 (
"Trim" text,
"Engine" text,
"Turbo" text,
"Fuel Delivery" text,
"Power" text,
"Torque" text,
"Transmission" text,
"Performance" text
) | what's the torque where performance is 0 100km/h: 7.5s auto, vmax: km/h (mph) | SELECT "Torque" FROM table_16483 WHERE "Performance" = '0–100km/h: 7.5s auto, VMax: km/h (mph)' | wikisql |
CREATE TABLE table_21950 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" text,
"Location of the Church" text
) | On how many locations is there a church named Askrova Bedehuskapell, built in 1957? | SELECT COUNT("Location of the Church") FROM table_21950 WHERE "Year Built" = '1957' AND "Church Name" = 'Askrova bedehuskapell' | wikisql |
CREATE TABLE table_70651 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | How low is the Attendance that has an Opponent of devil rays and a Date of may 13? | SELECT MIN("Attendance") FROM table_70651 WHERE "Opponent" = 'devil rays' AND "Date" = 'may 13' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE T... | i would like to fly DL from ATLANTA to PITTSBURGH | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'AT... | atis |
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 Height , and list by the Name from high to low. | SELECT Name, Height FROM people ORDER BY Name DESC | nvbench |
CREATE TABLE table_25527255_2 (
shirt_sponsor VARCHAR,
team VARCHAR
) | Who is the shirt sponsor for FC Bunyodkor? | SELECT shirt_sponsor FROM table_25527255_2 WHERE team = "FC Bunyodkor" | sql_create_context |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_J... | Find the first name and gpa of the students whose gpa is lower than the average gpa of all students. Visualize by pie chart. | SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME | nvbench |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,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 (
LOCATIO... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of job_id and the sum of salary , and group by attribute job_id in a bar chart, list X in asc order. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | find the diagnosis icd9 code of subject id 19420. | SELECT diagnoses.icd9_code FROM diagnoses WHERE diagnoses.subject_id = "19420" | mimicsql_data |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 56349425437检查结果指标记录的设备编码和仪器编号以及名称是啥 | SELECT jyjgzbb.SBBM, jyjgzbb.YQBH, jyjgzbb.YQMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '56349425437' | css |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additio... | Which Film and Cinema Studies courses do n't have prerequisites ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Film and Cinema Studies%' OR course.description LIKE '%Film and Cinema Studies%' OR course.name LIKE '%Film and Cinema Studies%') AND course.enforced_requirement = 'N / ... | advising |
CREATE TABLE table_12784134_24 (
perfect_stem VARCHAR,
short_stem VARCHAR
) | Name the perfect stem for jo | SELECT COUNT(perfect_stem) FROM table_12784134_24 WHERE short_stem = "jo" | sql_create_context |
CREATE TABLE table_204_126 (
id number,
"place" text,
"player" text,
"country" text,
"score" text,
"to par" number,
"money ($)" number
) | which country had the most leaders ? | SELECT "country" FROM table_204_126 GROUP BY "country" ORDER BY COUNT("player") DESC LIMIT 1 | squall |
CREATE TABLE table_16202 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | Who are the writers for the episode 'solo'? | SELECT "Written by" FROM table_16202 WHERE "Title" = 'Solo' | wikisql |
CREATE TABLE Customers (
date_of_birth VARCHAR,
customer_status_code VARCHAR
) | When are the birthdays of customer who are classified as 'Good Customer' status? | SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer' | 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 whose ethnicity is white and lab test name is protein/creatinine ratio? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE" AND lab.label = "Protein/Creatinine Ratio" | mimicsql_data |
CREATE TABLE table_68051 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | What is the average decile of Ruapehu college, which has a state authority? | SELECT AVG("Decile") FROM table_68051 WHERE "Authority" = 'state' AND "Name" = 'ruapehu college' | wikisql |
CREATE TABLE table_203_607 (
id number,
"catalogue number" text,
"artist" text,
"release title" text,
"format" text,
"release date" text
) | the release dates are no earlier than what year ? | SELECT MIN("release date") FROM table_203_607 | squall |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,... | Get name, excerpts and wiki content of all tags.. | SELECT t.TagName, e.Body AS "Excerpt", w.Body AS "WikiBody" FROM Tags AS t LEFT JOIN Posts AS e ON t.ExcerptPostId = e.Id LEFT JOIN Posts AS w ON t.WikiPostId = w.Id ORDER BY t.TagName | sede |
CREATE TABLE table_32707 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Attendance" text
) | What's the result for the game held on December 27, 2004 with a week greater than 2? | SELECT "Result" FROM table_32707 WHERE "Week" > '2' AND "Date" = 'december 27, 2004' | wikisql |
CREATE TABLE table_60949 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" text
) | Who is the player with 140,000? | SELECT "Player" FROM table_60949 WHERE "Money ( \u00a3 )" = '140,000' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | Count the number of patients whose diagnosis icd9 code is 27801. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "27801" | mimicsql_data |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | does hydrochlorothiazide have been prescribed to patient 85700 during this month? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85700) AND prescriptions.drug = 'hydrochlorothiazide' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') | mimic_iii |
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 Voting_record (
StuID INTEGER,
Registration_Date VARCHAR(12),
Election_Cycle VARCHAR(12),
Presiden... | Give me a bar chart shows the distinct registration date, and bin the date into the weekday interval in a bar chart, and sort by the y axis from high to low please. | SELECT Registration_Date, COUNT(Registration_Date) FROM Voting_record ORDER BY COUNT(Registration_Date) DESC | nvbench |
CREATE TABLE table_2588674_1 (
region VARCHAR,
village VARCHAR
) | How many places named mongmong-toto-maite? | SELECT COUNT(region) FROM table_2588674_1 WHERE village = "Mongmong-Toto-Maite" | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
... | self accepted answers in the given tag. | SELECT selfAnswer.Id AS "post_link", question.Score AS QuestionScore, selfAnswer.Score AS AnswerScore, question.Tags FROM Posts AS question INNER JOIN Posts AS selfAnswer ON selfAnswer.OwnerUserId = question.OwnerUserId AND selfAnswer.ParentId = question.Id AND selfAnswer.Id = question.AcceptedAnswerId WHERE question.P... | sede |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 9581134这家医院所有的就诊记载里,按照不一样的科室编号与入院时的诊断编码差别算一下民政补助部分与总医疗费用的最大比值并把结果按降序来排列 | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '9581134' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_D... | css |
CREATE TABLE table_203_226 (
id number,
"player" text,
"matches" number,
"innings" number,
"not out" number,
"runs" number,
"high score" number,
"average" number,
"strike rate" number,
"100s" number,
"50s" number
) | who has a lower strike rate , anthony mcgrath or tim bresnan ? | SELECT "player" FROM table_203_226 WHERE "player" IN ('anthony mcgrath', 'tim bresnan') ORDER BY "strike rate" LIMIT 1 | squall |
CREATE TABLE table_10602294_1 (
dates_active VARCHAR,
deaths VARCHAR
) | What were the active dates for the storm that had 185km/h (115mph) deaths? | SELECT dates_active FROM table_10602294_1 WHERE deaths = "185km/h (115mph)" | sql_create_context |
CREATE TABLE table_name_54 (
series VARCHAR,
winner VARCHAR
) | What is Series, when Winner is Jetmir Salaj? | SELECT series FROM table_name_54 WHERE winner = "jetmir salaj" | sql_create_context |
CREATE TABLE table_name_10 (
voice_actor__harmony_gold_ova_dub_ VARCHAR,
voice_actor__adv_tv_sentai_ova_dub_ VARCHAR
) | Who is the voice actor (harmony gold ova dub) of the character with a voice actor (adv TV/sentai ova dub) Kim Prause? | SELECT voice_actor__harmony_gold_ova_dub_ FROM table_name_10 WHERE voice_actor__adv_tv_sentai_ova_dub_ = "kim prause" | sql_create_context |
CREATE TABLE table_name_59 (
home_team VARCHAR,
away_team VARCHAR
) | What was the score of the home team when the away team was Geelong? | SELECT home_team AS score FROM table_name_59 WHERE away_team = "geelong" | sql_create_context |
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 was hired before 2002-06-21, a bar chart shows the distribution of job_id and the average of employee_id , and group by attribute job_id, sort in ascending by the y axis please. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE station (
id number,
name text,
lat number,
long number,
dock_count number,
city text,
installation_date text
)
CREATE TABLE trip (
id number,
duration number,
start_date text,
start_station_name text,
start_station_id number,
end_date text,
end_stat... | What is the id of the trip that started from the station with the highest dock count? | SELECT T1.id FROM trip AS T1 JOIN station AS T2 ON T1.start_station_id = T2.id ORDER BY T2.dock_count DESC LIMIT 1 | spider |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
countr... | What classes will Dr. Yang Zhang be teaching this upcoming semester ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Yang Zhang%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offeri... | advising |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | what is the maximum total hospital cost involving a procedure called a neurosurgery - resection of avm? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'neurosurgery - resection of avm')) GROUP BY ... | eicu |
CREATE TABLE table_204_887 (
id number,
"district" number,
"representative" text,
"party" text,
"residence" text,
"counties represented" text
) | how many representatives are republican ? | SELECT COUNT("representative") FROM table_204_887 WHERE "party" = 'republican' | squall |
CREATE TABLE table_name_36 (
played INTEGER,
points VARCHAR,
lost VARCHAR
) | Can you tell me the highest Played that has the Points larger than 11, and the Lost larger than 7? | SELECT MAX(played) FROM table_name_36 WHERE points > 11 AND lost > 7 | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | count the number of patients on iv bolus route of drug administration who have procedure icd9 code 4601. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4601" AND prescriptions.route = "IV BOLUS" | mimicsql_data |
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,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | 自二零一八年十月一日开始,截止到二零二零年八月二十三日,看看病人韦英秀到医院看病的次数是多少 | SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '韦英秀' AND wdmzjzjlb.JZKSRQ BETWEEN '2018-10-01' AND '2020-08-23' UNION SELECT COUNT(*) FROM p... | css |
CREATE TABLE table_name_87 (
rank INTEGER,
wins__outdoor_ VARCHAR,
wins__indoor_ VARCHAR
) | Name the most rank for wins outdoor larger than 1 and wins indoor less than 0 | SELECT MAX(rank) FROM table_name_87 WHERE wins__outdoor_ > 1 AND wins__indoor_ < 0 | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airline (
airline_code varchar,... | i'd like to find a nonstop flight from BOSTON to ATLANTA that leaves sometime in the afternoon and arrives in ATLANTA before evening | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.arrival_time < 1800 AND flight.to_airport = AIRPORT_SERVICE_1.airpo... | atis |
CREATE TABLE table_22958 (
"Year" text,
"Location" text,
"Class 1" text,
"Best UK team" text,
"Class 1-200" text,
"Class 3" text,
"Class 1a" text
) | Name the best uk team for university of birmingham | SELECT COUNT("Best UK team") FROM table_22958 WHERE "Class 1-200" = 'University of Birmingham' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,... | how many patient have died after they were diagnosed with ch ob asthma w stat asth in the same month? | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime 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 d_icd_di... | mimic_iii |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | has patient 028-55503 ever received a diagnosis since 1 year ago? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-55503')) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(... | eicu |
CREATE TABLE table_name_35 (
laps VARCHAR,
time_retired VARCHAR
) | Tell me the Laps for time/retired of +8 laps | SELECT laps FROM table_name_35 WHERE time_retired = "+8 laps" | sql_create_context |
CREATE TABLE table_name_79 (
lens__35mm_equiv__zoom VARCHAR,
_aperture VARCHAR,
model VARCHAR
) | What is the lens zoom and aperture for the coolpix 5400? | SELECT lens__35mm_equiv__zoom, _aperture FROM table_name_79 WHERE model = "coolpix 5400" | sql_create_context |
CREATE TABLE table_204_739 (
id number,
"districts" text,
"ubigeo" number,
"area\n(km2)" number,
"population" number,
"population density\n(/km2)" number,
"created" text,
"postal\ncode" number
) | how many districts have more than 100,000 people in this city ? | SELECT COUNT("districts") FROM table_204_739 WHERE "population" > 100000 | squall |
CREATE TABLE table_name_84 (
status VARCHAR,
authors VARCHAR
) | What is the status of Author Del Corro? | SELECT status FROM table_name_84 WHERE authors = "del corro" | sql_create_context |
CREATE TABLE table_name_41 (
series__number INTEGER,
production_code VARCHAR,
season__number VARCHAR
) | Name the least series number with production code of 717 and season number less than 17 | SELECT MIN(series__number) FROM table_name_41 WHERE production_code = 717 AND season__number < 17 | sql_create_context |
CREATE TABLE table_77788 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | During melbourne's home game, who was the away team? | SELECT "Away team" FROM table_77788 WHERE "Home team" = 'melbourne' | wikisql |
CREATE TABLE table_name_36 (
original_title VARCHAR,
film_title_used_in_nomination VARCHAR
) | What was the original title for the film used in nomination of keep smiling? | SELECT original_title FROM table_name_36 WHERE film_title_used_in_nomination = "keep smiling" | sql_create_context |
CREATE TABLE table_204_870 (
id number,
"product" text,
"main functionality" text,
"input format" text,
"output format" text,
"platform" text,
"license and cost" text,
"notes" text
) | what is the last product represented in the chart ? | SELECT "product" FROM table_204_870 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_name_95 (
appearances VARCHAR,
goals VARCHAR,
rank VARCHAR
) | How many appearances were made by people that had 5 goals and less than 7 rank? | SELECT COUNT(appearances) FROM table_name_95 WHERE goals = 5 AND rank < 7 | 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 the number of patients whose admission location is clinic referral/premature and primary disease is celo-vessicle fistula? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "CELO-VESSICLE FISTULA" | mimicsql_data |
CREATE TABLE table_27734769_8 (
date VARCHAR,
high_assists VARCHAR
) | How many times was the high assists andre miller (7)? | SELECT COUNT(date) FROM table_27734769_8 WHERE high_assists = "Andre Miller (7)" | sql_create_context |
CREATE TABLE table_name_35 (
place VARCHAR,
score VARCHAR
) | What was the place when the score was 65-70-72=207? | SELECT place FROM table_name_35 WHERE score = 65 - 70 - 72 = 207 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.