context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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 patients with drug code mica100i have a pleural lab test done? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "MICA100I" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
... | Top 150 dev in India. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%IND' ORDER BY Reputation DESC LIMIT 150 | sede |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 这个赵伟博的患者以往做了哪些检查还知道么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '赵伟博' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLIN... | css |
CREATE TABLE table_203_153 (
id number,
"stamp issue date" text,
"stamp set" text,
"#cards" text,
"card set ref" text,
"qty. issued" number
) | which was the only stamp set to have more than 200,000 issued ? | SELECT "stamp set" FROM table_203_153 WHERE "qty. issued" > 200000 | squall |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | find the drug code of psyllium wafer. | SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Psyllium Wafer" | mimicsql_data |
CREATE TABLE table_name_88 (
field VARCHAR,
opponent VARCHAR,
result VARCHAR
) | What field is an opponent of cannons and resulted with w 16-11? | SELECT field FROM table_name_88 WHERE opponent = "cannons" AND result = "w 16-11" | sql_create_context |
CREATE TABLE table_name_57 (
total VARCHAR,
gold VARCHAR,
silver VARCHAR,
bronze VARCHAR
) | Name the total number of total with silver of 6, bronze more than 5 and gold less than 4 | SELECT COUNT(total) FROM table_name_57 WHERE silver = 6 AND bronze > 5 AND gold < 4 | sql_create_context |
CREATE TABLE table_203_562 (
id number,
"state" text,
"no. of candidates" number,
"no. of elected" number,
"total no. of seats in assembly" number,
"year of election" number
) | number of states with less than 100 seats . | SELECT COUNT("state") FROM table_203_562 WHERE "total no. of seats in assembly" < 100 | squall |
CREATE TABLE table_39078 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | What is the highest number of games drawn, where the games played was less than 7? | SELECT MAX("Drawn") FROM table_39078 WHERE "Games" < '7' | wikisql |
CREATE TABLE table_10955 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Notes" text
) | What is the notes for the hypo-meeting tournament in 2012? | SELECT "Notes" FROM table_10955 WHERE "Tournament" = 'hypo-meeting' AND "Year" = '2012' | wikisql |
CREATE TABLE table_name_51 (
record VARCHAR,
date VARCHAR
) | Which Record is on november 16? | SELECT record FROM table_name_51 WHERE date = "november 16" | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
... | Which classes offered this Winter at EPID are upper-level classes ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EPID' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Winter... | advising |
CREATE TABLE table_46168 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Record" text
) | Which Opponent has a Record of 22-10? | SELECT "Opponent" FROM table_46168 WHERE "Record" = '22-10' | wikisql |
CREATE TABLE table_16747 (
"Rnd" real,
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | how many times is the pole position niki lauda and the race is monaco grand prix? | SELECT COUNT("Rnd") FROM table_16747 WHERE "Pole Position" = 'Niki Lauda' AND "Race" = 'Monaco Grand Prix' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | 把二零零七年七月二日到二零一一年五月十二日期间,开出的酸枣仁颗粒的总数量及总金额查看一下 | SELECT SUM(t_kc22.QTY), SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '酸枣仁颗粒' AND t_kc22.STA_DATE BETWEEN '2007-07-02' AND '2011-05-12' | css |
CREATE TABLE table_52551 (
"Name/Number" text,
"Builder" text,
"Type" text,
"Status" text,
"Notes" text
) | Who was the builder for joffre | SELECT "Builder" FROM table_52551 WHERE "Name/Number" = 'joffre' | wikisql |
CREATE TABLE table_204_246 (
id number,
"department" text,
"total deputies" number,
"uninominal deputies" number,
"plurinominal deputies" number,
"special indigenous\nor campesino deputies" number,
"senators" number
) | which department of bolivia 's legislature has the least number of deputies ? | SELECT "department" FROM table_204_246 ORDER BY "total deputies" LIMIT 1 | squall |
CREATE TABLE table_66773 (
"Episode" text,
"First aired" text,
"Entrepreneur(s)" text,
"Company or product name" text,
"Money requested (\u00a3)" text,
"Investing Dragon(s)" text
) | What is the name of the Company or Product that is Episode 3 and is suppoted by Investing Dragon Deborah Meaden? | SELECT "Company or product name" FROM table_66773 WHERE "Episode" = 'episode 3' AND "Investing Dragon(s)" = 'deborah meaden' | wikisql |
CREATE TABLE table_name_1 (
country VARCHAR,
player VARCHAR
) | What is Doug Ford's country? | SELECT country FROM table_name_1 WHERE player = "doug ford" | sql_create_context |
CREATE TABLE table_58593 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Who was the opponent on April 29? | SELECT "Opponent" FROM table_58593 WHERE "Date" = 'april 29' | wikisql |
CREATE TABLE table_18662 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's the district with incumbent being william j. driver | SELECT "District" FROM table_18662 WHERE "Incumbent" = 'William J. Driver' | wikisql |
CREATE TABLE table_61097 (
"Name" text,
"Date" text,
"Year" real,
"Location" text,
"Killed" text,
"Injured" text
) | What is Date, when Name is 'Guay, Albert , 32'? | SELECT "Date" FROM table_61097 WHERE "Name" = 'guay, albert , 32' | wikisql |
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 whose admission location is transfer from hosp/extram and procedure long title is closed biopsy of skin and subcutaneous tissue? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Closed biopsy of skin and subcutaneous tissue" | mimicsql_data |
CREATE TABLE table_name_64 (
score VARCHAR,
winner VARCHAR
) | What was the score when Stefan Edberg won? | SELECT score FROM table_name_64 WHERE winner = "stefan edberg" | sql_create_context |
CREATE TABLE table_27435931_1 (
continent VARCHAR,
country VARCHAR
) | what is the continent in which the country russia is listed? | SELECT continent FROM table_27435931_1 WHERE country = "Russia" | sql_create_context |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
r... | friday 's flights between NEWARK and TAMPA | 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAMPA' AND date_day.day_number = 25 AND date_day.month_number = 6 AND dat... | atis |
CREATE TABLE table_204_68 (
id number,
"name" text,
"profession" text,
"hometown" text,
"term expires" number,
"office" text
) | total number of members from lawton and oklahoma city | SELECT COUNT("name") FROM table_204_68 WHERE "hometown" IN ('lawton', 'oklahoma city') | squall |
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... | count the number of patients whose marital status is married and procedure short title is drsl/dslmb fus post/post? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.short_title = "Drsl/dslmb fus post/post" | mimicsql_data |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | What courses has Dr. Nicole Koropatkin taught in the past ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... | advising |
CREATE TABLE table_name_44 (
date VARCHAR,
result VARCHAR
) | What is the date of the match with a result of 4-0? | SELECT date FROM table_name_44 WHERE result = "4-0" | sql_create_context |
CREATE TABLE table_16221 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Stadium" text,
"Record" text,
"Attendance" real
) | How many weeks are there that include the date November 9, 1969. | SELECT COUNT("Week") FROM table_16221 WHERE "Date" = 'November 9, 1969' | wikisql |
CREATE TABLE table_59669 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | From which country was the player whose year(s) won was 1983? | SELECT "Country" FROM table_59669 WHERE "Year(s) won" = '1983' | wikisql |
CREATE TABLE table_22265261_1 (
distance VARCHAR,
handicap__st_lb_ VARCHAR
) | What was the distance when the handicap was 11-2? | SELECT distance FROM table_22265261_1 WHERE handicap__st_lb_ = "11-2" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | give me the number of patients whose discharge location is home health care and admission year is less than 2111? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.admityear < "2111" | mimicsql_data |
CREATE TABLE table_41284 (
"Season" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
) | What is the Skip when the Third was john morris? | SELECT "Skip" FROM table_41284 WHERE "Third" = 'john morris' | wikisql |
CREATE TABLE table_6353 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | How many tries against did the club with 383 points against have? | SELECT "Tries against" FROM table_6353 WHERE "Points against" = '383' | wikisql |
CREATE TABLE table_27825 (
"Lighthouse" text,
"Location" text,
"Province/City" text,
"Date First Lit" text,
"Tower height in ft (m)" text,
"Focal plane in ft (m)" text,
"Current Status" text,
"Current Condition/ Description" text
) | The province/city corregidor island (2) is where the lighthouse is located. | SELECT "Province/City" FROM table_27825 WHERE "Lighthouse" = 'Corregidor Island (2)' | wikisql |
CREATE TABLE table_21617 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the location attendance for chucky atkins , russell westbrook (4) | SELECT "Location Attendance" FROM table_21617 WHERE "High assists" = 'Chucky Atkins , Russell Westbrook (4)' | wikisql |
CREATE TABLE table_name_99 (
length VARCHAR,
junctions VARCHAR
) | What's the length of the route with junctions of ur 1472 sh 255? | SELECT length FROM table_name_99 WHERE junctions = "ur 1472 sh 255" | sql_create_context |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | Draw a bar chart of decor versus minimal baseprice, could you show in ascending by the names? | SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor ORDER BY decor | nvbench |
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id int,
color text,
name text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_len... | A bar chart for what are the number of the names of photos taken with the lens brand 'Sigma' or 'Olympus'?, and sort by the how many name from low to high please. | SELECT T1.name, COUNT(T1.name) FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus' GROUP BY T1.name ORDER BY COUNT(T1.name) | nvbench |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 列出为49528446这个病人开药品438415-0的几家医院 | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '49528446' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_CD = '438415-0') | css |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | Edit counts less own edits. | SELECT PostHistory.UserId AS "user_link", COUNT(DISTINCT PostHistory.CreationDate) AS Number FROM PostHistory JOIN Posts ON Posts.Id = PostHistory.PostId WHERE PostHistory.PostHistoryTypeId BETWEEN 1 AND 6 AND Posts.OwnerUserId != PostHistory.UserId AND PostHistory.UserId != -1 GROUP BY PostHistory.UserId ORDER BY Numb... | sede |
CREATE TABLE table_31780 (
"Nomination" text,
"Actor's Name" text,
"Film Name" text,
"Director" text,
"Country" text
) | Tell me the nomination for ukraine | SELECT "Nomination" FROM table_31780 WHERE "Country" = 'ukraine' | wikisql |
CREATE TABLE table_name_1 (
record VARCHAR,
game VARCHAR
) | What was the record after game 41? | SELECT record FROM table_name_1 WHERE game = 41 | 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, a bar chart shows the distribution of name and the sum of revenue , and group by attribute name, and sort y axis in ascending order. | SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue | nvbench |
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city... | What are the ids for all sporty students who are on scholarship? | SELECT stuid FROM sportsinfo WHERE onscholarship = 'Y' | spider |
CREATE TABLE table_56762 (
"Month/Year" text,
"Day Sorties (losses)" text,
"Night Sorties (Losses)" text,
"Luftflotte 2 sorties" real,
"Luftflotte 3 sorties" real,
"Major attacks" text,
"Heavy attacks" real
) | How many heavy attacks did the 450 Luftflotte 2 conduct? | SELECT COUNT("Heavy attacks") FROM table_56762 WHERE "Luftflotte 2 sorties" = '450' | wikisql |
CREATE TABLE Grants (
grant_id INTEGER,
organisation_id INTEGER,
grant_amount DECIMAL(19,4),
grant_start_date DATETIME,
grant_end_date DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Document_Types (
document_type_code VARCHAR(10),
document_description VARCHAR(255)
)
CREATE TABLE S... | When do all the researcher role staff start to work? Bin the time into weekday interval and count them with a bar chart. | SELECT date_from, COUNT(date_from) FROM Project_Staff | 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... | 从零八年六月十六日到一八年四月三十日,患者70128907就诊时接受检查的次数 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '70128907' AND t_kc22.STA_DATE BETWEEN '2008-06-16' AND '2018-04-30' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE labevents (
row... | when did last patient 12927 have the maximum value of mcv in 12/this year? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12927) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIM... | mimic_iii |
CREATE TABLE table_50465 (
"Municipality" text,
"Inhabitants" real,
"Mayor" text,
"Party" text,
"Election" real
) | In what Election year was Adalberto Mosaner the Mayor with less than 16,170 Inhabitants? | SELECT SUM("Election") FROM table_50465 WHERE "Mayor" = 'adalberto mosaner' AND "Inhabitants" < '16,170' | 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... | provide the number of patients whose marital status is married and item id is 51000? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "51000" | mimicsql_data |
CREATE TABLE table_name_11 (
language VARCHAR,
category VARCHAR,
original_title VARCHAR
) | What language was the film Pelle Erobreren, which received the best actor nomination, in? | SELECT language FROM table_name_11 WHERE category = "best actor" AND original_title = "pelle erobreren" | sql_create_context |
CREATE TABLE table_name_84 (
rank INTEGER,
silver VARCHAR,
bronze VARCHAR,
country VARCHAR
) | What was the sum of the ranks for Japan who had less than 5 bronze medals and more than 3 silvers? | SELECT SUM(rank) FROM table_name_84 WHERE bronze < 5 AND country = "japan" AND silver > 3 | sql_create_context |
CREATE TABLE table_name_69 (
date VARCHAR,
event_circuit VARCHAR
) | what is the date of barbagallo raceway? | SELECT date FROM table_name_69 WHERE event_circuit = "barbagallo raceway" | sql_create_context |
CREATE TABLE table_10950 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When the away team score was 11.5 (71), what was the date? | SELECT "Date" FROM table_10950 WHERE "Away team score" = '11.5 (71)' | wikisql |
CREATE TABLE table_29562161_1 (
name VARCHAR,
starting_price VARCHAR
) | What horse had a starting price of 66/1? | SELECT name FROM table_29562161_1 WHERE starting_price = "66/1" | sql_create_context |
CREATE TABLE table_name_72 (
reign_ended VARCHAR,
country VARCHAR
) | Whose reign ended in Egypt? | SELECT reign_ended FROM table_name_72 WHERE country = "egypt" | sql_create_context |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABL... | Non-Open WordPress Questions - 8 Months. | SELECT DISTINCT p.Id AS "ID", p.CreationDate AS "Date", p.Tags AS "Tags" FROM Posts AS p WHERE p.CreationDate BETWEEN '2019-01-01' AND '2019-08-28' AND (p.Tags LIKE '%wordpress%' OR p.Tags LIKE 'yoast%' OR p.Tags LIKE '%woocommerce%' OR p.Tags LIKE 'buddypress%' OR p.Tags LIKE 'bbpress%' OR p.Tags LIKE 'contact-form-7%... | sede |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 个人自理金有多少?在42962447104这次医疗就诊中 | SELECT t_kc24.PER_SOL 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 = '42962447104' | 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 ... | 从02年11月11日起到02年12月10日结束医疗机构6691879计生处理的住院就诊数有多少? | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '6691879' AND wdmzjzjlb.JZKSMC = '计划生育科' AND wdmzjzjlb.RYDJSJ BETWEEN '2002-11-11' AND '2002-12-10' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '6691879' AND bdmzjzjlb.JZKSMC = '计划生育科' AND bdmzjzjlb.RYDJSJ BETWEEN '2002-11-11' AND '2002-12-10' | css |
CREATE TABLE table_56927 (
"Player" text,
"Position" text,
"First-Team Debut" text,
"First-Team Appearances" real,
"First-Team Goals" real,
"Current Club" text
) | What position does adam rachel play? | SELECT "Position" FROM table_56927 WHERE "Player" = 'adam rachel' | 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 ... | 医院9831232从12年8月1日到2019年2月12日的门诊就诊中,有多少科室开出的检验报告单少于6张 | SELECT COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '9831232' AND zyjybgb.BGRQ BETWEEN '2012-08-01' AND '2019-02-12' GROUP BY zyjybgb.KSBM HAVING COUNT(*) < 6 UNION SELECT mzjybgb.KSBM FROM mzjzjl... | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TI... | Compare the total salary by each hire date (bin it into month interval) of employees using a bar chart, I want to show by the y-axis in descending. | SELECT HIRE_DATE, SUM(SALARY) FROM employees ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE table_68208 (
"Number" real,
"Name of the song" text,
"Singer" text,
"Drama" text,
"Kind of the song" text
) | Which type of song did miriam yeung sing? | SELECT "Kind of the song" FROM table_68208 WHERE "Singer" = 'miriam yeung' | wikisql |
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,
... | 给患者吴煜祺审核检验报告的人员工号及姓名是什么,在72786598852这个医疗就诊中 | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '72786598852' | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is primary disease and discharge time of subject id 26285? | SELECT demographic.diagnosis, demographic.dischtime FROM demographic WHERE demographic.subject_id = "26285" | mimicsql_data |
CREATE TABLE table_name_55 (
score VARCHAR,
opponent VARCHAR
) | What was the score of the game against Minnesota? | SELECT score FROM table_name_55 WHERE opponent = "minnesota" | sql_create_context |
CREATE TABLE table_name_97 (
name_athlete VARCHAR,
semi VARCHAR
) | Who was the athlete who had SEMI of 1:43.79? | SELECT name_athlete FROM table_name_97 WHERE semi = "1:43.79" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Parent... | Questions with titles containing $$. | SELECT Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND Title LIKE '%$$%' ORDER BY CreationDate | sede |
CREATE TABLE table_46419 (
"Name" text,
"Country" text,
"Loan Club" text,
"Started" text,
"Ended" text,
"Start Source" text,
"End Source" text
) | when was the loan ended when the loan club is spartak moscow? | SELECT "Ended" FROM table_46419 WHERE "Loan Club" = 'spartak moscow' | wikisql |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
e... | For those dates with a max temperature greater than or equal to 80, I want to see the number of days for each year using a bar chart, and show in asc by the total number. | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 ORDER BY COUNT(date) | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | provide the number of black/haitian patients who had bone marrow biopsy. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND procedures.short_title = "Bone marrow biopsy" | mimicsql_data |
CREATE TABLE table_name_3 (
competition VARCHAR,
goals VARCHAR,
score VARCHAR
) | Which competition has a Goal of deacon 8/8 and a Score of 32-14? | SELECT competition FROM table_name_3 WHERE goals = "deacon 8/8" AND score = "32-14" | sql_create_context |
CREATE TABLE Shops (
Shop_ID INTEGER,
Shop_Details VARCHAR(255)
)
CREATE TABLE Features (
Feature_ID INTEGER,
Feature_Details VARCHAR(255)
)
CREATE TABLE Photos (
Photo_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Name VARCHAR(255),
Description VARCHAR(255),
Filename VARCHAR(255),
... | Show the names and ids of tourist attractions that are visited at least two times with a bar chart, and I want to show by the Name from low to high. | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Name | nvbench |
CREATE TABLE table_32872 (
"Adherents" real,
"Regular Attendees" real,
"% of adherents" text,
"Monasteries" real,
"Parishes" real,
"Average Parish Size" real
) | What is the average regular number of attendees that has 79 parishes? | SELECT AVG("Regular Attendees") FROM table_32872 WHERE "Parishes" = '79' | wikisql |
CREATE TABLE table_11404452_1 (
original_air_date VARCHAR,
director VARCHAR
) | What is the original air date of the Jamie Babbit directed episode? | SELECT original_air_date FROM table_11404452_1 WHERE director = "Jamie Babbit" | sql_create_context |
CREATE TABLE table_64013 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School" text
) | After pick number 158, what is the next round a USC player was picked? | SELECT MIN("Round") FROM table_64013 WHERE "School" = 'usc' AND "Pick" > '158' | wikisql |
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... | 在17-02-20到20-04-10期间,患者葛德元这位患者被开出多少次地西泮片 | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '葛德元' AND t_kc22.STA_DATE BETWEEN '2017-02-20' AND '2020-04-10' AND t_kc22.SOC_SRT_DIRE_NM = '地西泮片' | css |
CREATE TABLE table_60081 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is Score, when Country is 'Scotland'? | SELECT "Score" FROM table_60081 WHERE "Country" = 'scotland' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, sort y-axis in asc order. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) | nvbench |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Give me a pie to show sum team id from different acc road. | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road | nvbench |
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,... | provide the number of patients whose days of hospital stay is greater than 4 and lab test name is free calcium? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "4" AND lab.label = "Free Calcium" | mimicsql_data |
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Location text
)
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
)
CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
) | Return a bar chart showing how many members have visited for each college, could you display y axis in desc order please? | SELECT T1.Name, COUNT(T1.Name) FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC | nvbench |
CREATE TABLE table_name_93 (
manufacturer VARCHAR,
grid VARCHAR
) | Which manufacturer is grid 11? | SELECT manufacturer FROM table_name_93 WHERE grid = "11" | sql_create_context |
CREATE TABLE table_name_91 (
team_2 VARCHAR,
score VARCHAR
) | What is the name of team 2 that has 1-2 as the score? | SELECT team_2 FROM table_name_91 WHERE score = "1-2" | sql_create_context |
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 ... | 在01年9月15日到2009年7月27日期间,医生70900015的门诊量一共是多少人? | SELECT COUNT(*) FROM mzjzjlb WHERE ZZYSGH = '70900015' AND JZKSRQ BETWEEN '2001-09-15' AND '2009-07-27' | 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 ... | 检验报告单被住院就诊91555102556开出了多少份? | SELECT COUNT(*) FROM zyjybgb WHERE zyjybgb.JZLSH = '91555102556' UNION SELECT COUNT(*) FROM mzjybgb WHERE mzjybgb.JZLSH = '91555102556' | css |
CREATE TABLE table_name_91 (
college_junior_club_team VARCHAR,
nationality VARCHAR
) | What was the College/junior/club team of the player with the united states nationality? | SELECT college_junior_club_team FROM table_name_91 WHERE nationality = "united states" | sql_create_context |
CREATE TABLE table_18985 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many players scored the most points when the opposing team was New Orleans/Oklahoma City? | SELECT COUNT("High points") FROM table_18985 WHERE "Team" = 'New Orleans/Oklahoma City' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE admissions... | when was the first time patient 97330 had a urine out foley output during yesterday. | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97330)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urin... | mimic_iii |
CREATE TABLE table_204_30 (
id number,
"year built" text,
"works number" number,
"wheel arr." text,
"gauge" text,
"original owner" text,
"name" text,
"current location" text,
"notes" text
) | what is the works number of the only item built in 1882 ? | SELECT "works number" FROM table_204_30 WHERE "year built" = 1882 | squall |
CREATE TABLE table_14907 (
"Year" real,
"Crime Index Total" real,
"Violent crime" real,
"Non-violent Crime" real,
"Crime rate Per 1000" real,
"Violent crime Rate per 1000" real,
"Non-violent crime Rate per 1000" real,
"Murder" real,
"Rape" real,
"Robbery" real,
"Aggravated As... | How many total murders happened after 2011? | SELECT SUM("Murder") FROM table_14907 WHERE "Year" > '2011' | wikisql |
CREATE TABLE Shops (
Shop_ID INTEGER,
Shop_Details VARCHAR(255)
)
CREATE TABLE Locations (
Location_ID INTEGER,
Location_Name VARCHAR(255),
Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Attraction_Types (
Attraction_Type_Code CHAR(15),
Attraction_Type_Description ... | How many tourist attractions for each attraction name? Visualize by a bar chart, and sort by the Y in asc. | SELECT Name, COUNT(*) FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_20 (
technology VARCHAR,
toxic_materials VARCHAR,
moving_parts VARCHAR
) | What's the technology when there are no moving parts but yes to toxic materials? | SELECT technology FROM table_name_20 WHERE toxic_materials = "yes" AND moving_parts = "no" | sql_create_context |
CREATE TABLE table_3206 (
"Region" text,
"Median income ( Intl.$ )" real,
"Below 40% of median income" text,
"Below 50% of median income" text,
"Below 60% of median income" text
) | What percentage of the population is below 50% of the median income in the region where 10.4% of the population earns below 40% of the median income? | SELECT COUNT("Below 50% of median income") FROM table_3206 WHERE "Below 40% of median income" = '10.4%' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | what is the top four most common lab tests that followed during the same month for patients who received rt heart angiocardiogram this year? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i... | mimic_iii |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
... | Show the number of courses for each instructor in a bar chart, and I want to order in desc by the y axis. | SELECT EMP_FNAME, COUNT(EMP_FNAME) 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 GROUP BY EMP_FNAME ORDER BY COUNT(EMP_FNAME) DESC | nvbench |
CREATE TABLE table_75542 (
"Longi- tude" text,
"Usual translation" text,
"Chinese name \u00b9" text,
"Japanese name" text,
"Korean name \u00b2" text,
"Vietnamese name" text,
"Date \u00b3" text
) | When has a Korean name of ( ) cheongmyeong? | SELECT "Date \u00b3" FROM table_75542 WHERE "Korean name \u00b2" = '청명 (清明) cheongmyeong' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.