context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
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,
good_feedback int,
tough_tests int,
... | What class is easier if the choice is between EECS 555 and EECS 651 ? | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 555 OR course.number = 651) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... | advising |
CREATE TABLE Students (
email_address VARCHAR,
first_name VARCHAR,
last_name VARCHAR
) | What is the email of the student with first name 'Emma' and last name 'Rohan'? | SELECT email_address FROM Students WHERE first_name = "Emma" AND last_name = "Rohan" | sql_create_context |
CREATE TABLE table_name_73 (
score VARCHAR,
game VARCHAR
) | What's the score of Game 2? | SELECT score FROM table_name_73 WHERE game = 2 | sql_create_context |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 患者鲁鹏池的既往病历里最主要的病是什么,时间是从12年8月17日到17年12月15日 | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '鲁鹏池' AND qtb.IN_HOSP_DATE BETWEEN '2012-08-17' AND '2017-12-15' GROUP BY qtb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '鲁鹏池' AND gyb.IN_HOSP_DATE BETWEEN '... | css |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | how much does it cost patient 73423 to stay in hospital in their last hospital visit? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73423 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) | mimic_iii |
CREATE TABLE table_name_71 (
method VARCHAR,
time VARCHAR
) | What win method has a time of 2:32? | SELECT method FROM table_name_71 WHERE time = "2:32" | sql_create_context |
CREATE TABLE table_name_39 (
conceded INTEGER,
draws VARCHAR,
position VARCHAR
) | Which Conceded has Draws smaller than 5, and a Position larger than 6? | SELECT SUM(conceded) FROM table_name_39 WHERE draws < 5 AND position > 6 | sql_create_context |
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE appellations (
no number,
appelation text,
county text,
state text,
area text,
isava text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,... | What are the names and scores of all wines? | SELECT name, score FROM wine | spider |
CREATE TABLE table_70248 (
"Player" text,
"Club" text,
"Games Played" real,
"Minutes" real,
"Goals Against" real,
"GA Average" real,
"Wins" real,
"Loses" real
) | What is the lowest minutes a goalkeeper with 13 games played has? | SELECT MIN("Minutes") FROM table_70248 WHERE "Games Played" = '13' | wikisql |
CREATE TABLE table_46031 (
"Type" text,
"Name" text,
"Title" text,
"Royal house" text,
"From" text
) | What royal house did Shaokang belong to? | SELECT "Royal house" FROM table_46031 WHERE "Name" = 'shaokang' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | when was the last time when patient 46528 was prescribed sevelamer and erythromycin at the same time in 04/2102? | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'sevelamer' AND admissions.subject_id = 46528 AND STRFTIME('%y-%m', prescriptions.startdate) = '2102-04') AS t1 JOIN (SELECT admissi... | mimic_iii |
CREATE TABLE table_67711 (
"Rank" real,
"Games" real,
"Player" text,
"Club/Clubs" text,
"Career span" text
) | Which rank is Hawthorn? | SELECT "Rank" FROM table_67711 WHERE "Club/Clubs" = 'hawthorn' | wikisql |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | For each movie that received more than 3 reviews, what is the average rating. Show scatter chart. | SELECT mID, AVG(stars) FROM Rating GROUP BY mID | nvbench |
CREATE TABLE Candidates (
candidate_id INTEGER,
candidate_details VARCHAR(255)
)
CREATE TABLE Student_Course_Attendance (
student_id INTEGER,
course_id INTEGER,
date_of_attendance DATETIME
)
CREATE TABLE People_Addresses (
person_address_id INTEGER,
person_id INTEGER,
address_id INTEGE... | Bar chart of the number of course name from each course name | SELECT course_name, COUNT(course_name) FROM Courses GROUP BY course_name | nvbench |
CREATE TABLE table_46397 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is High Assists, when Date is 'March 10'? | SELECT "High assists" FROM table_46397 WHERE "Date" = 'march 10' | wikisql |
CREATE TABLE table_13627 (
"[A] (mol/L)" text,
"[H 3 PO 4 ]/[A] (%)" text,
"[H 2 PO 4 \u2212 ]/[A] (%)" real,
"[HPO 4 2\u2212 ]/[A] (%)" text,
"[PO 4 3\u2212 ]/[A] (%)" text
) | What's the HPO4 2 that has less than 89.3 as an H2PO 4 and 3.02 10 5 as the PO4 3? | SELECT "[HPO 4 2\u2212 ]/[A] (%)" FROM table_13627 WHERE "[H 2 PO 4 \u2212 ]/[A] (%)" < '89.3' AND "[PO 4 3\u2212 ]/[A] (%)" = '3.02×10 −5' | wikisql |
CREATE TABLE table_name_54 (
attendance INTEGER,
home VARCHAR,
round VARCHAR
) | Which Attendance has a Home of djurg rdens if, and a Round of 53? | SELECT MAX(attendance) FROM table_name_54 WHERE home = "djurgårdens if" AND round = 53 | sql_create_context |
CREATE TABLE table_17978052_2 (
_number_s_lake_and_gnis_query_link INTEGER,
borough_or_census_area VARCHAR
) | How many number of lakes are there in the Valdez-Cordova (CA) area? | SELECT MIN(_number_s_lake_and_gnis_query_link) FROM table_17978052_2 WHERE borough_or_census_area = "Valdez-Cordova (CA)" | sql_create_context |
CREATE TABLE table_11721 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
) | What's the name of the competition in 8th position? | SELECT "Competition" FROM table_11721 WHERE "Position" = '8th' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId num... | Acceptance of my answers by hour of the day. | WITH CTE AS (SELECT ROW_NUMBER() OVER (ORDER BY Id) - 1 AS N FROM Posts LIMIT 24) SELECT CTE.N, SUM(CASE WHEN Q.AcceptedAnswerId = A.Id THEN 1 ELSE 0 END) AS Acc, SUM(CASE WHEN Q.AcceptedAnswerId != A.Id THEN 1 ELSE 0 END) AS NonAcc FROM CTE LEFT JOIN Posts AS A ON TIME_TO_STR(A.CreationDate, '%h') = CTE.N LEFT JOIN Po... | sede |
CREATE TABLE table_name_24 (
date VARCHAR,
away_team VARCHAR
) | What date did Footscray play and Away game? | SELECT date FROM table_name_24 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
) | What are the allergy types and how many allergies correspond to each one? | SELECT allergytype, COUNT(*) FROM allergy_type GROUP BY allergytype | spider |
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... | among patients tested for joint fluid, how many of them had acute nephritis nec? | 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 = "Acute nephritis NEC" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
... | 病人尤静逸在医院0738891的门诊中,诊断涉及神经衰弱的门诊就诊记录列一下 | SELECT * FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '尤静逸' AND hz_info.YLJGDM = '0738891' AND zzmzjzjlb.JZZDSM LIKE '%神经衰弱%' UNION SELECT * FROM person_info JOIN... | css |
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price... | Show different carriers of phones together with the number of phones with each carrier Plot them as bar chart, show by the Y-axis in desc. | SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_9 (
score INTEGER,
to_par VARCHAR,
player VARCHAR
) | What is the score when the to par was 5, for Peter Jacobsen? | SELECT SUM(score) FROM table_name_9 WHERE to_par = "–5" AND player = "peter jacobsen" | sql_create_context |
CREATE TABLE table_203_710 (
id number,
"genre" text,
"year" number,
"title" text,
"episode" text,
"role" text,
"notes" text
) | how many short film roles has he acted in ? | SELECT COUNT(*) FROM table_203_710 WHERE "genre" = 'short film' | squall |
CREATE TABLE table_12092 (
"Edition" text,
"Round" text,
"Date" text,
"Partnering" text,
"Against" text,
"Surface" text,
"Opponents" text,
"Result" text
) | For what round was the opponent nikola iri du an vemi ? | SELECT "Round" FROM table_12092 WHERE "Opponents" = 'nikola ćirić dušan vemić' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDat... | Lowest Voted Question With Highest Voted Answer. | SELECT Score, Id AS "post_link", Title FROM Posts WHERE (Score < -10) ORDER BY Score | sede |
CREATE TABLE table_75776 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the Against when the drawn is 5? | SELECT "Against" FROM table_75776 WHERE "Drawn" = '5' | wikisql |
CREATE TABLE table_36866 (
"Name" text,
"Faith" text,
"Type" text,
"Intake" real,
"DCSF number" real,
"Ofsted number" real
) | Who has a DCSF number of 3373? | SELECT "Name" FROM table_36866 WHERE "DCSF number" = '3373' | wikisql |
CREATE TABLE table_name_18 (
away_team VARCHAR,
home_team VARCHAR
) | Who was the away team against the home team Sheffield United? | SELECT away_team FROM table_name_18 WHERE home_team = "sheffield united" | sql_create_context |
CREATE TABLE table_name_95 (
score VARCHAR,
date VARCHAR
) | What is the score on october 7? | SELECT score FROM table_name_95 WHERE date = "october 7" | sql_create_context |
CREATE TABLE table_5780 (
"Call sign" text,
"Frequency" text,
"City of License" text,
"Owner" text,
"Format" text
) | Who is the owner with a frequency of 0 101.1 fm? | SELECT "Owner" FROM table_5780 WHERE "Frequency" = '0 101.1 fm' | wikisql |
CREATE TABLE table_name_98 (
class VARCHAR,
built_as VARCHAR
) | Where the built as is DLG-23, what is the class? | SELECT class FROM table_name_98 WHERE built_as = "dlg-23" | sql_create_context |
CREATE TABLE table_76835 (
"Name" text,
"Took Office" text,
"Left Office" text,
"President" text,
"Party" text
) | What is Left Office, when Party is Vacant (1999-2001)? | SELECT "Left Office" FROM table_76835 WHERE "Party" = 'vacant (1999-2001)' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varc... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of last_name and employee_id , could you show EMPLOYEE_ID in ascending order? | SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID | nvbench |
CREATE TABLE table_203_355 (
id number,
"year" number,
"total" number,
"romanians" text,
"hungarians" text,
"roma" text
) | which year had the top percentage in romanian population ? | SELECT "year" FROM table_203_355 ORDER BY "romanians" DESC LIMIT 1 | squall |
CREATE TABLE table_79954 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many silvers have a Nation of hungary, and a Rank larger than 10? | SELECT COUNT("Silver") FROM table_79954 WHERE "Nation" = 'hungary' AND "Rank" > '10' | wikisql |
CREATE TABLE table_18526 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | How many results does the California 29 voting district have? | SELECT COUNT("Result") FROM table_18526 WHERE "District" = 'California 29' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
... | what was the last laboratory test that patient 8814 received during the first hospital visit? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8814 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime DES... | mimic_iii |
CREATE TABLE table_26868 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
) | What time did the game start on saturday, april 20? | SELECT "Kickoff" FROM table_26868 WHERE "Date" = 'Saturday, April 20' | wikisql |
CREATE TABLE table_name_72 (
season INTEGER,
races VARCHAR,
podiums VARCHAR
) | What is the earliest season with more than 14 races and more than 4 podiums? | SELECT MIN(season) FROM table_name_72 WHERE races > 14 AND podiums > 4 | sql_create_context |
CREATE TABLE table_48117 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text
) | How much January has a Game smaller than 37, and an Opponent of detroit red wings? | SELECT COUNT("January") FROM table_48117 WHERE "Game" < '37' AND "Opponent" = 'detroit red wings' | wikisql |
CREATE TABLE table_55289 (
"Name" text,
"Country" text,
"Status" text,
"Moving to" text,
"Transfer window" text,
"Transfer fee" text
) | What is the name of the player from Cod? | SELECT "Name" FROM table_55289 WHERE "Country" = 'cod' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDa... | Questions where several different users offered a bounty. | SELECT RANK() OVER (ORDER BY COUNT(DISTINCT bs.UserId) DESC) AS Rank, COUNT(DISTINCT bs.UserId) AS "number_of_users", COUNT(bs.Id) AS "number_of_bounties", SUM(bs.BountyAmount) AS "total_amount", p.Id AS "post_link", p.Score, p.AnswerCount, p.OwnerUserId AS "user_link", p.Tags, 'site://posts/' + CAST(p.Id AS TEXT) + '/... | sede |
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 zyjzjlb (
CYBQDM text,
CYBQMC... | 在患者陶歌韵的诊疗记录里,从02年8月1日到10年6月21日这期间,为其检测游离甲状腺素(三代)的医务人员有哪几位,报一下工号及姓名 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND 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 mzjzj... | css |
CREATE TABLE table_21321804_1 (
pick__number VARCHAR,
player VARCHAR
) | What is the pick # for player wes lysack? | SELECT pick__number FROM table_21321804_1 WHERE player = "Wes Lysack" | sql_create_context |
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 allergy type with number of students affected by a pie chart. | SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType | nvbench |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 统计年龄低于9岁的患者医疗记录的平均医疗费总额有多少? | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE < 9) | css |
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE field (
fieldid int
)
CREA... | List papers that has a keyword Depth Map | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Depth Map' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid | scholar |
CREATE TABLE table_19245 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many incumbents for the district of South Carolina 5? | SELECT COUNT("Incumbent") FROM table_19245 WHERE "District" = 'South Carolina 5' | wikisql |
CREATE TABLE table_22860698_2 (
surface VARCHAR,
championship VARCHAR,
year VARCHAR
) | What is the surface when the us open is the championship in the year 1979? | SELECT surface FROM table_22860698_2 WHERE championship = "US Open" AND year = 1979 | sql_create_context |
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... | 查一下编号为71075266432的住院就诊的入住病区、代码以及入院床位号 | SELECT wdmzjzjlb.RZBQDM, wdmzjzjlb.RZBQMC, wdmzjzjlb.RYCWH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '71075266432' UNION SELECT bdmzjzjlb.RZBQDM, bdmzjzjlb.RZBQMC, bdmzjzjlb.RYCWH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '71075266432' | css |
CREATE TABLE table_13980 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" real
) | Which song has a place greater than 7, more than 13 points, and draw of 5? | SELECT "Song" FROM table_13980 WHERE "Place" > '7' AND "Points" > '13' AND "Draw" = '5' | wikisql |
CREATE TABLE table_name_80 (
date VARCHAR,
opponent VARCHAR
) | what is the date when the opponent is leeds united? | SELECT date FROM table_name_80 WHERE opponent = "leeds united" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | what are the three most frequently prescribed drugs for patients who have previously been diagnosed with drug withdrawal syndrome - alcohol during the same month, this year? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'drug withdrawal syndrome - alcohol' AND DATETIME(d... | eicu |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX n... | 咱们医院的在00年4月27日到2000年12月12日内病人65980310的所有检验结果指标记录的检测人为韩乐音的检验指标流水号是多少号? | SELECT jyjgzbb.JYZBLSH 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.BGDH WHERE hz... | css |
CREATE TABLE team (
team_id_br VARCHAR,
name VARCHAR
)
CREATE TABLE salary (
team_id VARCHAR,
year VARCHAR
) | How many players were in the team Boston Red Stockings in 2000? | SELECT COUNT(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2000 | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE icustays (
row_id number,
subj... | count the number of people who were prescribed lr within 2 months following a diagnosis of personal history of fall since 4 years ago. | SELECT COUNT(DISTINCT t1.subject_id) 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_diagnoses.short_title = 'personal history o... | mimic_iii |
CREATE TABLE table_name_28 (
ad_freq VARCHAR,
show_name VARCHAR
) | What is the ad frequency for the Show Off The Bench? | SELECT ad_freq FROM table_name_28 WHERE show_name = "off the bench" | sql_create_context |
CREATE TABLE table_54967 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
) | What is the average attendance when the Forest Green Rovers is the away team? | SELECT AVG("Attendance") FROM table_54967 WHERE "Away team" = 'forest green rovers' | wikisql |
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... | 验证医疗药品的数量与单价的乘积在费用明细记录02899233164中是否等于药品的金额? | SELECT (SELECT QTY * UNIVALENT FROM t_kc22 WHERE MED_EXP_DET_ID = '02899233164') = (SELECT AMOUNT FROM t_kc22 WHERE MED_EXP_DET_ID = '02899233164') | css |
CREATE TABLE table_2409041_3 (
no_in_series INTEGER,
original_air_date VARCHAR
) | What series number had an original airdate of March 1, 1991? | SELECT MIN(no_in_series) FROM table_2409041_3 WHERE original_air_date = "March 1, 1991" | sql_create_context |
CREATE TABLE pitching_postseason (
player_id TEXT,
year INTEGER,
round TEXT,
team_id TEXT,
league_id TEXT,
w INTEGER,
l INTEGER,
g INTEGER,
gs INTEGER,
cg INTEGER,
sho INTEGER,
sv INTEGER,
ipouts INTEGER,
h INTEGER,
er INTEGER,
hr INTEGER,
bb INTEGER,
... | Return a line chart on what is the average number of attendance at home games for each year? | SELECT year, AVG(attendance) FROM home_game GROUP BY year | nvbench |
CREATE TABLE table_32450 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff" text,
"Game site" text,
"Record" text,
"Attendance" text
) | What was the result of week 1 and the opponent was bye? | SELECT "Result" FROM table_32450 WHERE "Week" = '1' AND "Opponent" = 'bye' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number... | Question which had the tag but no longer have it (including the editor). | WITH firstrev_cte AS (SELECT MIN(ph.Id) AS MinId, p.Id FROM Posts AS p JOIN PostHistory AS ph ON ph.PostId = p.Id WHERE ph.Text LIKE '%<##tagName##>%' AND NOT (p.Tags LIKE '%<##tagName##>%') GROUP BY p.Id) SELECT PostId AS "post_link", url = 'site://posts/' + CAST(PostId AS TEXT) + '/revisions', UserId AS "user_link", ... | sede |
CREATE TABLE table_23988726_2 (
saif_saaeed_shaheen___qat__ VARCHAR
) | When daniel lincoln ( usa ) is the saif saaeed shaheen ( qat ) What is the date for September 3rd, 2004? | SELECT 3 AS _september_2004 FROM table_23988726_2 WHERE saif_saaeed_shaheen___qat__ = "Daniel Lincoln ( USA )" | 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 ... | what's the cost of a loc exc les metatar/tar. | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'loc exc les metatar/tar')) | mimic_iii |
CREATE TABLE table_name_63 (
language_dialect VARCHAR,
basikal VARCHAR,
boleh VARCHAR
) | what is the language/dialect when basikal is sepeda and boleh is bulih? | SELECT language_dialect FROM table_name_63 WHERE basikal = "sepeda" AND boleh = "bulih" | sql_create_context |
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... | Return a bar chart about the distribution of Sex and the average of Height , and group by attribute Sex, list in descending by the x axis. | SELECT Sex, AVG(Height) FROM people GROUP BY Sex ORDER BY Sex DESC | nvbench |
CREATE TABLE table_46898 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | What is the Date of Game 5 with Road Team St. Louis? | SELECT "Date" FROM table_46898 WHERE "Road Team" = 'st. louis' AND "Game" = 'game 5' | wikisql |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Up vs Down votes by day for last week of Question or Answer. | SELECT CASE WHEN PostTypeId = 1 THEN 'Question' ELSE 'Answer' END AS "post_type", TIME_TO_STR(p.CreationDate, '%H'), COUNT(*) AS Amount, SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes, SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS DownVotes, CASE WHEN SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) = 0... | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | Give the number of patients diagnosed with pressure ulcer buttock whose drug route is id. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Pressure ulcer, buttock" AND prescriptions.route = "ID" | mimicsql_data |
CREATE TABLE table_name_7 (
stadium VARCHAR,
city VARCHAR
) | What is the name of the stadium for the city of melfi? | SELECT stadium FROM table_name_7 WHERE city = "melfi" | sql_create_context |
CREATE TABLE table_66471 (
"Rank:" real,
"State:" text,
"Premier:" text,
"Party:" text,
"Assumed office:" text,
"Left office:" text,
"TOTAL Time in office:" text
) | What is the least rank for the premier that assumed office on 17 may 1919 and was in office for 7 years, 335 days? | SELECT MIN("Rank:") FROM table_66471 WHERE "TOTAL Time in office:" = '7 years, 335 days' AND "Assumed office:" = '17 may 1919' | wikisql |
CREATE TABLE table_name_29 (
laps INTEGER,
driver VARCHAR,
grid VARCHAR
) | How many laps did innes ireland drive with a grid higher than 11? | SELECT SUM(laps) FROM table_name_29 WHERE driver = "innes ireland" AND grid > 11 | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate... | what's the average hospital cost if there is postop vaginal prolapse since 1 year ago? | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'postop vaginal prolapse')) AND DATETIME(cost.chargetime) >= DAT... | mimic_iii |
CREATE TABLE table_name_61 (
method VARCHAR,
opponent VARCHAR,
round VARCHAR,
res VARCHAR
) | What is the method of the match where there was a loss to Carlos Newton in round 1? | SELECT method FROM table_name_61 WHERE round = "1" AND res = "loss" AND opponent = "carlos newton" | sql_create_context |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | Create a bar chart showing capacity across name, and I want to show x axis in ascending order please. | SELECT Name, Capacity FROM cinema ORDER BY Name | nvbench |
CREATE TABLE table_name_84 (
score VARCHAR,
away_team VARCHAR
) | What was the score for the game when West Ham United was the away team? | SELECT score FROM table_name_84 WHERE away_team = "west ham united" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | how many patients were prescribed warfarin sodium 5 mg po tabs? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'warfarin sodium 5 mg po tabs') | eicu |
CREATE TABLE table_name_71 (
total INTEGER,
nation VARCHAR,
silver VARCHAR
) | what is the highest total when the nation is france and silver is more than 1? | SELECT MAX(total) FROM table_name_71 WHERE nation = "france" AND silver > 1 | sql_create_context |
CREATE TABLE table_name_84 (
surface VARCHAR,
championship VARCHAR
) | What surface was the Australian Open (1) played on? | SELECT surface FROM table_name_84 WHERE championship = "australian open (1)" | sql_create_context |
CREATE TABLE table_74745 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the largest crowd when the away team is Hawthorn? | SELECT MAX("Crowd") FROM table_74745 WHERE "Away team" = 'hawthorn' | wikisql |
CREATE TABLE table_171320_3 (
region_1 VARCHAR,
ep__number VARCHAR
) | Name the region 1 for episode number 13 | SELECT region_1 FROM table_171320_3 WHERE ep__number = 13 | sql_create_context |
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,
... | what are the five most common procedures given for patients who had previously been diagnosed with gi obstruction / ileus - small bowel obstruction during the same hospital encounter during this year? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'gi ob... | eicu |
CREATE TABLE table_name_51 (
poles VARCHAR,
points VARCHAR
) | What is the number of poles with 104 points? | SELECT poles FROM table_name_51 WHERE points = "104" | sql_create_context |
CREATE TABLE table_name_5 (
silver INTEGER,
total INTEGER
) | Name the average silver with total less than 1 | SELECT AVG(silver) FROM table_name_5 WHERE total < 1 | sql_create_context |
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,
... | what is the monthly average dose of p.o. that patient 008-30575 has taken since 12/08/2100? | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-30575')) AND intakeoutput.celllabel = 'p.o.'... | eicu |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | what is the number of unmarried patients who had po2 lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "pO2" | mimicsql_data |
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE election (
... | Find the number of the parties associated with the delegates from district 1 or 2. Who served as comptrollers of the parties? | SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller | nvbench |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Voters in moderator elections per year. | SELECT YEAR(b.Date) AS Election, COUNT(*) AS "number_of_voters" FROM Badges AS b WHERE b.Name = 'Constituent' GROUP BY YEAR(b.Date) ORDER BY YEAR(b.Date) | sede |
CREATE TABLE table_name_34 (
last_win VARCHAR,
last_final_lost VARCHAR
) | When was the last win for the club that had a final loss in 2011? | SELECT last_win FROM table_name_34 WHERE last_final_lost = "2011" | sql_create_context |
CREATE TABLE table_name_60 (
outcome VARCHAR,
opponents_in_the_final VARCHAR
) | Name the outcome for opponents of jonas bj rkman john mcenroe | SELECT outcome FROM table_name_60 WHERE opponents_in_the_final = "jonas björkman john mcenroe" | sql_create_context |
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 ... | Which upper level classes do not have 792 as a prerequisite ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours... | advising |
CREATE TABLE table_name_55 (
money___ INTEGER,
country VARCHAR,
player VARCHAR
) | What is the sum of Money of the game that was played in the United States with Sam Snead as a player? | SELECT SUM(money___) AS $__ FROM table_name_55 WHERE country = "united states" AND player = "sam snead" | sql_create_context |
CREATE TABLE table_1810 (
"Year" real,
"Lok Sabha" text,
"Members of Parliament" text,
"Party Won" text,
"Winners % votes" text,
"Trailing Party" text,
"Trailing Party % votes" text
) | When the trailing votes was 25.88% who was the trailing party? | SELECT "Members of Parliament" FROM table_1810 WHERE "Trailing Party % votes" = '25.88%' | wikisql |
CREATE TABLE table_name_61 (
name VARCHAR,
prize VARCHAR
) | Which event had a prize of $2,434,061? | SELECT name FROM table_name_61 WHERE prize = "$2,434,061" | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name tex... | Questions needing attention to avoid Roomba carnage - only me. | SELECT Posts.Title, Posts.CreationDate, Posts.OwnerUserId, Users.DisplayName, ViewCount, Posts.Id AS "post_link", Tags FROM Posts, Users WHERE Users.Id = Posts.OwnerUserId AND Posts.PostTypeId = 1 AND Users.DisplayName = 'Franck Dernoncourt' ORDER BY Posts.CreationDate | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.