context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | 在2007年12月2日到2008年6月25日这段时间,罗列出患者号码83925055所有检验报告单中的标本收集部位是那一部分? | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '83925055' AND jybgb.BGRQ BETWEEN '2007-12-02' AND '2008-06-25' UNI... | css |
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_season (
Season re... | What are the draft pick numbers and draft classes for players who play the Defender position Show bar chart, and could you order x-axis in descending order? | SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Class DESC | nvbench |
CREATE TABLE table_20693870_1 (
others_number INTEGER,
county VARCHAR
) | What was the number of others votes in Columbia county? | SELECT MIN(others_number) FROM table_20693870_1 WHERE county = "Columbia" | sql_create_context |
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
... | A bar chart for showing the number of the facility codes of apartments with more than 4 bedrooms, and I want to display in ascending by the facility_code. | SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY facility_code | nvbench |
CREATE TABLE table_14175 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
) | What event was the competition World Junior Championships in 2010? | SELECT "Event" FROM table_14175 WHERE "Competition" = 'world junior championships' AND "Year" = '2010' | wikisql |
CREATE TABLE table_61838 (
"Air Date" text,
"Rating" text,
"18-49" text,
"Viewers" text,
"Weekly Winner" text
) | What is Viewers, when 18-49 is 'N/A', and when Weekly Winner is 'Wedding DJ Chris Dixon'? | SELECT "Viewers" FROM table_61838 WHERE "18-49" = 'n/a' AND "Weekly Winner" = 'wedding dj chris dixon' | wikisql |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year... | Find the number of courses offered by Psychology department in each year with a line chart. | SELECT year, COUNT(year) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' GROUP BY year | nvbench |
CREATE TABLE table_17355408_5 (
high_points VARCHAR,
location_attendance VARCHAR
) | Name the high points for pepsi center 18,611 | SELECT high_points FROM table_17355408_5 WHERE location_attendance = "Pepsi Center 18,611" | sql_create_context |
CREATE TABLE table_14460937_1 (
afc_cup VARCHAR,
points__total_500_ VARCHAR
) | How many times has the points total for the afc cup competion been 289? | SELECT COUNT(afc_cup) FROM table_14460937_1 WHERE points__total_500_ = 289 | sql_create_context |
CREATE TABLE table_74297 (
"Period ended" text,
"Turnover (\u00a3m)" text,
"Profit before tax (\u00a3m)" text,
"Dividend per share (p)" text,
"Adjusted earnings per share diluted (p)" text
) | How many items appear in the dividend per share when the turnover is 0.42? | SELECT COUNT("Dividend per share (p)") FROM table_74297 WHERE "Turnover (\u00a3m)" = '0.42' | wikisql |
CREATE TABLE table_21484 (
"Year" real,
"West Manila" text,
"East Manila" text,
"Consumer Price Index (2005=100)" text,
"West Manila as a share of 1996 real tariff" text,
"East Manila as a share of 1996 real tariff" text
) | What was the CPI of West Manila when its share of 1996 real tariff is 189%? | SELECT "Consumer Price Index (2005=100)" FROM table_21484 WHERE "West Manila as a share of 1996 real tariff" = '189%' | wikisql |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 找出患者吴鹏天去3862887这家医院看门诊诊断结果不含有缺血的看病记录 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '吴鹏天' AND hz_info.YLJGDM = '3862887' AND NOT mzjzjlb.JZZDSM LIKE '%缺血%' | css |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 在2001年9月2日到2009年7月11日期间,为患者43339704检测指标557689的医务人员工号及姓名分别是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE jyjgzbb.JYRQ BETWEEN '2001-09-02' AND '2009-07-1... | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | provide the number of patients whose admission location is trsf within this facility and drug name is prismasate (b22 k4)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND prescriptions.drug = "Prismasate (B22 K4)" | mimicsql_data |
CREATE TABLE table_70626 (
"Position" text,
"Name" text,
"Height" text,
"Weight (lbs.)" real,
"Hometown" text,
"Draft Year" real,
"Pick" text,
"All-Stars" text,
"NBA Championships" text,
"NBA Team" text
) | who is the NBA team for the draft year after 2003 with a height of 6'10' and home town of st. charles, mo? | SELECT "NBA Team" FROM table_70626 WHERE "Draft Year" > '2003' AND "Height" = '6''10' AND "Hometown" = 'st. charles, mo' | wikisql |
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 frequently ordered lab tests for patients who have been diagnosed with cerebral subdural hematoma - secondary to trauma earlier until 2101 during the same hospital visit? | SELECT t3.labname FROM (SELECT t2.labname, 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 = 'cerebral subdural... | eicu |
CREATE TABLE table_204_718 (
id number,
"date" text,
"opponent" text,
"time" text,
"score" text,
"record" text
) | what is the number of opponents that play at 4pm ? | SELECT COUNT("opponent") FROM table_204_718 WHERE "time" = '4 p.m' | squall |
CREATE TABLE table_66575 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
) | What is reserved for the constituency of 228? | SELECT "Reserved for ( SC / ST /None)" FROM table_66575 WHERE "Constituency number" = '228' | wikisql |
CREATE TABLE table_46723 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the date of game 75? | SELECT "Date" FROM table_46723 WHERE "Game" = '75' | wikisql |
CREATE TABLE Reservations (
kids VARCHAR,
FirstName VARCHAR,
LastName VARCHAR
) | How many kids stay in the rooms reserved by ROY SWEAZY? | SELECT kids FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY" | sql_create_context |
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, draw a bar chart about the distribution of name and the amount of name , and group by attribute name, could you show x axis in desc order? | SELECT T2.Name, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC | nvbench |
CREATE TABLE table_name_20 (
date VARCHAR,
home VARCHAR
) | When was the home game for the NY Islanders? | SELECT date FROM table_name_20 WHERE home = "ny islanders" | sql_create_context |
CREATE TABLE table_18299 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What district is Ray Musto the incumbent of? | SELECT "District" FROM table_18299 WHERE "Incumbent" = 'Ray Musto' | wikisql |
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min numeric(2)
)
CREATE TABLE instruc... | List the number of courses in year 2008 for each instructor in a bar chart, and list name in asc order. | SELECT name, COUNT(name) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY name ORDER BY name | nvbench |
CREATE TABLE table_name_2 (
wins INTEGER,
year VARCHAR
) | What is the sum of Wins, when Year is 1959? | SELECT SUM(wins) FROM table_name_2 WHERE year = 1959 | sql_create_context |
CREATE TABLE table_16795 (
"Ward" text,
"Bello" text,
"Ben-Tahir" text,
"Doucet" text,
"Furtenbacher" text,
"Gauthier" text,
"Haydon" text,
"Larter" text,
"Lawrance" text,
"Libweshya" text,
"Liscumb" text
) | What is Liscumb when Haydon is 1632? | SELECT "Liscumb" FROM table_16795 WHERE "Haydon" = '1632' | wikisql |
CREATE TABLE table_name_23 (
opponent VARCHAR,
date VARCHAR
) | Who is the opponent on June 6? | SELECT opponent FROM table_name_23 WHERE date = "june 6" | sql_create_context |
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, find headquarter and the sum of price , and group by attribute headquarter, and visualize them by a bar chart, and show by the y-axis in ascending please. | SELECT Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Price) | nvbench |
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 lab (
labid numbe... | what is the minimum yearly number of patients who suffer from stroke? | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'stroke' GROUP BY STRFTIME('%y', diagnosis.diagnosistime)) AS t1 | eicu |
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... | 在06-12-21到15-08-04的就诊结算日期内,把患者褚力言所有医疗就诊记录的编号给列出来 | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '褚力言' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-12-21' AND '2015-08-04' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PER... | css |
CREATE TABLE table_name_10 (
attendance VARCHAR,
away_team VARCHAR
) | What was the attendance for the away team Solihull Moors? | SELECT attendance FROM table_name_10 WHERE away_team = "solihull moors" | sql_create_context |
CREATE TABLE table_name_70 (
undecided VARCHAR,
others VARCHAR
) | What is the Undecided the others was 4%? | SELECT undecided FROM table_name_70 WHERE others = "4%" | sql_create_context |
CREATE TABLE table_50488 (
"Position" real,
"Equipment" text,
"Points" real,
"Wins" text,
"Second" text,
"Third" text
) | What is the sum of Points, when Equipment was 'Zabel-BSU', and when Position was 42? | SELECT SUM("Points") FROM table_50488 WHERE "Equipment" = 'zabel-bsu' AND "Position" = '42' | wikisql |
CREATE TABLE table_28197 (
"Name of Award" text,
"Name of Film" text,
"Language" text,
"Awardee(s)" text,
"Cash Prize" text
) | How many films were in hindi? | SELECT COUNT("Name of Film") FROM table_28197 WHERE "Language" = 'Hindi' | wikisql |
CREATE TABLE Performers_in_Bookings (
Order_ID INTEGER,
Performer_ID INTEGER
)
CREATE TABLE Marketing_Regions (
Marketing_Region_Code CHAR(15),
Marketing_Region_Name VARCHAR(255),
Marketing_Region_Descriptrion VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Order_Items (
Order_Item... | How many drama workshop groups are there in each city? Return both the city and the count Plot them as bar chart, and show in asc by the the total number . | SELECT City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_52827 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What Player is from the Southern Illinois team? | SELECT "Player" FROM table_52827 WHERE "School/Club Team" = 'southern illinois' | wikisql |
CREATE TABLE table_30339 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Incoming manager" text,
"Date of appointment" text
) | when was the next coach appointed after niger tornadoes fired their coach? | SELECT "Date of appointment" FROM table_30339 WHERE "Manner of departure" = 'fired' AND "Team" = 'Niger Tornadoes' | wikisql |
CREATE TABLE table_31232 (
"Seed" real,
"Rank" real,
"Player" text,
"Points" real,
"Points defending" real,
"Points won" real,
"New points" real,
"Status" text
) | What is the status when the rank is 2? | SELECT "Status" FROM table_31232 WHERE "Rank" = '2' | wikisql |
CREATE TABLE table_24672 (
"State Rank by Revenue" real,
"Company Name" text,
"National Rank" real,
"Revenue ($billions) 2012 estimate" text,
"Headquarters City" text,
"Known for" text
) | What is the rank for Murphy Oil? | SELECT "State Rank by Revenue" FROM table_24672 WHERE "Company Name" = 'Murphy Oil' | wikisql |
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
) | Draw a bar chart for what are the names and average prices of products for manufacturers whose products cost on average 150 or more?, display by the names from low to high. | SELECT T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name | nvbench |
CREATE TABLE table_204_402 (
id number,
"rank" number,
"player" text,
"from" text,
"to" text,
"transfer fee\n(\u20ac million)" number,
"year" number
) | what is the average total of the transfer fee in million ? | SELECT AVG("transfer fee\n(\u20ac million)") FROM table_204_402 | squall |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_... | i want the flights from DENVER to PITTSBURGH | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU... | atis |
CREATE TABLE table_name_93 (
total INTEGER,
player VARCHAR
) | What is Wayne Grady's total? | SELECT SUM(total) FROM table_name_93 WHERE player = "wayne grady" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | provide the number of patients whose admission year is less than 2166 and item id is 50885? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2166" AND lab.itemid = "50885" | mimicsql_data |
CREATE TABLE table_name_76 (
league_cup_goals VARCHAR,
total_apps VARCHAR,
total_goals VARCHAR
) | How many League Cup Goals have Total Apps of 36, and Total Goals smaller than 1? | SELECT COUNT(league_cup_goals) FROM table_name_76 WHERE total_apps = "36" AND total_goals < 1 | sql_create_context |
CREATE TABLE table_16388230_1 (
ground VARCHAR,
away_team VARCHAR
) | The away team of Richmond played on what grounds? | SELECT ground FROM table_16388230_1 WHERE away_team = "Richmond" | sql_create_context |
CREATE TABLE table_26321719_1 (
population__2011_ VARCHAR,
name VARCHAR
) | What is the population in 2011 for the name Beaubassin East? | SELECT population__2011_ FROM table_26321719_1 WHERE name = "Beaubassin East" | sql_create_context |
CREATE TABLE table_71683 (
"Year" text,
"League" text,
"Position" real,
"Goals +/-" real,
"Points" real
) | What is the average position of Eesti P levkivi J hvi when they had less than 13 points and worse than a -12 goal differential? | SELECT AVG("Position") FROM table_71683 WHERE "Points" < '13' AND "Goals +/-" > '-12' | wikisql |
CREATE TABLE table_4405 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What was the result when there were less than 3 rounds against Gil Rael? | SELECT "Res." FROM table_4405 WHERE "Round" < '3' AND "Opponent" = 'gil rael' | wikisql |
CREATE TABLE table_1953516_1 (
winning_span VARCHAR,
rank VARCHAR
) | What is the winning span with the rank of 5? | SELECT winning_span FROM table_1953516_1 WHERE rank = "5" | sql_create_context |
CREATE TABLE table_16152 (
"Country" text,
"Membership (from 2010)" real,
"Name of member organization" text,
"Year current Scouting organization joined WOSM" text,
"Year member organization was founded" text,
"Admits boys/girls" text
) | Which organizations were founded in 1972, but became WOSM members until 1977? | SELECT "Name of member organization" FROM table_16152 WHERE "Year member organization was founded" = '1972' AND "Year current Scouting organization joined WOSM" = '1977' | wikisql |
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 allergy (
allergy... | tell me the difference in systemicdiastolic levels of patient 029-26705 last measured on the first intensive care unit visit compared to the value first measured on the first intensive care unit visit? | SELECT (SELECT vitalperiodic.systemicdiastolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-26705') AND NOT patient.unitdischarge... | eicu |
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 vitalperiodi... | when has patient 031-24513 first been given a microbiology test until 09/2104? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= ... | eicu |
CREATE TABLE Appointment (
AppointmentID INTEGER,
Patient INTEGER,
PrepNurse INTEGER,
Physician INTEGER,
Start DATETIME,
End DATETIME,
ExaminationRoom TEXT
)
CREATE TABLE Stay (
StayID INTEGER,
Patient INTEGER,
Room INTEGER,
StayStart DATETIME,
StayEnd DATETIME
)
CREATE... | Display a bar chart for how many medications are prescribed for each brand?, display from low to high by the x-axis please. | SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand ORDER BY Name | nvbench |
CREATE TABLE Faculty_participates_in (
actID VARCHAR
)
CREATE TABLE Activity (
activity_name VARCHAR,
actID VARCHAR
) | Show all the activity names and the number of faculty involved in each activity. | SELECT T1.activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID | sql_create_context |
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 products with a price between 60 and 120, visualize a scatter chart about the correlation between code and price . | SELECT Code, Price FROM Products WHERE Price BETWEEN 60 AND 120 | nvbench |
CREATE TABLE table_204_256 (
id number,
"position" number,
"club" text,
"played" number,
"points" number,
"wins" number,
"draws" number,
"losses" number,
"goals for" number,
"goals against" number,
"goal difference" number
) | what is the difference in wins between sevilla fc and cd toledo ? | SELECT ABS((SELECT "wins" FROM table_204_256 WHERE "club" = 'sevilla fc') - (SELECT "wins" FROM table_204_256 WHERE "club" = 'cd toledo')) | squall |
CREATE TABLE table_204_453 (
id number,
"#" number,
"date" text,
"venue" text,
"opponents" text,
"score" text,
"comp" text,
"denmark scorers" text
) | which total score was higher , game # 163 or # 181 ? | SELECT "#" FROM table_204_453 WHERE "#" IN (163, 181) ORDER BY "score" + "score" DESC LIMIT 1 | squall |
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... | how many asian patients were admitted to the hospital before the year 2108? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.admityear < "2108" | mimicsql_data |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId n... | questions without code examples; parameters: tags/keywords/minimum score. | SELECT Id AS "post_link", Title, Score, Tags, ViewCount, AnswerCount, CommentCount, FavoriteCount, OwnerUserId FROM Posts AS q WHERE PostTypeId = 1 AND ((q.Tags LIKE '%<sap>%') OR (q.Title LIKE '% sap%' OR q.Title LIKE '%SAP%' OR q.Title LIKE '%Sap%') OR (q.Body LIKE '% sap%' OR q.Body LIKE '%SAP%' OR q.Body LIKE '%Sap... | sede |
CREATE TABLE table_28925058_1 (
date VARCHAR,
grand_prix VARCHAR,
race_winner VARCHAR
) | How many dates did Daniel Ruiz win the Spanish Grand Prix? | SELECT COUNT(date) FROM table_28925058_1 WHERE grand_prix = "Spanish grand_prix" AND race_winner = "Daniel Ruiz" | sql_create_context |
CREATE TABLE table_14377 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Distance" text
) | In which year did he finish 11th? | SELECT COUNT("Year") FROM table_14377 WHERE "Result" = '11th' | wikisql |
CREATE TABLE table_name_65 (
opponents_in_the_final VARCHAR,
date VARCHAR,
tournament VARCHAR
) | Who are the Opponents in the final prior to 1998 in the Bucharest, Romania Tournament? | SELECT opponents_in_the_final FROM table_name_65 WHERE date < 1998 AND tournament = "bucharest, romania" | sql_create_context |
CREATE TABLE table_27069503_2 (
conf_record VARCHAR,
overall VARCHAR
) | What was the conference record in the season where the Pandas had an overall record of 33-4-1? | SELECT conf_record FROM table_27069503_2 WHERE overall = "33-4-1" | sql_create_context |
CREATE TABLE table_name_79 (
quantity INTEGER,
class_to_1928 VARCHAR
) | What is the smallest quantity having a Class to 1928 of BDi-21? | SELECT MIN(quantity) FROM table_name_79 WHERE class_to_1928 = "bdi-21" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is admission time and discharge time of subject id 17595? | SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.subject_id = "17595" | mimicsql_data |
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_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule... | For each record in schedule, show average of the price for each day in a bar chart, and order x-axis in ascending order. | SELECT Date, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY Date | nvbench |
CREATE TABLE table_name_17 (
mountain_peak VARCHAR,
location VARCHAR
) | Name the mountain peak with location of 46.7000 n 60.5992 w | SELECT mountain_peak FROM table_name_17 WHERE location = "46.7000°n 60.5992°w" | sql_create_context |
CREATE TABLE table_41558 (
"City of license" text,
"Identifier" text,
"Frequency" text,
"Power" text,
"Class" text,
"RECNet" text
) | What city of license has A as a class, and cbec-fm as the identifier? | SELECT "City of license" FROM table_41558 WHERE "Class" = 'a' AND "Identifier" = 'cbec-fm' | 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 jyjgzbb (
BGDH text,
BGRQ tim... | 在2012年8月24日到2020年5月4日内病人尤云霞被开出的所有检验报告单的检验报告单号都有哪些? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 ... | css |
CREATE TABLE table_name_2 (
constructor VARCHAR,
rounds VARCHAR,
engine VARCHAR
) | Who is the constructor of the car with a Peugeot A12 EV5 3.0 V10 engine that competed in all rounds? | SELECT constructor FROM table_name_2 WHERE rounds = "all" AND engine = "peugeot a12 ev5 3.0 v10" | sql_create_context |
CREATE TABLE students (
student_id number,
date_of_registration time,
date_of_latest_logon time,
login_name text,
password text,
personal_name text,
middle_name text,
family_name text
)
CREATE TABLE student_tests_taken (
registration_id number,
date_test_taken time,
test_res... | Return the login names of the students whose family name is 'Ward'. | SELECT login_name FROM students WHERE family_name = "Ward" | spider |
CREATE TABLE table_22648285_1 (
race_time VARCHAR,
driver VARCHAR,
average_speed__mph_ VARCHAR
) | How many races did Cale Yarborough win at an average speed of 88.924 mph? | SELECT COUNT(race_time) FROM table_22648285_1 WHERE driver = "Cale Yarborough" AND average_speed__mph_ = "88.924" | sql_create_context |
CREATE TABLE table_name_22 (
method VARCHAR,
opponent VARCHAR
) | What is the method of opponent georges st-pierre? | SELECT method FROM table_name_22 WHERE opponent = "georges st-pierre" | sql_create_context |
CREATE TABLE table_name_40 (
total INTEGER,
gymnast VARCHAR,
b_score VARCHAR
) | What is the total for Robert Stanescu ( rou ), when the B Score is larger than 8.75? | SELECT SUM(total) FROM table_name_40 WHERE gymnast = "robert stanescu ( rou )" AND b_score > 8.75 | sql_create_context |
CREATE TABLE table_name_85 (
home VARCHAR,
club VARCHAR
) | What is the home record for the Maccabi Tel-Aviv club? | SELECT home FROM table_name_85 WHERE club = "maccabi tel-aviv" | sql_create_context |
CREATE TABLE table_name_85 (
result VARCHAR,
opponent VARCHAR
) | What was the result for the game against the Pittsburgh Steelers? | SELECT result FROM table_name_85 WHERE opponent = "pittsburgh steelers" | 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... | 查询入院诊断为持续的躯体形式的疼痛障碍的最低和最高医疗费总额,主要针对医院7280779的医疗记录 | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '7280779' AND t_kc24.t_kc21_IN_DIAG_DIS_NM = '持续的躯体形式的疼痛障碍') | css |
CREATE TABLE table_26056 (
"Episode #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Production code #" real
) | Name the production code # for episode 109 | SELECT COUNT("Production code #") FROM table_26056 WHERE "Episode #" = '109' | wikisql |
CREATE TABLE table_14418 (
"Year" real,
"Award" text,
"Category" text,
"Nominated Work" text,
"Result" text
) | How many years had ozone awards? | SELECT SUM("Year") FROM table_14418 WHERE "Award" = 'ozone awards' | wikisql |
CREATE TABLE table_name_46 (
date VARCHAR,
partner VARCHAR,
score VARCHAR
) | On what Date is Alexandra Fusai a Partner with a Score of 4 6, 6 3, 6 1? | SELECT date FROM table_name_46 WHERE partner = "alexandra fusai" AND score = "4–6, 6–3, 6–1" | sql_create_context |
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 prescriptions (
subject_id text,
hadm_id... | provide me the number of divorced patients who have td route of drug administration. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "DIVORCED" AND prescriptions.route = "TD" | mimicsql_data |
CREATE TABLE table_42098 (
"Ecozone" text,
"Area (km\u00b2) Territorial waters" real,
"Area (km\u00b2) Exclusive Economic Zone" real,
"Percentage of total area (forEEZ)" real,
"Percentage of marine area (forEEZ)" real
) | What is the sum of percentage of marine area with an area of territorial waters of 72,144 and exclusive economic zone area less than 996,439? | SELECT SUM("Percentage of marine area (forEEZ)") FROM table_42098 WHERE "Area (km\u00b2) Territorial waters" = '72,144' AND "Area (km\u00b2) Exclusive Economic Zone" < '996,439' | 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 ... | 门诊诊断为患有疾病M79.046的病人的籍贯名称叫什么?籍贯代码是什么?相应人数有多少? | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND ... | css |
CREATE TABLE table_name_59 (
nhl_team VARCHAR,
pick__number VARCHAR,
nationality VARCHAR,
position VARCHAR
) | What team draft a player from Canada that was picked #43 and plays right wing? | SELECT nhl_team FROM table_name_59 WHERE nationality = "canada" AND position = "right wing" AND pick__number = "43" | sql_create_context |
CREATE TABLE table_1342370_12 (
candidates VARCHAR,
first_elected VARCHAR
) | Who were the candidates in the 1922 entry? | SELECT candidates FROM table_1342370_12 WHERE first_elected = 1922 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | How many of the patients tested for bilirubin have an unspecified death status? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Bilirubin" | mimicsql_data |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 奚冰蓝这位病患从一0年一月二十六日到一三年十二月十八日,有多少位医生给他看过病 | SELECT COUNT(zzmzjzjlb.ZZYSGH) 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 zzmzjzjlb.JZKSRQ BETWEEN '2010-01-26' AND '2013-12-18' UNION SELECT COUNT(fz... | css |
CREATE TABLE table_25203 (
"Year" real,
"Network" text,
"Race caller" text,
"s Host" text,
"s Analyst" text,
"Reporters" text,
"Trophy presentation" text
) | Name the network for 2007 total | SELECT COUNT("Network") FROM table_25203 WHERE "Year" = '2007' | 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,
... | 列出患者金嘉丽的医疗记录中每一次被开出的药品金额不低于4769.0元的医疗就诊编号 | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '金嘉丽' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 4769.0) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '金嘉丽' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22... | css |
CREATE TABLE table_203_535 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | has the dominican republic won more or less medals than china ? | SELECT (SELECT "total" FROM table_203_535 WHERE "nation" = 'dominican republic') > (SELECT "total" FROM table_203_535 WHERE "nation" = 'china') | squall |
CREATE TABLE table_name_19 (
engine VARCHAR,
start VARCHAR,
finish VARCHAR
) | What engine has a start less than 7, and 23 as a finish? | SELECT engine FROM table_name_19 WHERE start < 7 AND finish = 23 | sql_create_context |
CREATE TABLE table_name_2 (
group_position VARCHAR,
opponents VARCHAR,
attendance VARCHAR
) | What group of juventus had an attendance larger than 47,786? | SELECT group_position FROM table_name_2 WHERE opponents = "juventus" AND attendance > 47 OFFSET 786 | sql_create_context |
CREATE TABLE table_28885977_1 (
stadium VARCHAR,
location VARCHAR
) | Which stadium is located in Adelaide, South Australia? | SELECT stadium FROM table_28885977_1 WHERE location = "Adelaide, South Australia" | sql_create_context |
CREATE TABLE table_26250151_1 (
episode VARCHAR,
original_recording_artist VARCHAR
) | Which episode had Lavern Baker? | SELECT episode FROM table_26250151_1 WHERE original_recording_artist = "LaVern Baker" | 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... | 能举出在2002年7月9日到2012年2月15日这段时间患者21625825被开出的所有检验报告单的检验报告单号具体都有啥吗? | 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_69274 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | What game had the date was it with the final score of 7-23 | SELECT "Date" FROM table_69274 WHERE "Final Score" = '7-23' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | what is the number of emergency room admitted patients who are taking amiodarone hcl medication? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND prescriptions.drug = "Amiodarone HCl" | mimicsql_data |
CREATE TABLE table_19852975_3 (
writer_s_ VARCHAR,
arties_disguises VARCHAR
) | Name the writers for swedish sailor | SELECT writer_s_ FROM table_19852975_3 WHERE arties_disguises = "Swedish sailor" | sql_create_context |
CREATE TABLE table_204_130 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | how many consecutive times is china represented ? | SELECT COUNT(*) FROM table_204_130 WHERE "opponent" = 'china' | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.