context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_204_246 (
id number,
"department" text,
"total deputies" number,
"uninominal deputies" number,
"plurinominal deputies" number,
"special indigenous\nor campesino deputies" number,
"senators" number
) | what is the only department witj 5 total deputies | SELECT "department" FROM table_204_246 WHERE "total deputies" = 5 | squall |
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... | 从00年1月4日到2013年4月1日之内氢氯噻嗪片开出的总数量和总金额分别有多少? | SELECT SUM(QTY), SUM(AMOUNT) FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '氢氯噻嗪片' AND STA_DATE BETWEEN '2000-01-04' AND '2013-04-01' | css |
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... | 看看编号为61436514102的门诊就诊记录病患体征的日期时间 | SELECT mzjzjlb.JLSJ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '61436514102' | css |
CREATE TABLE table_58525 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What date was the venue at VFL park? | SELECT "Date" FROM table_58525 WHERE "Venue" = 'vfl park' | wikisql |
CREATE TABLE table_204_550 (
id number,
"event" text,
"record" text,
"athlete" text,
"date" text,
"meet" text,
"place" text
) | what is the first athlete in teh 100m event ? | SELECT "athlete" FROM table_204_550 WHERE "event" = '100 m' ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE Staff (
staff_id INTEGER,
staff_name VARCHAR(255),
gender VARCHAR(1),
other_staff_details VARCHAR(255)
)
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_name VARCHAR(20),
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
... | Give me a histogram for how many engineers did each staff contact? List both the contact staff name and number of engineers contacted, list by the total number in descending. | SELECT staff_name, COUNT(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id GROUP BY T1.staff_name ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | Return a bar chart about the distribution of name and meter_100 , and list in asc by the total number. | SELECT name, meter_100 FROM swimmer ORDER BY meter_100 | nvbench |
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... | calculate the number of patients admitted to emergency who had thoracentesis. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Thoracentesis" | mimicsql_data |
CREATE TABLE table_name_31 (
round VARCHAR,
against VARCHAR
) | What was the round when nueza silva played against greece? | SELECT round FROM table_name_31 WHERE against = "greece" | sql_create_context |
CREATE TABLE table_name_56 (
hanja VARCHAR,
mccune_reischauer VARCHAR
) | What is the Hanja for McCune-Reischauer of ch n? | SELECT hanja FROM table_name_56 WHERE mccune_reischauer = "chŏn" | 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 lab (
subject_id text,
hadm_id text,
... | how many patients whose year of death is less than or equal to 2165 and drug name is levofloxacin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2165.0" AND prescriptions.drug = "Levofloxacin" | mimicsql_data |
CREATE TABLE table_name_95 (
high_points VARCHAR,
team VARCHAR
) | What is the High points with a Team with boston? | SELECT high_points FROM table_name_95 WHERE team = "boston" | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | Count of questions with serverless tag over time. | SELECT DATEADD(week, DATEDIFF(day, '20000109', CreationDate) / 7, '20000109') AS "week", COUNT(DISTINCT Posts.Id) AS Posts, SUM(Posts.AnswerCount) AS Answers, SUM(Posts.CommentCount) AS Comments FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName L... | sede |
CREATE TABLE table_28785738_1 (
director VARCHAR,
no_in_season VARCHAR
) | Who directed episode 11 of the season? | SELECT director FROM table_28785738_1 WHERE no_in_season = 11 | sql_create_context |
CREATE TABLE table_1342013_34 (
result VARCHAR,
incumbent VARCHAR
) | what's the result with incumbent being william h. ayres | SELECT result FROM table_1342013_34 WHERE incumbent = "William H. Ayres" | sql_create_context |
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 microlab (
microl... | total the number of drugs patient 032-3281 has been prescribed so far during their last hospital encounter. | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-3281' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE table_name_98 (
label VARCHAR,
date VARCHAR,
catalog VARCHAR
) | What is the label from 1973 that has a catalog number of l 35023? | SELECT label FROM table_name_98 WHERE date = "1973" AND catalog = "l 35023" | sql_create_context |
CREATE TABLE table_name_11 (
winner VARCHAR,
event VARCHAR
) | Who is the winner of the European Poker Tour Grand Final? | SELECT winner FROM table_name_11 WHERE event = "european poker tour grand final" | sql_create_context |
CREATE TABLE table_name_10 (
visiting_team VARCHAR,
date VARCHAR
) | What was the visiting team on october 23? | SELECT visiting_team FROM table_name_10 WHERE date = "october 23" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | Bin the hire date into the day of week interval, and then calculate the average salary of employees in each day for a bar chart, note that just select those employees without the letter M in their first name, and could you list Y in ascending order? | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE table_204_343 (
id number,
"nation" text,
"model" text,
"length" text,
"barrel length" text,
"weight" text
) | which country had the least number of models ? | SELECT "nation" FROM table_204_343 GROUP BY "nation" ORDER BY COUNT("model") LIMIT 1 | squall |
CREATE TABLE table_21337 (
"Department" text,
"Projects" real,
"Municipalities" real,
"Farmers" real,
"Irrigated Ha" real,
"BID/PRONAR Investment (US$)" text,
"Local Investment (US$)" text,
"Total" text
) | What was the department that got $626,798 in local investments? | SELECT "Department" FROM table_21337 WHERE "Local Investment (US$)" = '626,798' | wikisql |
CREATE TABLE table_74004 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the first elected for hosea moffitt (f) 57.9% josiah masters (dr) 42.1% | SELECT "First elected" FROM table_74004 WHERE "Candidates" = 'Hosea Moffitt (F) 57.9% Josiah Masters (DR) 42.1%' | wikisql |
CREATE TABLE table_19930660_3 (
winner VARCHAR,
rufus_guest VARCHAR
) | What is the resulting score for the episodes where Rufus's guest is Sean Lock? | SELECT winner FROM table_19930660_3 WHERE rufus_guest = "Sean Lock" | sql_create_context |
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREA... | Group and count details for the events using a bar chart, and I want to list by the names in desc. | SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details ORDER BY Event_Details DESC | nvbench |
CREATE TABLE table_72681 (
"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 amount of int yards | SELECT MIN("Int yards") FROM table_72681 | wikisql |
CREATE TABLE table_name_49 (
year INTEGER,
quantity VARCHAR,
gwr_numbers VARCHAR
) | What is the average Year that has a Quantity of 10, and a GWR Numbers of 409, 290, 315, 317 321, 324, 333? | SELECT AVG(year) FROM table_name_49 WHERE quantity = 10 AND gwr_numbers = "409, 290, 315, 317–321, 324, 333" | sql_create_context |
CREATE TABLE table_204_401 (
id number,
"rank" number,
"lane" number,
"name" text,
"nationality" text,
"react" number,
"time" number,
"notes" text
) | the difference between yelizaveta bryzhina 's time and ksenija balta 's time ? | SELECT ABS((SELECT "time" FROM table_204_401 WHERE "name" = 'yelizaveta bryzhina') - (SELECT "time" FROM table_204_401 WHERE "name" = 'ksenija balta')) | squall |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Questions counted by time to first answer (w/o 24 hr restriction, log/log axis). | SELECT LOG(10, CAST((JULIANDAY(CreationDate) - JULIANDAY(q.CreationDate)) * 1440.0 AS INT)) AS "Log Time (m)", LOG(10, COUNT(*)) FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id LEFT OUTER JOIN Posts AS a2 ON a.ParentId = a2.ParentId AND a.CreationDate > a2.CreationDate WHERE a2.Id IS NULL AND a.CreationDate ... | sede |
CREATE TABLE table_5223 (
"Team" text,
"Copa Libertadores 1992" text,
"Supercopa Sudamericana 1992" text,
"Copa CONMEBOL 1992" text,
"Recopa Sudamericana 1992" text,
"Intercontinental Cup 1992" text
) | Which Copa Libertadores 1992 has a Supercopa Sudamericana 1992 of round of 16, and a Team of gr mio? | SELECT "Copa Libertadores 1992" FROM table_5223 WHERE "Supercopa Sudamericana 1992" = 'round of 16' AND "Team" = 'grêmio' | wikisql |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course (
c... | Display requirements for a degree in CS-LSA . | 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_75047 (
"Stage" text,
"Time" text,
"Name" text,
"Length" text,
"Winner" text
) | What is the Name of the stage with S. Loeb as the Winner with a Length of 13.04km and a Stage of SS12? | SELECT "Name" FROM table_75047 WHERE "Winner" = 's. loeb' AND "Length" = '13.04km' AND "Stage" = 'ss12' | wikisql |
CREATE TABLE table_14078 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"# / County" text
) | Where is the school located that has mustangs as a mascot? | SELECT "Location" FROM table_14078 WHERE "Mascot" = 'mustangs' | wikisql |
CREATE TABLE table_42818 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | Who is the Away captain that played on 11,12,13 Aug 1902? | SELECT "Away captain" FROM table_42818 WHERE "Date" = '11,12,13 aug 1902' | wikisql |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
) | Show different types of ships and the average tonnage of ships of each type Show bar chart, sort Y in asc order. | SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY AVG(Tonnage) | nvbench |
CREATE TABLE table_55249 (
"Year" text,
"President" text,
"Vice President" text,
"Gen.-Secretary" text,
"Treasurer" text
) | Which Vice President has a President of daniel masny, and a Treasurer of rebecca t. altmann? | SELECT "Vice President" FROM table_55249 WHERE "President" = 'daniel masny' AND "Treasurer" = 'rebecca t. altmann' | wikisql |
CREATE TABLE table_11019212_1 (
thursday VARCHAR,
location VARCHAR
) | what's the thursday time with location being hawthorne | SELECT thursday FROM table_11019212_1 WHERE location = "Hawthorne" | sql_create_context |
CREATE TABLE table_50547 (
"Team" text,
"Chassis" text,
"Engine" text,
"Tire" text,
"Sponsor" text
) | What is the Chassis of the Honda Engine with a Motorola sponsor? | SELECT "Chassis" FROM table_50547 WHERE "Engine" = 'honda' AND "Sponsor" = 'motorola' | wikisql |
CREATE TABLE table_1510519_1 (
number_of_seasons_in_top_division VARCHAR,
position_in_2012_13 VARCHAR
) | How many seasons in the top division for the team that finished 005 5th in 2012-2013 | SELECT COUNT(number_of_seasons_in_top_division) FROM table_1510519_1 WHERE position_in_2012_13 = "005 5th" | sql_create_context |
CREATE TABLE table_67986 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | A ferrari flat-12 engine with more than 1 point has what kind of chassis? | SELECT "Chassis" FROM table_67986 WHERE "Engine" = 'ferrari flat-12' AND "Points" > '1' | wikisql |
CREATE TABLE table_name_15 (
lost INTEGER,
team VARCHAR
) | What is the most number of losses for Quetta Zorawar? | SELECT MAX(lost) FROM table_name_15 WHERE team = "quetta zorawar" | sql_create_context |
CREATE TABLE table_name_67 (
description VARCHAR,
year_of_issue VARCHAR,
weight VARCHAR
) | Which Description has a Year of Issue of 1983, and a Weight of 3.50grams? | SELECT description FROM table_name_67 WHERE year_of_issue = 1983 AND weight = "3.50grams" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE charte... | whats the sex of patient 1862? | SELECT patients.gender FROM patients WHERE patients.subject_id = 1862 | mimic_iii |
CREATE TABLE table_1708014_1 (
top_5 INTEGER,
top_10 VARCHAR,
team_s_ VARCHAR
) | For team #40 chip ganassi racing which top 5 is the highest where top 10 is 5? | SELECT MAX(top_5) FROM table_1708014_1 WHERE top_10 = 5 AND team_s_ = "#40 Chip Ganassi Racing" | sql_create_context |
CREATE TABLE table_75627 (
"County" text,
"Per capita income" text,
"Median household income" text,
"Median family income" text,
"Population" real,
"Number of households" real
) | What County has a Median household income of $46,872? | SELECT "County" FROM table_75627 WHERE "Median household income" = '$46,872' | wikisql |
CREATE TABLE ROLES (
role_description VARCHAR,
role_code VARCHAR
)
CREATE TABLE Employees (
role_code VARCHAR,
employee_name VARCHAR
) | What is the role of the employee named Koby? | SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = "Koby" | sql_create_context |
CREATE TABLE Documents_with_expenses (
document_id VARCHAR,
budget_type_code VARCHAR
)
CREATE TABLE Ref_budget_codes (
budget_type_code VARCHAR,
budget_type_description VARCHAR
) | Show the budget type code and description and the corresponding document id. | SELECT T2.budget_type_code, T2.budget_type_description, T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code | sql_create_context |
CREATE TABLE table_60743 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What date was the Izmir Cup in which lhan played against Somdev Devvarman? | SELECT "Date" FROM table_60743 WHERE "Tournament" = 'izmir cup' AND "Opponent" = 'somdev devvarman' | wikisql |
CREATE TABLE table_204_724 (
id number,
"outcome" text,
"no." number,
"date" text,
"tournament" text,
"surface" text,
"partner" text,
"opponents in the final" text,
"score in the final" text
) | how many winners are there ? | SELECT COUNT(*) FROM table_204_724 WHERE "outcome" = 'winner' | squall |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId numb... | All my posts in desc. | SELECT COUNT(Id), PostTypeId FROM Posts WHERE OwnerUserId = @UserId AND CreationDate >= '##year##0101' AND CreationDate <= '##year##1231' GROUP BY PostTypeId | sede |
CREATE TABLE table_54954 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the score for the home team who plays their matches at the mcg venue? | SELECT "Home team score" FROM table_54954 WHERE "Venue" = 'mcg' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
... | what the first height of patient 030-67523 in their last hospital encounter. | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-67523' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionheight IS NULL ORDER... | eicu |
CREATE TABLE table_36299 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which opponent has 63 points? | SELECT "Opponent" FROM table_36299 WHERE "Points" = '63' | wikisql |
CREATE TABLE table_name_33 (
visitor VARCHAR,
home VARCHAR
) | Who was the visiting team when Winnipeg was the home team? | SELECT visitor FROM table_name_33 WHERE home = "winnipeg" | sql_create_context |
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 cost (
costid num... | what was the name of the output the last time patient 030-21071 had on last month/21? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-21071')) AND intakeoutput.cellpath LIKE '%output%' AND D... | eicu |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
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 Has_Allergy (
StuID INTEGE... | Show all majors and corresponding number of students. Plot them as scatter chart. | SELECT Major, COUNT(*) FROM Student GROUP BY Major | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | what is marital status and date of birth of subject id 2560? | SELECT demographic.marital_status, demographic.dob FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE volume (
Volume_ID int,
V... | A bar chart for returning the number of the categories of music festivals that have the result 'Awarded'. | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category | nvbench |
CREATE TABLE table_29228 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What position was pick # 54? | SELECT "Position" FROM table_29228 WHERE "Pick #" = '54' | wikisql |
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_jyjgzbb (
JYZBLSH number,
... | 在检测指标结果定量单位、检测指标名称和检验指标记录号码是13374209977的记录相同那些中筛选出检测指标结果定量不小于其的检验指标记录都有哪些呢? | SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '13374209977') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '13374209977') AND jyjgzbb.JCZBJGDL >= (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '13374209977') | css |
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, draw a bar chart about the distribution of name and the sum of code , and group by attribute name. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Draw a pie chart about the proportion of ACC_Regular_Season and ACC_Percent. | SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match | nvbench |
CREATE TABLE table_1342359_15 (
candidates VARCHAR,
district VARCHAR
) | who are the candidates with district being kansas 4 | SELECT candidates FROM table_1342359_15 WHERE district = "Kansas 4" | sql_create_context |
CREATE TABLE table_65353 (
"Draw" real,
"Language" text,
"Artist" text,
"Place" real,
"Points" real
) | what is the average draw when the place is 5 and points more than 15? | SELECT AVG("Draw") FROM table_65353 WHERE "Place" = '5' AND "Points" > '15' | wikisql |
CREATE TABLE table_name_72 (
score VARCHAR,
event VARCHAR
) | What is the total score for the 36 arrow finals event? | SELECT COUNT(score) FROM table_name_72 WHERE event = "36 arrow finals" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | how many patients were diagnosed since 4 years ago with pleural effusion - right within 2 months after receiving laxatives - enema? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'laxatives - enema' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN ... | eicu |
CREATE TABLE table_name_30 (
royal_house VARCHAR,
name VARCHAR
) | Which Royal house has a name of ding? | SELECT royal_house FROM table_name_30 WHERE name = "ding" | sql_create_context |
CREATE TABLE table_204_570 (
id number,
"rank" number,
"mountain" text,
"height (m)" number,
"height (ft)" number,
"range" text,
"coordinates" text,
"prominence (m)" number,
"parent mountain" text,
"first ascent" number,
"ascents (failed attempts) bef.2004" text
) | is k2 taller than kangchenjunga ? | SELECT (SELECT "height (m)" FROM table_204_570 WHERE "mountain" = 'k2') > (SELECT "height (m)" FROM table_204_570 WHERE "mountain" = 'kangchenjunga') | squall |
CREATE TABLE table_name_4 (
glyph INTEGER,
hexadecimal VARCHAR,
binary VARCHAR
) | What is the sum of the glyph with a 38 hexadecimal and a binary less than 111000? | SELECT SUM(glyph) FROM table_name_4 WHERE hexadecimal = 38 AND binary < 111000 | sql_create_context |
CREATE TABLE table_13170 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | WHat status had an against larger than 6 and a date of 01/02/1975? | SELECT "Status" FROM table_13170 WHERE "Against" > '6' AND "Date" = '01/02/1975' | wikisql |
CREATE TABLE table_75061 (
"Team" text,
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text,
"Week 6" text,
"Week 7" text,
"Week 8 Final" text
) | Name the team for week 1 of 28 | SELECT "Team" FROM table_75061 WHERE "Week 1" = '28' | wikisql |
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
... | What is the number of cities in each country? Return a bar chart, and list in ascending by the x axis please. | SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name ORDER BY T2.Name | nvbench |
CREATE TABLE table_name_89 (
loser VARCHAR,
date VARCHAR,
location VARCHAR,
winner VARCHAR
) | Who lost at schaefer stadium when the Winner was new england patriots, and a Date of october 18? | SELECT loser FROM table_name_89 WHERE location = "schaefer stadium" AND winner = "new england patriots" AND date = "october 18" | sql_create_context |
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,
country varchar,
zip int
)
CREATE TABLE comment_instructor (
instructor_id int,
... | Before taking GTBOOKS 331 , what are some useful courses to take ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'GTBOOKS' AND number = 331 | advising |
CREATE TABLE table_31230 (
"Seed" real,
"Rank" real,
"Player" text,
"Points" real,
"Points defending" real,
"Points won" real,
"New points" real,
"Status" text
) | What is listed in new points when status is second round lost to xavier malisse? | SELECT MIN("New points") FROM table_31230 WHERE "Status" = 'Second round lost to Xavier Malisse' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is procedure long title of subject id 14755? | SELECT procedures.long_title FROM procedures WHERE procedures.subject_id = "14755" | mimicsql_data |
CREATE TABLE table_5969 (
"Round" real,
"Club" text,
"Home" text,
"Away" text,
"Aggregate" text
) | What is NK Rijeka's away score? | SELECT "Away" FROM table_5969 WHERE "Club" = 'nk rijeka' | wikisql |
CREATE TABLE gwyjzb (
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,
... | 从一零年十一月十号开始到二零一七年九月二十六号这几年里医疗机构1301404总医疗费超过5083.93元的未从业人员就诊记录数量 | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1301404' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-11-10' AND '2017-09-26' AND gwyjzb.INSURED_STS = '未就业' AND gwyjzb.MED_AMOUT >= 5083.93 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1301404' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2010-11-10' AND '... | css |
CREATE TABLE table_75977 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Tries For" text,
"Tries Against" text
) | What is the value of the item 'Points' when the value of the item 'Points against' is 272? | SELECT "Points for" FROM table_75977 WHERE "Points against" = '272' | wikisql |
CREATE TABLE table_name_19 (
time VARCHAR,
name VARCHAR,
lane VARCHAR,
heat VARCHAR
) | What is the time for a lane less than 6, and a heat less than 4 for Joanne Malar? | SELECT time FROM table_name_19 WHERE lane < 6 AND heat < 4 AND name = "joanne malar" | sql_create_context |
CREATE TABLE table_15617 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Which record has an Attendance larger than 12,552, and a Score of 7-0? | SELECT "Record" FROM table_15617 WHERE "Attendance" > '12,552' AND "Score" = '7-0' | wikisql |
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 ... | 就诊的病患33852265号其检验报告单上对应的检查结果指标均不正常的单号是多少? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ... | css |
CREATE TABLE table_name_66 (
away_team VARCHAR
) | What was the score for Footscray when they were the away team? | SELECT away_team AS score FROM table_name_66 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE Nurse (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
Registered BOOLEAN,
SSN INTEGER
)
CREATE TABLE Undergoes (
Patient INTEGER,
Procedures INTEGER,
Stay INTEGER,
DateUndergoes DATETIME,
Physician INTEGER,
AssistingNurse INTEGER
)
CREATE TABLE Pa... | Return a pie chart on how many medications are prescribed for each brand? | SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand | nvbench |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostHistory (
Id number,
Po... | number of tags containing 'java'. | SELECT COUNT(*) FROM Tags WHERE TagName LIKE '%java%' | 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... | 查询在零四年五月二十日到一八年十二月十八日的这段时间里医院1011651有多少科室涉及的医疗费总额不超过1777.85元 | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD 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 = '1011651' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-05-20' AND '2018-12-18' GROUP B... | css |
CREATE TABLE table_3993 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What is the production code for episode 96 in the series? | SELECT MIN("Production code") FROM table_3993 WHERE "No. in series" = '96' | wikisql |
CREATE TABLE postseason (
year INTEGER,
round TEXT,
team_id_winner TEXT,
league_id_winner TEXT,
team_id_loser TEXT,
league_id_loser TEXT,
wins INTEGER,
losses INTEGER,
ties INTEGER
)
CREATE TABLE player_college (
player_id TEXT,
college_id TEXT,
year INTEGER
)
CREATE TA... | Show me the frequency of those years (bin year into year interval) that the team Boston Red Stockings won in the postseasons with a bar chart. | SELECT year, COUNT(year) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' | nvbench |
CREATE TABLE fgwyjzb (
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,
... | 患者76364706被开出过金额不低于3367.94元的药品在哪几次医疗记录中?列出有什么医疗就诊编号? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '76364706' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3367.94) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '76364706' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID ... | css |
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 (
... | calculate the total number of patients diagnosed with malig neo ascend colon | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Malig neo ascend colon" | mimicsql_data |
CREATE TABLE table_name_97 (
surface VARCHAR,
date VARCHAR
) | What was the surface on 23 October 2011? | SELECT surface FROM table_name_97 WHERE date = "23 october 2011" | sql_create_context |
CREATE TABLE table_30121082_1 (
barony VARCHAR,
area__acres__ VARCHAR
) | What are the Baronies when the area (in acres) is 276? | SELECT barony FROM table_30121082_1 WHERE area__acres__ = 276 | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 团伙成员75834844最常去的医院排序提供一下 | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '75834844' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
CREATE TABLE university (
affiliation VARCHAR,
enrollment INTEGER
) | Find the total student enrollment for different affiliation type schools. | SELECT SUM(enrollment), affiliation FROM university GROUP BY affiliation | sql_create_context |
CREATE TABLE table_77962 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the total number of bronze when the total is less than 1? | SELECT SUM("Bronze") FROM table_77962 WHERE "Total" < '1' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what percentile of a red blood cells is at 4.1 among a patient at the same age as patient 65582 in their current hospital encounter? | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissio... | mimic_iii |
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... | A scatter chart shows the correlation between author_id and author_tutor_ATB . | SELECT author_id, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_52214 (
"Year" real,
"Theme" text,
"Artist" text,
"Mintage" text,
"Issue Price" text
) | What artist had a mintage of 41,828 before year 2002? | SELECT "Artist" FROM table_52214 WHERE "Year" < '2002' AND "Mintage" = '41,828' | wikisql |
CREATE TABLE table_204_881 (
id number,
"round" number,
"date" text,
"score" text,
"opponent" text,
"opponent's score" text,
"result" text,
"venue" text,
"attendance" number,
"best on ground" text,
"team" text
) | what was this team 's next opponent after facing hawthorn on may 22 of this season ? | SELECT "opponent" FROM table_204_881 WHERE id = (SELECT id FROM table_204_881 WHERE "opponent" = 'hawthorn') + 1 | squall |
CREATE TABLE table_52716 (
"Name" text,
"Took Office" text,
"Left Office" text,
"Party" text,
"District Residence" text
) | Who has Took Office of march 4, 1875? | SELECT "Name" FROM table_52716 WHERE "Took Office" = 'march 4, 1875' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.