context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE journal (
homepage varchar,
jid int,
name varchar
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation... | return me the authors who have more than 10 papers in the VLDB conference . | SELECT author.name FROM author, conference, publication, writes WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid GROUP BY author.name HAVING COUNT(DISTINCT (publication.title)) > 10 | academic |
CREATE TABLE table_80150 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Language(s)" text,
"Result" text
) | What was the title used for Rosie, the film nominated for the dutch language? | SELECT "Film title used in nomination" FROM table_80150 WHERE "Language(s)" = 'dutch' AND "Original title" = 'rosie' | wikisql |
CREATE TABLE users (
user_id number,
role_code text,
user_name text,
user_login text,
password text
)
CREATE TABLE functional_areas (
functional_area_code text,
parent_functional_area_code text,
functional_area_description text
)
CREATE TABLE document_structures (
document_structur... | Find names of the document without any images. | SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id | spider |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayNa... | thank you for your answer comments... on questions?. | SELECT c.Id AS "comment_link" FROM Comments AS c INNER JOIN Posts AS p ON p.Id = c.PostId INNER JOIN Posts AS q ON q.Id = p.ParentId WHERE Text LIKE '%welcome%' AND c.CreationDate > '01.01.2020' | sede |
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... | what does it cost to get hemorrhage - postpartum diagnosed? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'hemorrhage - postpartum') | eicu |
CREATE TABLE table_14345690_2 (
entered VARCHAR,
celebrity VARCHAR
) | When did Darren Day enter? | SELECT entered FROM table_14345690_2 WHERE celebrity = "Darren Day" | sql_create_context |
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 jyjgzbb (
BGDH text,
BGRQ tim... | 在01年10月19日到16年8月22日这段时间,患者13818309一共有多少检验报告单,把这些检验报告单的审核日期列出来 | SELECT zyjybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '13818309' AND zyjybgb.BGRQ BETWEEN '2001-10-19' AND '2016-08... | css |
CREATE TABLE table_204_535 (
id number,
"pos" text,
"rider" text,
"manufacturer" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | which rider is on top in points | SELECT "rider" FROM table_204_535 ORDER BY "points" DESC LIMIT 1 | squall |
CREATE TABLE table_name_83 (
runner_up VARCHAR,
country VARCHAR,
venue VARCHAR
) | What player from England was the runner-up at the match played at the Royal Porthcawl Golf Club? | SELECT runner_up FROM table_name_83 WHERE country = "england" AND venue = "royal porthcawl golf club" | sql_create_context |
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... | what is average age of patients whose marital status is single and ethnicity is asian? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "ASIAN" | mimicsql_data |
CREATE TABLE table_name_82 (
champion VARCHAR,
score VARCHAR
) | What Champion had a Score of 9 1? | SELECT champion FROM table_name_82 WHERE score = "9–1" | sql_create_context |
CREATE TABLE table_name_91 (
date VARCHAR,
home_team VARCHAR
) | When did St Kilda play a home game? | SELECT date FROM table_name_91 WHERE home_team = "st kilda" | sql_create_context |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | Bar chart x axis nationality y axis sum meter 100 | SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality | nvbench |
CREATE TABLE table_name_37 (
position VARCHAR,
school VARCHAR
) | what is the position for the player from university of alabama? | SELECT position FROM table_name_37 WHERE school = "university of alabama" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dis... | what were the three most common drugs that were prescribed to the female patients in their 40s in the same month after they had been diagnosed with food/vomit pneumonitis until 3 years ago? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ... | mimic_iii |
CREATE TABLE table_18535 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | who athe party where district is louisiana 2? | SELECT "Party" FROM table_18535 WHERE "District" = 'Louisiana 2' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
dep... | In which programs is RESTORA 744 a requirement ? | SELECT DISTINCT program.name FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN program ON program.program_id = program_course.program_id WHERE course.department = 'RESTORA' AND course.number = 744 | advising |
CREATE TABLE table_name_26 (
points INTEGER,
visitor VARCHAR,
attendance VARCHAR
) | What is the sum of the points of the game with philadelphia as the visitor and an attendance greater than 7,284? | SELECT SUM(points) FROM table_name_26 WHERE visitor = "philadelphia" AND attendance > 7 OFFSET 284 | sql_create_context |
CREATE TABLE table_10360823_1 (
position VARCHAR,
overall VARCHAR
) | What position is played by pick 255 overall? | SELECT position FROM table_10360823_1 WHERE overall = 255 | sql_create_context |
CREATE TABLE table_45405 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | Where is the location with a record of 50-19? | SELECT "Location" FROM table_45405 WHERE "Record" = '50-19' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
... | 病人个人账户支出在医疗就诊43940600298里面占医疗费总额的比例是多少? | SELECT (SELECT t_kc24.PER_ACC_PAY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '43940600298') / (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID = '4394060029... | css |
CREATE TABLE table_58872 (
"DSL Type" text,
"Provider" text,
"Resale" text,
"Down (up to kbit/s)" real,
"Up (up to kbit/s)" real
) | What is the average down (up to kbit/s) when the provider is willy.tel and the up (kbit/s) is more than 1984? | SELECT AVG("Down (up to kbit/s)") FROM table_58872 WHERE "Provider" = 'willy.tel' AND "Up (up to kbit/s)" > '1984' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Find Team_Name and All_Games_Percent , and visualize them by a bar chart, display by the x axis in asc. | SELECT Team_Name, All_Games_Percent FROM basketball_match ORDER BY Team_Name | nvbench |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate tim... | Pulling all data from Posts Table. | SELECT * FROM Posts INNER JOIN Users ON Posts.Id = Users.Id | sede |
CREATE TABLE table_1888051_1 (
area__km²_ VARCHAR,
capital VARCHAR
) | Nagua has the area (km ) of? | SELECT area__km²_ FROM table_1888051_1 WHERE capital = "Nagua" | sql_create_context |
CREATE TABLE table_55536 (
"Team 1" real,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What's the lowest team 1 number that had asolo fonte (veneto b) as the Agg.? | SELECT MIN("Team 1") FROM table_55536 WHERE "Agg." = 'asolo fonte (veneto b)' | wikisql |
CREATE TABLE table_52651 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the home team score at Richmond's away game against Footscray? | SELECT "Home team score" FROM table_52651 WHERE "Away team" = 'richmond' | wikisql |
CREATE TABLE table_7252 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | What is the name of the Original artist when the week # is top 16 (8 men)? | SELECT "Original artist" FROM table_7252 WHERE "Week #" = 'top 16 (8 men)' | wikisql |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description v... | What teacher instructs the easiest MDE course ? | SELECT DISTINCT instructor.name, program_course.workload FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = cour... | advising |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 门诊诊断为口齿病(龋齿病)的病患的检测指标396011数值的平均值和最值具体均是? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '口齿病(龋齿病)' AND jyjgzbb.JCZBDM = '396011' | css |
CREATE TABLE table_75068 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average Gold when the rank is less than 3 and the bronze is less than 1? | SELECT AVG("Gold") FROM table_75068 WHERE "Rank" < '3' AND "Bronze" < '1' | wikisql |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE com... | Which teacher is doing ULCS classes next Winter ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_204_179 (
id number,
"season" number,
"division" number,
"tms." number,
"pos." number,
"fa cup" text,
"afc cl" number
) | how long was the round for season 2010 | SELECT "fa cup" FROM table_204_179 WHERE "season" = 2010 | squall |
CREATE TABLE table_name_2 (
winning_amount VARCHAR,
date_premiered__2009_ VARCHAR
) | What is the winning amount that has May 30, 2009 as the date premiered? | SELECT winning_amount FROM table_name_2 WHERE date_premiered__2009_ = "may 30" | sql_create_context |
CREATE TABLE table_27132791_3 (
position VARCHAR,
pro_team VARCHAR
) | If the proteam is Jacksonville bulls, what is the position? | SELECT position FROM table_27132791_3 WHERE pro_team = "Jacksonville Bulls" | sql_create_context |
CREATE TABLE table_204_558 (
id number,
"name" text,
"location" text,
"city" text,
"listing date" text
) | fort gratiot lighthouse and fort st. joseph are located in what city ? | SELECT "city" FROM table_204_558 WHERE "name" = 'fort gratiot lighthouse' | squall |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the average of manufacturer , and group by attribute name. | SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE table_35861 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | Name the total number of top 10 with top 25 less than 2 and top 5 more than 0 | SELECT COUNT("Top-10") FROM table_35861 WHERE "Top-25" < '2' AND "Top-5" > '0' | wikisql |
CREATE TABLE table_34000 (
"Rank" text,
"Runs" text,
"Player" text,
"Opponent" text,
"Venue" text,
"Season" text
) | Where was the venue that had 274 runs? | SELECT "Venue" FROM table_34000 WHERE "Runs" = '274' | wikisql |
CREATE TABLE table_42690 (
"Spoofed Title" text,
"Writer" text,
"Artist" text,
"Issue" real,
"Date" text
) | What is the earliest issue Arnie Kogen wrote for in December 1964? | SELECT MIN("Issue") FROM table_42690 WHERE "Writer" = 'arnie kogen' AND "Date" = 'december 1964' | wikisql |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city... | How many faculty members participate in each activity? Return the activity names and the number of faculty members by a bar chart, rank by the activity_name in ascending. | SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY activity_name | nvbench |
CREATE TABLE table_55512 (
"Pick" real,
"Round" real,
"Player" text,
"Position" text,
"School" text
) | When the school picking is utah state for the position of linebacker, what's the sum of those rounds? | SELECT SUM("Round") FROM table_55512 WHERE "Position" = 'linebacker' AND "School" = 'utah state' | wikisql |
CREATE TABLE table_21091145_1 (
opponent VARCHAR,
black_knights_points VARCHAR
) | Name the opponent for black knights points 27 | SELECT opponent FROM table_21091145_1 WHERE black_knights_points = 27 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,... | what was the total quantity of output that patient 007-1517 had until 03/09/2104? | SELECT SUM(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 = '007-1517')) AND intakeoutput.cellpath LIKE '%out... | eicu |
CREATE TABLE table_73513 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | If the record is 5-5, what is the game maximum? | SELECT MAX("Game") FROM table_73513 WHERE "Record" = '5-5' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | Give the number of patients whose diagnosis icd9 code is 2930 and lab test category chemistry. | 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.icd9_code = "2930" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE table_name_38 (
area_km_2 VARCHAR,
official_name VARCHAR
) | How large, in square kilometers, is Sackville? | SELECT area_km_2 FROM table_name_38 WHERE official_name = "sackville" | sql_create_context |
CREATE TABLE table_1982739_2 (
area VARCHAR,
english_name VARCHAR
) | What is the total number of areas that are called Nanqiao District? | SELECT COUNT(area) FROM table_1982739_2 WHERE english_name = "Nanqiao District" | 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... | 病患凤慧捷有过多少次检查是在03年3月14日到17年6月9日之间做的? | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '凤慧捷' AND t_kc22.STA_DATE BETWEEN '2003-03-14' AND '2017-06-09' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_10528691_4 (
print_resolution__dpi__resolution_is_given_in_dots_per_inch__dpi_ VARCHAR,
introduction VARCHAR
) | What is the print resolution (FPI) for December 2002? | SELECT print_resolution__dpi__resolution_is_given_in_dots_per_inch__dpi_ FROM table_10528691_4 WHERE introduction = "December 2002" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subje... | when was the first time patient 17505 was measured heart rate less than 76.0 until 1426 days ago? | SELECT chartevents.charttime 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 = 17505)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra... | mimic_iii |
CREATE TABLE table_name_11 (
venue VARCHAR,
year VARCHAR,
position VARCHAR
) | WHich Venue has a Year larger than 2003, and a Position of 10th? | SELECT venue FROM table_name_11 WHERE year > 2003 AND position = "10th" | sql_create_context |
CREATE TABLE roller_coaster (
roller_coaster_id number,
name text,
park text,
country_id number,
length number,
height number,
speed text,
opened text,
status text
)
CREATE TABLE country (
country_id number,
name text,
population number,
area number,
languages te... | What are the country names, area and population which has both roller coasters with speed higher | SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.country_id = T2.country_id WHERE T2.speed > 60 INTERSECT SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.country_id = T2.country_id WHERE T2.speed < 55 | spider |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients were given the drug ferrous gluconate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Ferrous Gluconate" | mimicsql_data |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | show me round trip flights from MONTREAL to ORLANDO | 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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id ... | atis |
CREATE TABLE table_name_98 (
position VARCHAR,
player VARCHAR
) | What position does Michael Ruffin play? | SELECT position FROM table_name_98 WHERE player = "michael ruffin" | sql_create_context |
CREATE TABLE table_name_14 (
board__cm_ VARCHAR,
release VARCHAR,
start VARCHAR,
type VARCHAR
) | What is the dimensions in centimeters of a theater board who started in 1940, who was released after 2010? | SELECT board__cm_ FROM table_name_14 WHERE start = "1940" AND type = "theater" AND release > 2010 | sql_create_context |
CREATE TABLE table_19886 (
"Series Ep." text,
"Episode" real,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | Name the segment b for pressure cookers | SELECT "Segment B" FROM table_19886 WHERE "Segment A" = 'Pressure Cookers' | wikisql |
CREATE TABLE table_61616 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What 2008 has A as the 2007, and 2r as the 2010? | SELECT "2008" FROM table_61616 WHERE "2007" = 'a' AND "2010" = '2r' | wikisql |
CREATE TABLE table_69075 (
"Episode No." real,
"Airdate" text,
"Total Viewers" real,
"Share" text,
"BBC One Weekly Ranking" real
) | What was the total viewership for BBC One weekly rankings larger than 7, before episode 4? | SELECT "Total Viewers" FROM table_69075 WHERE "BBC One Weekly Ranking" > '7' AND "Episode No." < '4' | 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 discharge location is left against medical advi and diagnoses short title is other pulmonary insuff? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND diagnoses.short_title = "Other pulmonary insuff" | mimicsql_data |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress ... | Count badges gold, silver, bronze. | SELECT (SELECT COUNT(*) FROM Badges WHERE Class = 3) AS Bronze, (SELECT COUNT(*) FROM Badges WHERE Class = 2) AS Silver, (SELECT COUNT(*) FROM Badges WHERE Class = 1) AS Gold | sede |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate ti... | Month history of completed review tasks by type. | WITH Raw AS (SELECT ReviewTasks.Id, DATEFROMPARTS(TIME_TO_STR(ReviewTasks.CreationDate, '%Y'), TIME_TO_STR(ReviewTasks.CreationDate, '%M'), 1) AS Month, ReviewTaskTypes.Name AS ReviewType FROM ReviewTasks, ReviewTaskTypes WHERE ReviewTasks.ReviewTaskTypeId = ReviewTaskTypes.Id AND ReviewTasks.ReviewTaskStateId = 2) SEL... | sede |
CREATE TABLE table_1359212_2 (
winner VARCHAR,
second_place VARCHAR
) | where is hte second place winner from united kingdom? | SELECT winner FROM table_1359212_2 WHERE second_place = "United Kingdom" | sql_create_context |
CREATE TABLE table_43947 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Which Round has a College of arizona? | SELECT MIN("Round") FROM table_43947 WHERE "College" = 'arizona' | wikisql |
CREATE TABLE table_5843 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Which Opponent has an Attendance of 24,791? | SELECT "Opponent" FROM table_5843 WHERE "Attendance" = '24,791' | 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... | had patient 32153 received in the current hospital encounter a diagnosis of renal & ureteral dis nos? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'renal & ureteral dis nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32153 AND admissions.dischti... | mimic_iii |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | what is minimum age of patients whose ethnicity is asian and days of hospital stay is 26? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.days_stay = "26" | mimicsql_data |
CREATE TABLE table_34422 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | What home team has june 22 as the date? | SELECT "Home Team" FROM table_34422 WHERE "Date" = 'june 22' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | how many times until 12/13/2105 has patient 002-4486 produced output (ml)-[removed] straight catheter output. | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-4486')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.cel... | eicu |
CREATE TABLE table_66368 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" real,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
) | Who had fa cup goals of 0, league cup goals less than 2, and total goals of 2? | SELECT "Name" FROM table_66368 WHERE "FA Cup Goals" = '0' AND "League Cup Goals" < '2' AND "Total Goals" = '2' | wikisql |
CREATE TABLE table_75995 (
"Season" text,
"Coach" text,
"Overall" text,
"Conference" text,
"Big Ten" text,
"National" text
) | What is the Coach with a Big Ten that is 2nd (79)? | SELECT "Coach" FROM table_75995 WHERE "Big Ten" = '2nd (79)' | wikisql |
CREATE TABLE table_train_17 (
"id" int,
"severe_sepsis" bool,
"mean_arterial_pressure_map" int,
"peripheral_vascular_disease" bool,
"septic_shock" bool,
"age" float,
"NOUSE" float
) | severe peripheral vascular disease | SELECT * FROM table_train_17 WHERE peripheral_vascular_disease = 1 | criteria2sql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | what are the four most frequent medications that were prescribed within 2 months to patients aged 30s after having been diagnosed with fever, in 2105? | 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 = 'fever' AND STRFTIME('%y', diagnosis.diagnosistime)... | eicu |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | Get users according to specific criteria 1. | SELECT a.OwnerUserId AS "Uid", COUNT(*) AS Acceptedanswers, 15 * (COUNT(*)) AS "points", TIME_TO_STR(a.CreationDate, 'WEEK') AS "week" FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE a.OwnerUserId IN (SELECT Id FROM Users AS u WHERE u.Reputation > @reputation_from AND u.Reputation < @reputation... | sede |
CREATE TABLE table_23308178_4 (
date VARCHAR,
opponent VARCHAR
) | What date did they play agains the New York Rangers? | SELECT date FROM table_23308178_4 WHERE opponent = "New York Rangers" | sql_create_context |
CREATE TABLE course (
crs_description VARCHAR,
crs_code VARCHAR
)
CREATE TABLE department (
dept_name VARCHAR,
dept_code VARCHAR
)
CREATE TABLE employee (
emp_fname VARCHAR,
emp_num VARCHAR
)
CREATE TABLE CLASS (
prof_num VARCHAR,
crs_code VARCHAR
)
CREATE TABLE professor (
prof_... | Find the first names and offices of all instructors who have taught some course and the course description and the department name. | SELECT T2.emp_fname, T4.prof_office, T3.crs_description, T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code | sql_create_context |
CREATE TABLE apartment_buildings (
building_id number,
building_short_name text,
building_full_name text,
building_description text,
building_address text,
building_manager text,
building_phone text
)
CREATE TABLE apartments (
apt_id number,
building_id number,
apt_type_code tex... | What are the start date and end date of the apartment bookings made by female guests (gender code 'Female')? | SELECT T1.booking_start_date, T1.booking_start_date FROM apartment_bookings AS T1 JOIN guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" | spider |
CREATE TABLE table_name_44 (
rank INTEGER,
player VARCHAR,
matches VARCHAR
) | What is the highest rank for championships with christy heffernan with over 4 matches? | SELECT MAX(rank) FROM table_name_44 WHERE player = "christy heffernan" AND matches > 4 | sql_create_context |
CREATE TABLE table_name_70 (
Id VARCHAR
) | What is the 2007 when the 2010 is 3r? | SELECT 2007 FROM table_name_70 WHERE 2010 = "3r" | 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... | find the minimum age of patients with death status 0 and admission year in or before 2123. | SELECT MIN(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admityear >= "2123" | mimicsql_data |
CREATE TABLE table_name_50 (
candidate VARCHAR,
election VARCHAR
) | Who is the candidate in the 2012 election? | SELECT candidate FROM table_name_50 WHERE election = "2012" | sql_create_context |
CREATE TABLE table_203_366 (
id number,
"pos" number,
"class" text,
"no" number,
"team" text,
"drivers" text,
"chassis" text,
"engine" text,
"laps" number
) | how many teams completed 200 laps but did n't complete 220 laps ? | SELECT COUNT("team") FROM table_203_366 WHERE "laps" >= 200 AND "laps" < 220 | squall |
CREATE TABLE table_69731 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What was the Surface for the Partner of J rgen Melzer, and a Date of July 16, 2011? | SELECT "Surface" FROM table_69731 WHERE "Partner" = 'jürgen melzer' AND "Date" = 'july 16, 2011' | wikisql |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | how many times has a d & c nec been performed? | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'd & c nec') | mimic_iii |
CREATE TABLE table_name_67 (
team VARCHAR,
season VARCHAR
) | What team has 2000-01 as the season? | SELECT team FROM table_name_67 WHERE season = "2000-01" | sql_create_context |
CREATE TABLE table_6114 (
"Name" text,
"Birth" text,
"Marriage" text,
"Became Queen" text,
"Ceased to be Queen" text,
"Death" text,
"Spouse" text
) | Who was born on 10 May 1788 that ceased to be queen? | SELECT "Ceased to be Queen" FROM table_6114 WHERE "Birth" = '10 may 1788' | wikisql |
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Desc... | Show me a bar chart for what are the different budget type codes, and how many documents are there for each? | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code | nvbench |
CREATE TABLE table_204_952 (
id number,
"rank" number,
"player" text,
"county" text,
"tally" text,
"total" number,
"opposition" text
) | how many people are on the list ? | SELECT COUNT(DISTINCT "player") FROM table_204_952 | squall |
CREATE TABLE table_1673 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | what is the high rebounds stat on april 11 | SELECT "High rebounds" FROM table_1673 WHERE "Date" = 'April 11' | wikisql |
CREATE TABLE table_41560 (
"City of license" text,
"Identifier" text,
"Frequency" text,
"Power" text,
"Class" text,
"RECNet" text
) | What frequency has temagami as the city of license? | SELECT "Frequency" FROM table_41560 WHERE "City of license" = 'temagami' | wikisql |
CREATE TABLE table_name_63 (
race VARCHAR
) | Who won the South African Grand Prix? | SELECT race AS Winner FROM table_name_63 WHERE race = "south african grand prix" | sql_create_context |
CREATE TABLE table_1360997_2 (
result VARCHAR,
venue VARCHAR
) | Was the rosehill venue a win or loss? | SELECT result FROM table_1360997_2 WHERE venue = "Rosehill" | sql_create_context |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 患者彭云亭的检验报告结果指标均异常的检验报告单号是什么 | (SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '彭云亭' AND NOT... | css |
CREATE TABLE table_71961 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many Totals have a Silver smaller than 2, and a Nation of ukraine, and a Gold smaller than 3? | SELECT COUNT("Total") FROM table_71961 WHERE "Silver" < '2' AND "Nation" = 'ukraine' AND "Gold" < '3' | wikisql |
CREATE TABLE table_59171 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What player has a To Par of +1 with a score of 71-67-73=211? | SELECT "Player" FROM table_59171 WHERE "To par" = '+1' AND "Score" = '71-67-73=211' | wikisql |
CREATE TABLE table_25840 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the highest points during the game with a record of 2-7? | SELECT "High points" FROM table_25840 WHERE "Record" = '2-7' | wikisql |
CREATE TABLE table_52265 (
"model" text,
"cylinders/ valves" text,
"displacement cc" real,
"max. power kW (PS) at rpm" text,
"max. torque (Nm) at rpm" text,
"engine code" text,
"top speed (km/h)" real,
"production period" text
) | What is the top speed of the model 1.8 20v t? | SELECT SUM("top speed (km/h)") FROM table_52265 WHERE "model" = '1.8 20v t' | wikisql |
CREATE TABLE table_204_379 (
id number,
"year" text,
"title" text,
"hangul" text,
"network" text,
"further info" text
) | what show was he in before running man | SELECT "title" FROM table_204_379 WHERE id = (SELECT id FROM table_204_379 WHERE "title" = 'running man') - 1 | squall |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Tags which never occur alone. | SELECT t.TagName FROM Tags AS t WHERE t.Id NOT IN (SELECT p2.TagId FROM PostTags AS p2 WHERE p2.PostId IN (SELECT p1.PostId FROM PostTags AS p1 GROUP BY p1.PostId HAVING COUNT(TagId) = 1)) ORDER BY t.TagName | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.