context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE CloseAsO...
Unaccepted answers to questions by recently active users.
SELECT a.Id AS "post_link", a.CreationDate, a.Score, u.Id AS "user_link", u.LastAccessDate FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id INNER JOIN Users AS u ON u.Id = q.OwnerUserId WHERE a.OwnerUserId = '##UserId:int##' AND q.AcceptedAnswerId IS NULL AND u.LastAccessDate >= '##LastAccessDate:string##' OR...
sede
CREATE TABLE table_name_53 ( score_points VARCHAR, rank_points VARCHAR )
What is the score points when the rank points is 3?
SELECT score_points FROM table_name_53 WHERE rank_points = "3"
sql_create_context
CREATE TABLE table_name_37 ( date VARCHAR, works_number VARCHAR, type VARCHAR, number VARCHAR )
What is the sum of number with type 0-4-4 forney locomotive, number smaller than 20 and works number of 1251?
SELECT COUNT(date) FROM table_name_37 WHERE type = "0-4-4 forney locomotive" AND number < 20 AND works_number = 1251
sql_create_context
CREATE TABLE table_66795 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real )
What was the location of the game after game 6?
SELECT "Location" FROM table_66795 WHERE "Game" > '6'
wikisql
CREATE TABLE table_name_67 ( tournament VARCHAR, opponent VARCHAR )
What is the Tournament against Vladimir Zednik?
SELECT tournament FROM table_name_67 WHERE opponent = "vladimir zednik"
sql_create_context
CREATE TABLE table_name_52 ( drew VARCHAR, round VARCHAR, season VARCHAR )
What is the drew for the 1999-2000 season when they were in third place?
SELECT drew FROM table_name_52 WHERE round = "third place" AND season = "1999-2000"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
count the number of patients who were diagnosed with ethanol overdose within the same month after being diagnosed with hypotension / pressor dependent.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'ethanol overdose') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient...
eicu
CREATE TABLE table_27075 ( "Episode" real, "Stage" text, "Celebrities" text, "Directed and produced by" text, "Original airdate" text, "Viewers (overnight estimates)" text )
List episode directed and produced by Karen Selway?
SELECT "Episode" FROM table_27075 WHERE "Directed and produced by" = 'Karen Selway'
wikisql
CREATE TABLE table_name_7 ( year VARCHAR )
What is the 1995 value with a Jiangxi year and a 2008 value bigger than 67?
SELECT SUM(1995) FROM table_name_7 WHERE year = "jiangxi" AND 2008 > 67
sql_create_context
CREATE TABLE table_27756314_11 ( high_rebounds VARCHAR, game VARCHAR )
How many different results for high rebounds were there for game number 76?
SELECT COUNT(high_rebounds) FROM table_27756314_11 WHERE game = 76
sql_create_context
CREATE TABLE table_25691838_11 ( production_code VARCHAR, original_airdate VARCHAR )
How many production codes were there for the episode that aired on November 15?
SELECT COUNT(production_code) FROM table_25691838_11 WHERE original_airdate = "November 15"
sql_create_context
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int )
Show different types of ships and the number of ships of each type Show bar chart, and order from high to low by the Type.
SELECT Type, COUNT(*) FROM ship GROUP BY Type ORDER BY Type DESC
nvbench
CREATE TABLE table_19412902_1 ( group_stage VARCHAR, play_off VARCHAR, clubs VARCHAR )
which group stage was there 0 play-offs and 12 clubs played in it
SELECT COUNT(group_stage) FROM table_19412902_1 WHERE play_off = 0 AND clubs = 12
sql_create_context
CREATE TABLE table_49370 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is Tie No, when Away Team is 'Millwall'?
SELECT "Tie no" FROM table_49370 WHERE "Away team" = 'millwall'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
list the time of the hospital admission of patient 017-37716 in 2103.
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '017-37716' AND STRFTIME('%y', patient.hospitaladmittime) = '2103'
eicu
CREATE TABLE table_28523_2 ( gender VARCHAR, age_range VARCHAR, school VARCHAR )
What is the gender with a age range of 3-11 at the st adrian roman catholic primary school?
SELECT gender FROM table_28523_2 WHERE age_range = "3-11" AND school = "St Adrian Roman Catholic Primary school"
sql_create_context
CREATE TABLE table_54278 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
What is the date of the game when the Mavericks were the home team?
SELECT "Date" FROM table_54278 WHERE "Home" = 'mavericks'
wikisql
CREATE TABLE table_45469 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
WHAT IS THE SCORE FOR GREG NORMAN?
SELECT "Score" FROM table_45469 WHERE "Player" = 'greg norman'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Tags ( Id num...
number of comments per Customer.
SELECT UserId, COUNT(PostId) AS num_of_comments FROM Comments LEFT JOIN Users ON Comments.Id = Users.Id GROUP BY UserId
sede
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
among total number of patients admitted to emergency, how many of them belonged to black/haitian ethnic origin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.ethnicity = "BLACK/HAITIAN"
mimicsql_data
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 labevents ...
what was patient 7112's total dose of nepro today?
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7112)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe...
mimic_iii
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,...
能知道医疗就诊40153169364中所有退费结算都已完成了吗
SELECT REF_SLT_FLG FROM t_kc24 WHERE MED_CLINIC_ID = '40153169364'
css
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients who have been prescribed the drug cina30 have had the lab examination of pleural fluid ?
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 = "CINA30" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_10446 ( "Team" text, "Head Coach" text, "President" text, "Home Ground" text, "Location" text )
Who is the President of the team that has the Head Coach Mark Wakeling?
SELECT "President" FROM table_10446 WHERE "Head Coach" = 'mark wakeling'
wikisql
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...
查一下23984748患者在医院0159261的门诊诊断内容有白内障这几个字的门诊就诊记录
SELECT * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '23984748' AND hz_info.YLJGDM = '0159261' AND mzjzjlb.JZZDSM LIKE '%白内障%'
css
CREATE TABLE table_204_235 ( id number, "season" text, "team" text, "country" text, "competition" text, "matches" number, "goals" number )
what team has the most goals ?
SELECT "team" FROM table_204_235 ORDER BY "goals" DESC LIMIT 1
squall
CREATE TABLE table_57780 ( "Rocket launch" text, "Launch Date" text, "Mission" text, "Institutional authority" text, "Launch Site" text, "Outcomes" text, "Derivatives" text )
Which Mission has a Launch Date of december 30, 1970; 14:50 gmt?
SELECT "Mission" FROM table_57780 WHERE "Launch Date" = 'december 30, 1970; 14:50 gmt'
wikisql
CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE dorm ...
Find the name of amenities Smith Hall dorm have.
SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall'
spider
CREATE TABLE table_name_23 ( liberal VARCHAR, new_democratic VARCHAR, dates VARCHAR )
What percentage of people polled aligned with the Liberal party according to the August 2008 poll that reported 36% aligning with New Democratic party?
SELECT liberal FROM table_name_23 WHERE new_democratic = "36%" AND dates = "august 2008"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
For those employees who was hired before 2002-06-21, return a line chart about the change of department_id over hire_date , I want to order by the X-axis in asc.
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE
nvbench
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
calculate the minimum age of patients on medicaid insurance who had sdh as primary disease.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "SDH"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE d...
what is the drug that during the first hospital visit patient 030-56105 has been prescribed two times?
SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030...
eicu
CREATE TABLE table_30987 ( "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning Rider" text, "Winning Team" text )
Who had the pole position when matt davies had the fastest lap?
SELECT "Pole Position" FROM table_30987 WHERE "Fastest Lap" = 'Matt Davies'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many office admitted patients have lab test item id 51044?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.itemid = "51044"
mimicsql_data
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...
Give me the comparison about ID over the Time by a bar chart, could you list ID from high to low order?
SELECT Time, ID FROM swimmer ORDER BY ID DESC
nvbench
CREATE TABLE table_name_84 ( score VARCHAR, tie_no VARCHAR )
What is the score when the tie number is 8?
SELECT score FROM table_name_84 WHERE tie_no = "8"
sql_create_context
CREATE TABLE airport ( airport_id number, airport_name text, total_passengers number, %_change_2007 text, international_passengers number, domestic_passengers number, transit_passengers number, aircraft_movements number, freight_metric_tonnes number ) CREATE TABLE airport_aircraft (...
What is the number of aircraft?
SELECT COUNT(*) FROM aircraft
spider
CREATE TABLE table_name_65 ( year_joined VARCHAR, _number___county VARCHAR )
what is the correct year for # / county of 09 cass?
SELECT year_joined FROM table_name_65 WHERE _number___county = "09 cass"
sql_create_context
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,...
病人46299488在2008年7月10日到2010年12月30日这两年中,医保的个人账户支出有多少钱?
SELECT SUM(PER_ACC_PAY) FROM t_kc24 WHERE PERSON_ID = '46299488' AND CLINIC_SLT_DATE BETWEEN '2008-07-10' AND '2010-12-30'
css
CREATE TABLE table_204_223 ( id number, "party" text, "previous council" number, "staying councillors" number, "seats up for election" number, "election result" number, "new council" number )
which new council is above labor
SELECT "party" FROM table_204_223 WHERE "new council" > (SELECT "new council" FROM table_204_223 WHERE "party" = 'labour')
squall
CREATE TABLE table_train_105 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "hypertension" bool, "age" float, "NOUSE" float )
mini mental state examination score > 15
SELECT * FROM table_train_105 WHERE mini_mental_state_examination_mmse > 15
criteria2sql
CREATE TABLE table_name_46 ( venue VARCHAR, away_team VARCHAR )
Where was the game held where Hawthorn was the away team?
SELECT venue FROM table_name_46 WHERE away_team = "hawthorn"
sql_create_context
CREATE TABLE table_200_32 ( id number, "year" number, "w" number, "l" number, "t" number, "finish" text, "coach" text )
in what year did the muncie flyers have an undefeated record ?
SELECT "year" FROM table_200_32 WHERE "l" = 0
squall
CREATE TABLE table_1341472_34 ( first_elected VARCHAR, district VARCHAR )
Name the number of first elected for new york 11
SELECT COUNT(first_elected) FROM table_1341472_34 WHERE district = "New York 11"
sql_create_context
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 unmarried patients who have lab test item id 50911.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.itemid = "50911"
mimicsql_data
CREATE TABLE table_77027 ( "Nation" text, "Model" text, "Length" text, "Barrel length" text, "Weight" text )
What is Weight, when Length is 1168mm / 46 in?
SELECT "Weight" FROM table_77027 WHERE "Length" = '1168mm / 46 in'
wikisql
CREATE TABLE table_name_60 ( vmax VARCHAR, type VARCHAR, cylinder VARCHAR, capacity VARCHAR )
What was the maximum speed for straight-4, 1.466 cc Type r 150?
SELECT vmax FROM table_name_60 WHERE cylinder = "straight-4" AND capacity = "1.466 cc" AND type = "r 150"
sql_create_context
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_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '魏星辰' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '硫酸氢氯吡格雷片')
css
CREATE TABLE table_train_131 ( "id" int, "thyroid_disease" bool, "pulmonary_disease" bool, "right_bundle_branch_block" bool, "allergy_to_piperidine_derivatives" bool, "obstructive_pulmonary_disease" bool, "inflammatory_bowel_disease" bool, "renal_disease" bool, "hepatic_disease" bool...
patients with clinically significant obstructive pulmonary disease or asthma, untreated or not controlled by treatment within 3 months prior to screening.
SELECT * FROM table_train_131 WHERE obstructive_pulmonary_disease = 1 OR asthma = 1
criteria2sql
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...
Show me about the distribution of All_Home and the average of Team_ID , and group by attribute All_Home in a bar chart.
SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home
nvbench
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number,...
Top Users in the Game of Thrones Tag.
SELECT TagUsers.UserLink AS "user_link", TagUsers.Score AS Score, TagUsers.Count AS "count", (TagUsers.Score + TagUsers.Count) / 2 AS Total FROM (SELECT a.OwnerUserId AS UserLink, SUM(a.Score) AS Score, COUNT(a.Score) AS "count" FROM Posts AS a, Posts AS q INNER JOIN PostTags AS qt ON q.Id = qt.PostId INNER JOIN Tags A...
sede
CREATE TABLE table_204_461 ( id number, "res." text, "record" text, "opponent" text, "method" text, "event" text, "date" text, "round" number, "time" text, "location" text, "notes" text )
what is his total number of fights between april of 2003 and december of 2013 ?
SELECT COUNT(*) FROM table_204_461
squall
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Cr...
Posts, Views, and View/Post ratio per day.
SELECT DATE(p.CreationDate) AS pdate, COUNT(*) AS nposts_per_day, SUM(p.ViewCount) AS nviews_per_day, SUM(p.ViewCount) / COUNT(*) AS view_post_ratio FROM Tags JOIN PostTags AS pt ON Tags.Id = pt.TagId JOIN Posts AS p ON pt.PostId = p.Id WHERE Tags.TagName = @TagName GROUP BY DATE(p.CreationDate) ORDER BY pdate DESC LIM...
sede
CREATE TABLE table_21350772_2 ( gas_name VARCHAR )
What is the 20 year for Sulfur Hexafluoride?
SELECT 20 AS _yr FROM table_21350772_2 WHERE gas_name = "Sulfur hexafluoride"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, hi...
which united airlines flight flies from BOSTON to SAN FRANCISCO and makes a stopover in PHILADELPHIA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT...
atis
CREATE TABLE table_name_42 ( opening_week_nett_gross INTEGER, rank VARCHAR, studio_s_ VARCHAR )
What is the highest opening week net gross of the movie ranked higher than 5 from Reliance Entertainment?
SELECT MAX(opening_week_nett_gross) FROM table_name_42 WHERE rank < 5 AND studio_s_ = "reliance entertainment"
sql_create_context
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, ...
Give me a histogram for how many students play each sport?
SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName
nvbench
CREATE TABLE table_name_95 ( date VARCHAR, opponent VARCHAR, loss VARCHAR )
Which date has an Opponent of angels, and a Loss of sanderson (0 1)?
SELECT date FROM table_name_95 WHERE opponent = "angels" AND loss = "sanderson (0–1)"
sql_create_context
CREATE TABLE table_27733258_7 ( date VARCHAR, game VARCHAR )
what date was game 29?
SELECT date FROM table_27733258_7 WHERE game = 29
sql_create_context
CREATE TABLE table_65151 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real )
how many times is the total apps 1 and the fa cup goals less than 0 for bob mountain?
SELECT COUNT("Total Goals") FROM table_65151 WHERE "Total Apps" = '1' AND "Name" = 'bob mountain' AND "FA Cup Goals" < '0'
wikisql
CREATE TABLE table_name_19 ( south_asians_2011 VARCHAR, province VARCHAR, south_asians_2001 VARCHAR )
How many South Asians were there in 2011 in Quebec when there were fewer than 59,510 in 2001?
SELECT COUNT(south_asians_2011) FROM table_name_19 WHERE province = "quebec" AND south_asians_2001 < 59 OFFSET 510
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...
provide the number of patients whose admission type is elective and year of birth is less than 2043?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "2043"
mimicsql_data
CREATE TABLE table_name_9 ( prominence__m_ INTEGER, col__m_ INTEGER )
Count the Prominence (m) of Col (m) smaller than 0?
SELECT AVG(prominence__m_) FROM table_name_9 WHERE col__m_ < 0
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
tell me the name of the drug that patient 58649 was prescribed within the same hospital visit after having received a lt heart angiocardiogram procedure in 08/last year.
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 58649 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
mimic_iii
CREATE TABLE table_name_45 ( opponents VARCHAR, date VARCHAR )
Name the opponents for 24 july 2011
SELECT opponents FROM table_name_45 WHERE date = "24 july 2011"
sql_create_context
CREATE TABLE table_47002 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Who was the visitor when the score was 136 120?
SELECT "Visitor" FROM table_47002 WHERE "Score" = '136–120'
wikisql
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
Return a histogram on how many students live in each city?, and could you order X-axis in descending order?
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code DESC
nvbench
CREATE TABLE table_6142 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is the 2nd leg of team 2 Far rabat?
SELECT "2nd leg" FROM table_6142 WHERE "Team 2" = 'far rabat'
wikisql
CREATE TABLE table_3035 ( "Borough" text, "County" text, "Franchise type" text, "Members" real, "Voters in 1800" real, "Times contested" real, "Fate in 1832" text )
What is the number of voters in 1800 that have boroughs named Drogheda?
SELECT COUNT("Voters in 1800") FROM table_3035 WHERE "Borough" = 'Drogheda'
wikisql
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...
Give the number of patients that survived and have a diagnosis icd9 code of 5712.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "5712"
mimicsql_data
CREATE TABLE Person ( age INTEGER )
What is the average age for all person?
SELECT AVG(age) FROM Person
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, ...
Since when I upvoted this answer?. I find myself frequently looking for answer in StackExchange websites and found that I've already upvoted the useful answers, but I don't know since when I upvoted this answer. This query can tell me since when I upvote this answer/post? answers/question -> Posts table
SELECT * FROM Votes WHERE PostId = @PostId AND UserId = @UserId
sede
CREATE TABLE table_70669 ( "Rank" text, "Nation" text, "Gold" text, "Silver" text, "Bronze" text, "Total" text )
Which nation has a Silver of 1, a Gold of 0, and a Total of 1?
SELECT "Nation" FROM table_70669 WHERE "Silver" = '1' AND "Gold" = '0' AND "Total" = '1'
wikisql
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is admission type and admission location of subject id 42067?
SELECT demographic.admission_type, demographic.admission_location FROM demographic WHERE demographic.subject_id = "42067"
mimicsql_data
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, ...
how much does it cost to take a drug called lidocaine-prilocaine?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'lidocaine-prilocaine')
mimic_iii
CREATE TABLE stadium ( name VARCHAR, capacity INTEGER )
Find the names of stadiums whose capacity is smaller than the average capacity.
SELECT name FROM stadium WHERE capacity < (SELECT AVG(capacity) FROM stadium)
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Days difference between answer posted and upvote.
SELECT * FROM VoteTypes
sede
CREATE TABLE table_name_74 ( touchdowns INTEGER, points VARCHAR, position VARCHAR, player VARCHAR )
What is the lowest number of touchdowns for left halfback WIllie Heston who has more than 15 points?
SELECT MIN(touchdowns) FROM table_name_74 WHERE position = "left halfback" AND player = "willie heston" AND points > 15
sql_create_context
CREATE TABLE table_name_49 ( result VARCHAR, date VARCHAR )
What was the result on November 20, 1988?
SELECT result FROM table_name_49 WHERE date = "november 20, 1988"
sql_create_context
CREATE TABLE table_name_68 ( round VARCHAR, position VARCHAR, overall VARCHAR )
What round was the draft pick of tight end with an Overall larger than 21?
SELECT COUNT(round) FROM table_name_68 WHERE position = "tight end" AND overall > 21
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what was the name of the drug patient 20801 was prescribed within 2 days after receiving a procedure-one vessel in 03/2104?
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 20801 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ...
mimic_iii
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE pap...
What conference does li dong publish in ?
SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'li dong' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE dual_carrier...
what are the flights available between 1000 and 1500 between PITTSBURGH and FORT WORTH
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 ((flight.departure_time <= 1500 AND flight.departure_time >= 1000) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'FORT WORTH' AND fli...
atis
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TA...
Count the number of local authorities by the local authority, sort X in ascending order.
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority
nvbench
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
在医疗就诊92694445974中,科室名中没有肾内科这几个字的科室开过哪些医疗费用明细项目
SELECT * FROM t_kc22 WHERE MED_CLINIC_ID = '92694445974' AND NOT MED_ORG_DEPT_NM LIKE '%肾内科%'
css
CREATE TABLE table_14345690_15 ( co_presenter VARCHAR, series VARCHAR )
Who is the co-presenter of the series Seven (2007)?
SELECT co_presenter FROM table_14345690_15 WHERE series = "Seven (2007)"
sql_create_context
CREATE TABLE table_79474 ( "Draw" real, "Artist" text, "Song" text, "Percentage" text, "Place" real )
what is the least draw when the place is higher than 4?
SELECT MIN("Draw") FROM table_79474 WHERE "Place" > '4'
wikisql
CREATE TABLE table_name_84 ( date VARCHAR, share VARCHAR )
When were the shares 39.1%?
SELECT date FROM table_name_84 WHERE share = "39.1%"
sql_create_context
CREATE TABLE table_42093 ( "Office" text, "Democratic ticket" text, "Republican ticket" text, "American Labor ticket" text, "Socialist ticket" text )
Which Republican ran against the American Labor candidate Matthew J. Merritt?
SELECT "Republican ticket" FROM table_42093 WHERE "American Labor ticket" = 'matthew j. merritt'
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...
Show me about the distribution of All_Neutral and All_Games_Percent in a bar chart, list by the names in desc.
SELECT All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Neutral DESC
nvbench
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
检验报告单34439326471的审核人工号和姓名分别是?
SELECT zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.BGDH = '34439326471' UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.BGDH = '34439326471'
css
CREATE TABLE table_13015539_1 ( lost VARCHAR, club VARCHAR )
How many numbers are given for losses by the Keighley Cougars?
SELECT COUNT(lost) FROM table_13015539_1 WHERE club = "Keighley Cougars"
sql_create_context
CREATE TABLE table_71805 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text )
What was the outcome for the Rome 2, Italy tournament?
SELECT "Outcome" FROM table_71805 WHERE "Tournament" = 'rome 2, italy'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id nu...
when patient 85407 first received a procedure?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85407) ORDER BY procedures_icd.charttime LIMIT 1
mimic_iii
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, sc...
What classes have no lab sessions ?
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
advising
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 ) ...
what is the lab item id and lab test name of the patient heather vineyard?
SELECT lab.itemid, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Heather Vineyard"
mimicsql_data
CREATE TABLE table_38916 ( "Position" text, "Name" text, "School" text, "Unanimous" text, "College Hall of Fame" text )
What is the unanimous result of the player from Michigan Dartmouth?
SELECT "Unanimous" FROM table_38916 WHERE "School" = 'michigan dartmouth'
wikisql
CREATE TABLE table_32472 ( "Year" real, "Championship" text, "Winning score" text, "Margin" text, "Runner(s)-up" text )
What was the most recent year that Kathy Ahern was a runner-up?
SELECT MAX("Year") FROM table_32472 WHERE "Runner(s)-up" = 'kathy ahern'
wikisql
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
Which lab conduct of most number of tests?
SELECT lab FROM resultsdata15 GROUP BY lab ORDER BY COUNT(*) DESC LIMIT 1
pesticide
CREATE TABLE table_44826 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text )
How much money was scored for 73-71-70-73=287?
SELECT "Money ( $ )" FROM table_44826 WHERE "Score" = '73-71-70-73=287'
wikisql