context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_88 ( lost INTEGER, drawn VARCHAR, goals_for VARCHAR, points_1 VARCHAR )
What is the lowest Lost, when Goals For is greater than 52, when Points 1 is '44', and when Drawn is less than 8?
SELECT MIN(lost) FROM table_name_88 WHERE goals_for > 52 AND points_1 = "44" AND drawn < 8
sql_create_context
CREATE TABLE table_203_30 ( id number, "place" number, "team" text, "played" number, "won" number, "draw" number, "lost" number, "goals\nscored" number, "goals\nconceded" number, "+/-" number, "points" number )
which team had the least amount on losses ?
SELECT "team" FROM table_203_30 WHERE "lost" = (SELECT MIN("lost") FROM table_203_30)
squall
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those products with a price between 60 and 120, a pie chart shows the proportion of name and manufacturer.
SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120
nvbench
CREATE TABLE table_name_67 ( date VARCHAR, status VARCHAR, opposing_teams VARCHAR )
On which date was the opponent ireland and the status Five Nations?
SELECT date FROM table_name_67 WHERE status = "five nations" AND opposing_teams = "ireland"
sql_create_context
CREATE TABLE table_12776 ( "Name" text, "Location" text, "Land" text, "Longest span in s metre ( feet )" text, "Arch type" text, "Completed" text )
Which bridge was completed in 1928?
SELECT "Name" FROM table_12776 WHERE "Completed" = '1928'
wikisql
CREATE TABLE table_name_35 ( date VARCHAR, record VARCHAR )
On which date was the record of 43.89 m set?
SELECT date FROM table_name_35 WHERE record = "43.89 m"
sql_create_context
CREATE TABLE table_80142 ( "Colt model no." text, "Diemaco model" text, "Stock" text, "Fire control" text, "Rear sight" text, "Forward assist" text, "Barrel length" text, "Barrel profile" text, "Barrel twist" text, "Hand guards" text, "Bayonet Lug" text, "Muzzle device" t...
Which Barrel twist has a Stock of canadian 3rd generation and a Hand guards of short ribbed?
SELECT "Barrel twist" FROM table_80142 WHERE "Stock" = 'canadian 3rd generation' AND "Hand guards" = 'short ribbed'
wikisql
CREATE TABLE table_262534_2 ( founded INTEGER, institution VARCHAR )
What year was the institution of St. Catharine College founded?
SELECT MIN(founded) FROM table_262534_2 WHERE institution = "St. Catharine College"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE diagnoses_i...
has the heart rate of patient 10624 ever less been on 09/04/last year than 75.0?
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d...
mimic_iii
CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(10), order_date DATETIME ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(10), customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(25...
Scatter. what are the staff ids and genders of all staffs whose job title is Department Manager?
SELECT T1.staff_id, T1.staff_gender FROM Staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = "Department Manager"
nvbench
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student_record ( studen...
Are there classes in PHIL that do not meet on Friday ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'PHIL' AND semester.semester = 'WN' AND s...
advising
CREATE TABLE table_34478 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" text )
What is the average of points for 8th place with draw more than 8?
SELECT AVG("Points") FROM table_34478 WHERE "Place" = '8th' AND "Draw" > '8'
wikisql
CREATE TABLE table_9022 ( "Level" real, "Shuttles" real, "Cumulative Shuttles" real, "Speed (km/h)" real, "Shuttle Time (seconds)" real, "Total level time (s)" real, "Distance (m)" real, "Cumulative Distance (m)" real, "Cumulative Time (min and seconds)" text )
What is the total Cumulative Distance in meters that has fewer than 8 shuttles and fewer than 7 cumulative shuttles?
SELECT COUNT("Cumulative Distance (m)") FROM table_9022 WHERE "Shuttles" < '8' AND "Cumulative Shuttles" < '7'
wikisql
CREATE TABLE table_204_422 ( id number, "rank" number, "lane" number, "name" text, "nationality" text, "time" text, "notes" text )
how many swimmers from china participated in the race ?
SELECT COUNT("name") FROM table_204_422 WHERE "nationality" = 'china'
squall
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...
Visualize a scatter chart about the correlation between Team_ID and All_Games_Percent , and group by attribute ACC_Regular_Season.
SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season
nvbench
CREATE TABLE table_29131 ( "Name" text, "Position" text, "Height" text, "Weight" real, "Age" real, "Home Town" text, "Team/School" text )
What player attended california university?
SELECT "Name" FROM table_29131 WHERE "Team/School" = 'California'
wikisql
CREATE TABLE table_33933 ( "Year" real, "Team" text, "Wins" real, "Points" real, "Championship Finish" text )
Which Wins is the highest one that has a Year larger than 1996, and a Championship Finish of 1st, and Points smaller than 168?
SELECT MAX("Wins") FROM table_33933 WHERE "Year" > '1996' AND "Championship Finish" = '1st' AND "Points" < '168'
wikisql
CREATE TABLE table_30960 ( "Episode" text, "First broadcast" text, "Andrew and Georgies guest" text, "Jamie and Johns guest Dermot OLeary replaced Jamie Redknapp as team captain for one week in series 3, episode 8." text, "Scores" text )
What was the score for the episode when Jamie and John's guest was Boris Becker?
SELECT "Scores" FROM table_30960 WHERE "Jamie and Johns guest Dermot OLeary replaced Jamie Redknapp as team captain for one week in series 3, episode 8." = 'Boris Becker'
wikisql
CREATE TABLE table_name_36 ( points INTEGER, december VARCHAR )
What are the average points that have december 27?
SELECT AVG(points) FROM table_name_36 WHERE december = 27
sql_create_context
CREATE TABLE table_2490 ( "Year" real, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
What was the report when the average speed (mph) was 87.599?
SELECT "Report" FROM table_2490 WHERE "Average Speed (mph)" = '87.599'
wikisql
CREATE TABLE table_75925 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What is the Region of the 1766390 Catalog?
SELECT "Region" FROM table_75925 WHERE "Catalog" = '1766390'
wikisql
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 procedures ( ...
how many of the male patients were treated with fluc100?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "FLUC100"
mimicsql_data
CREATE TABLE table_42562 ( "1861" real, "1866" real, "1872" real, "1876" real, "1881" real, "1886" real, "1891" real )
What is the total number of 1876(s), when 1872 is less than 1921, and when 1891 is less than 354?
SELECT COUNT("1876") FROM table_42562 WHERE "1872" < '1921' AND "1891" < '354'
wikisql
CREATE TABLE table_name_10 ( name VARCHAR, total_point VARCHAR, bonus VARCHAR, only_point VARCHAR )
What is Name, when Bonus is greater than 1, when Only Point is greater than 7, and when Total Point is less than 21?
SELECT name FROM table_name_10 WHERE bonus > 1 AND only_point > 7 AND total_point < 21
sql_create_context
CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE domain ( did int, name varchar ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE journal ( homepage var...
return me the domain where ' H. V. Jagadish ' is focused .
SELECT domain.name FROM author, domain, domain_author WHERE author.name = 'H. V. Jagadish' AND domain_author.aid = author.aid AND domain.did = domain_author.did
academic
CREATE TABLE table_name_50 ( goals_against INTEGER, played VARCHAR, position VARCHAR, drawn VARCHAR, lost VARCHAR )
Which Goals Against has a Drawn larger than 9, a Lost larger than 15, a Position of 24, and a Played smaller than 46?
SELECT AVG(goals_against) FROM table_name_50 WHERE drawn > 9 AND lost > 15 AND position = 24 AND played < 46
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ...
Most edited posts per user. Shows the edited posts by user
SELECT Posts.Id AS "post_link", Posts.Score, SUM(CASE PostHistory.PostHistoryTypeId WHEN 5 THEN 1 ELSE 0 END) AS Edits, Posts.CommunityOwnedDate AS Wiki FROM Posts LEFT JOIN PostHistory ON Posts.Id = PostHistory.PostId WHERE Posts.OwnerUserId = '##UserID:int##' GROUP BY Posts.Id, Posts.CommunityOwnedDate, Posts.Score O...
sede
CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), t...
Show me a bar chart for how many total credits are offered by each department?, and order by the names from low to high.
SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name ORDER BY dept_name
nvbench
CREATE TABLE table_1725 ( "Player" text, "League" real, "Scottish Cup" real, "League Cup" real, "Challenge Cup" real, "Total" real )
Name the league for paul paton
SELECT "League" FROM table_1725 WHERE "Player" = 'Paul Paton'
wikisql
CREATE TABLE table_name_57 ( date_of_birth__age_ VARCHAR, caps VARCHAR, name VARCHAR )
What is the date of birth and age of Gabriel Quak Jun Yi with 3 caps?
SELECT date_of_birth__age_ FROM table_name_57 WHERE caps = "3" AND name = "gabriel quak jun yi"
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, ...
what is average age of patients whose gender is m and age is greater than or equal to 24?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.age >= "24"
mimicsql_data
CREATE TABLE table_23670057_1 ( player VARCHAR, no VARCHAR )
name the player for number 5
SELECT player FROM table_23670057_1 WHERE no = 5
sql_create_context
CREATE TABLE table_51213 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How many people were in the crowd when the away team scored 17.17 (119)?
SELECT SUM("Crowd") FROM table_51213 WHERE "Away team score" = '17.17 (119)'
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...
哪些何静姝患者的检验报告单对应的检验结果指标均异常以及检验报告单号都是多少呢?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '何静姝' AND NOT ...
css
CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) C...
How many papers written on ImageNet ?
SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM dataset, paper, paperdataset WHERE dataset.datasetname LIKE 'ImageNet' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid
scholar
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...
provide the number of patients whose diagnoses short title is abn react-surg proc nec and lab test fluid is cerebrospinal fluid (csf)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Abn react-surg proc NEC" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE table_16799784_9 ( diameter__km_ VARCHAR, longitude VARCHAR )
At a longitude of 293.0e, what is the diameter, in km?
SELECT diameter__km_ FROM table_16799784_9 WHERE longitude = "293.0E"
sql_create_context
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE allergy_type ( allergy text, allergytype text )
What cities do students live in?
SELECT DISTINCT city_code FROM student
spider
CREATE TABLE table_3355 ( "meas. num." real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text )
What is every value for %yes when type is ref?
SELECT "% YES" FROM table_3355 WHERE "type" = 'Ref'
wikisql
CREATE TABLE table_15740666_6 ( kansas_state_vs VARCHAR, last_meeting VARCHAR )
who won the kansas state game on 11/26/1988
SELECT kansas_state_vs FROM table_15740666_6 WHERE last_meeting = "11/26/1988"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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_NA...
For those employees who was hired before 2002-06-21, show me about the distribution of job_id and the sum of department_id , and group by attribute job_id in a bar chart.
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID
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...
had patient 015-20584 undergone a normal saline solution - moderate volume resuscitation (150-250 mls/hr) procedure at any other hospital?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '015-20584' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '015-20584' AND patient.hospitaldischargetime IS NULL)) AND tr...
eicu
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 ) ...
provide the number of patients whose age is less than 51 and drug code is senn5l?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "51" AND prescriptions.formulary_drug_cd = "SENN5L"
mimicsql_data
CREATE TABLE table_17438 ( "#" real, "President" text, "Date of birth" text, "Date of inauguration" text, "Age at inauguration" text, "End of term" text, "Length of retirement" text, "Date of death" text, "Lifespan" text )
what's the date of birth with # being 2
SELECT "Date of birth" FROM table_17438 WHERE "#" = '2'
wikisql
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
What is the number of each allergie type that the student with first name Lisa has? Visualize by bar chart, display bar in asc order.
SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" GROUP BY AllergyType ORDER BY AllergyType
nvbench
CREATE TABLE table_name_46 ( team_1 VARCHAR )
What is the 2nd leg that Team 1 is Union Berlin?
SELECT 2 AS nd_leg FROM table_name_46 WHERE team_1 = "union berlin"
sql_create_context
CREATE TABLE table_17676 ( "Character" text, "Portrayed by" text, "Main cast seasons" text, "Recurring cast seasons" text, "# of episodes" real )
How many people named Nick Lucas are on the show?
SELECT COUNT("Portrayed by") FROM table_17676 WHERE "Character" = 'Nick Lucas'
wikisql
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
show me the flights from BOSTON to SAN FRANCISCO on UA
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE table_name_25 ( field_goals INTEGER, points VARCHAR, touchdowns VARCHAR, player VARCHAR )
What the average amount of field goals Clark has if he has less than 3 touch downs and less than 5 points?
SELECT AVG(field_goals) FROM table_name_25 WHERE touchdowns < 3 AND player = "clark" AND points < 5
sql_create_context
CREATE TABLE table_52058 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How many points did the home score at a game that had their opponents scoring 12.16 (88)?
SELECT "Home team score" FROM table_52058 WHERE "Away team score" = '12.16 (88)'
wikisql
CREATE TABLE table_23407 ( "Season" text, "Player" text, "Junior college" text, "State" text, "Position" text, "Class" text, "University" text )
in which season the position was center
SELECT "Season" FROM table_23407 WHERE "Position" = 'Center'
wikisql
CREATE TABLE table_17068 ( "Player" text, "Position" text, "School" text, "Hometown" text, "MLB Draft" text )
What pick was the player from Apopka, FL in the 2002 MLB draft
SELECT "MLB Draft" FROM table_17068 WHERE "Hometown" = 'Apopka, FL'
wikisql
CREATE TABLE table_70686 ( "Season" real, "Champion" text, "Motorcycle" text, "Wins" real, "2nd pl." real, "3rd pl." real, "Team" text )
what is the average season when results is less than 2 times in 2nd and more than 6 times in 3rd?
SELECT AVG("Season") FROM table_70686 WHERE "2nd pl." < '2' AND "3rd pl." > '6'
wikisql
CREATE TABLE table_name_76 ( boat_builder VARCHAR, number VARCHAR, year_built VARCHAR )
What is the boat builder for a boat built in 1994 and a number greater than 93?
SELECT boat_builder FROM table_name_76 WHERE number > 93 AND year_built = "1994"
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 patients born before 2087 were ordered urine lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2087" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_43245 ( "Position" text, "Jersey #" real, "Name" text, "Height (cm)" real, "Weight (kg)" real, "Birthdate" text, "Birthplace" text, "2006\u20132007 Team" text )
Which Jersey # has a Height (cm) of 183, a Name of paul stastny, and a Weight (kg) smaller than 93?
SELECT COUNT("Jersey #") FROM table_43245 WHERE "Height (cm)" = '183' AND "Name" = 'paul stastny' AND "Weight (kg)" < '93'
wikisql
CREATE TABLE table_name_22 ( player VARCHAR, score VARCHAR )
Which Player has a Score of 67-72-71-75=285?
SELECT player FROM table_name_22 WHERE score = 67 - 72 - 71 - 75 = 285
sql_create_context
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, ...
查一下郎晓燕这个病患在02年3月3日到14年6月18期间住了多少次院
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '郎晓燕' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-03-03' AND '2014-06-18' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '郎晓燕' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2002-03-03' AND '2014-06-18' AND fgwyjzb.CLINIC_TYPE = '住院'
css
CREATE TABLE table_name_47 ( substrate VARCHAR, omim VARCHAR )
Which substrate has an OMIM of 176000?
SELECT substrate FROM table_name_47 WHERE omim = 176000
sql_create_context
CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text ) CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE ...
What are the names of the different customers who have taken out a loan, ordered by the total amount that they have taken?
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount)
spider
CREATE TABLE table_32377 ( "Season" text, "Team" text, "League Apps" real, "League Goals" real, "Cup Apps" real, "Cup Goals" real )
How many cup goals for the season with more than 34 league apps?
SELECT AVG("Cup Goals") FROM table_32377 WHERE "League Apps" > '34'
wikisql
CREATE TABLE table_77030 ( "Rank" real, "Country" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
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_77030 WHERE "Bronze" < '5' AND "Country" = 'japan' AND "Silver" > '3'
wikisql
CREATE TABLE table_name_27 ( rank VARCHAR, reb_avg INTEGER )
How many ranks have a rebound average smaller than 6.1?
SELECT COUNT(rank) FROM table_name_27 WHERE reb_avg < 6.1
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,...
Calculate the maximum age of patients with overdose primary disease who had an emergency hospital admission.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "OVERDOSE"
mimicsql_data
CREATE TABLE table_4512 ( "STAPLE:" text, "Maize / Corn [A ]" text, "Rice [B ]" text, "Wheat [C ]" text, "Potato [D ]" text, "Cassava [E ]" text, "Soybean (Green) [F ]" text, "Sweet potato [G ]" text, "Yam [Y ]" text )
What is the Yam amount when the Maze/Corn amount is 1355?
SELECT "Yam [Y ]" FROM table_4512 WHERE "Maize / Corn [A ]" = '1355'
wikisql
CREATE TABLE table_19202 ( "Designation" text, "Bus width (bits)" real, "Channels" text, "Clock rate (MHz)" real, "Bandwidth (MB/s)" real )
Name the bus width bits when bandwidth mb/s is 3200
SELECT "Bus width (bits)" FROM table_19202 WHERE "Bandwidth (MB/s)" = '3200'
wikisql
CREATE TABLE table_25976 ( "Year" real, "Starts" real, "Wins" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
How many top 10 finishes did Ken Bouchard get in the year he won $17,695?
SELECT "Top 10" FROM table_25976 WHERE "Winnings" = '$17,695'
wikisql
CREATE TABLE table_9682 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the average attendance on october 3, 1976?
SELECT AVG("Attendance") FROM table_9682 WHERE "Date" = 'october 3, 1976'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE labevents ( ro...
what organism has been found in the first mini-bal exam of patient 31854 during this hospital encounter?
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854 AND admissions.dischtime IS NULL) AND microbiologyevents.spec_type_desc = 'mini-bal' AND NOT microbiologyevents.org_name IS NULL ORDER BY microbio...
mimic_iii
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(...
Show the number of documents for different budget type description in a bar chart.
SELECT Budget_Type_Description, COUNT(Budget_Type_Description) FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code GROUP BY Budget_Type_Description
nvbench
CREATE TABLE table_67264 ( "Title" text, "Studio" text, "Role" text, "Leading lady" text, "Director" text )
What role did John Wayne play in The Trail Beyond, directed by R.N. Bradbury?
SELECT "Role" FROM table_67264 WHERE "Director" = 'r.n. bradbury' AND "Title" = 'the trail beyond'
wikisql
CREATE TABLE table_1974545_1 ( nickname VARCHAR, enrollment VARCHAR )
Name the nickname for enrollment being 9000
SELECT nickname FROM table_1974545_1 WHERE enrollment = 9000
sql_create_context
CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor...
What are the number of the purchase details of transactions with amount bigger than 10000?, rank by the the number of purchase details from high to low.
SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY COUNT(purchase_details) DESC
nvbench
CREATE TABLE table_49823 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
What is the score for set 2 when the score of set 1 is 19 25?
SELECT "Set 2" FROM table_49823 WHERE "Set 1" = '19–25'
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...
这位患者68694812过往有过哪些异常情况么?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_27487336_1 ( rushing_yards_per_game VARCHAR, sacks VARCHAR )
What is every value for rushing yards per game if sacks if 25?
SELECT rushing_yards_per_game FROM table_27487336_1 WHERE sacks = "25"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many patients whose admission year is less than 2144 and diagnoses long title is dementia in conditions classified elsewhere without behavioral disturbance?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2144" AND diagnoses.long_title = "Dementia in conditions classified elsewhere without behavioral disturbance"
mimicsql_data
CREATE TABLE table_name_99 ( title VARCHAR, production_code VARCHAR )
What is the title of the episode with production code ad1c07?
SELECT title FROM table_name_99 WHERE production_code = "ad1c07"
sql_create_context
CREATE TABLE table_name_19 ( round VARCHAR, opponent VARCHAR, venue VARCHAR )
what round saw wakefield trinity wildcats u21 as the opponenet at belle vue?
SELECT round FROM table_name_19 WHERE opponent = "wakefield trinity wildcats u21" AND venue = "belle vue"
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...
provide the number of patients whose diagnoses long title is hypertrophy (benign) of prostate without urinary obstruction and other lower urinary tract symptom (luts) and lab test abnormal status is delta?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Hypertrophy (benign) of prostate without urinary obstruction and other lower urinary tract symptom (LUTS)" AND ...
mimicsql_data
CREATE TABLE table_48455 ( "Game" real, "Date" text, "Team" text, "Score" text, "Location Attendance" text, "Record" text )
What is the date of the game located in Madison Square Garden, when the team is Seattle and the game number is less than 6?
SELECT "Date" FROM table_48455 WHERE "Location Attendance" = 'madison square garden' AND "Game" < '6' AND "Team" = 'seattle'
wikisql
CREATE TABLE table_name_5 ( time VARCHAR, country VARCHAR )
What is the time for Brazil?
SELECT time FROM table_name_5 WHERE country = "brazil"
sql_create_context
CREATE TABLE table_name_86 ( passenger_load_factor___percentage_ VARCHAR, revenue__€m_ VARCHAR, profit____loss__before_tax__€m_ VARCHAR )
What Passenger Load Factor (%) that has a Revenue ( m) less than 958.6 and a Profit / (Loss) Before Tax ( m) of 1.1?
SELECT passenger_load_factor___percentage_ FROM table_name_86 WHERE revenue__€m_ < 958.6 AND profit____loss__before_tax__€m_ = "1.1"
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 ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDe...
Top Users by Location and Technology. List of Users in a given location using a given technology. Counts reputation only for votes on answers, ignores questions, comments, or reputation for accepted answers.
SELECT Users.Id AS "user_link", MAX(Users.Location) AS Location, COUNT(*) * 10 AS "technology_reputation", MAX(Users.Reputation) AS "total_reputation" FROM Votes JOIN Posts ON Votes.PostId = Posts.Id JOIN Users ON Posts.OwnerUserId = Users.Id AND Users.Id IN (SELECT Users.Id FROM Users WHERE Location LIKE ('%Romania%')...
sede
CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number, drink text ) CREATE TABLE appellations ( no number, appelation text, county text, state text, area text,...
What are the distinct names of wines with prices higher than any wine from John Anthony winery.
SELECT DISTINCT name FROM wine WHERE price > (SELECT MIN(price) FROM wine WHERE winery = "John Anthony")
spider
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
门诊诊断病人为疾病T07.283,她们的籍贯代码、名称以及相应人数分别是什么?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE txmzjzjlb.JZZDBM = 'T07.283' GROUP BY person_info.JGDM UNION SELECT...
css
CREATE TABLE table_61169 ( "Season" real, "Season premiere" text, "Season finale" text, "TV season" text, "Viewer rank (#)" text, "Households/Viewers (in millions)" real )
When did the season premiere that had a viewer rank of #6?
SELECT "Season premiere" FROM table_61169 WHERE "Viewer rank (#)" = '#6'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
查一查2010年4月17号到2017年8月10日的这段时间,手术记录排倒数的6个科室编码和名称
SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE STA_DATE BETWEEN '2010-04-17' AND '2017-08-10' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) LIMIT 6
css
CREATE TABLE table_72035 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
What was the score of the game when the record was 22 46?
SELECT "Score" FROM table_72035 WHERE "Record" = '22–46'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, cha...
when did patient 7476 come to the hospital via emergency room admit, the last time during the previous year?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 7476 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_3 ( rank INTEGER, sites VARCHAR, circuit VARCHAR )
what is the rank of the cinema when the number of sites is more than 62 and the circuit is cineplex entertainment?
SELECT SUM(rank) FROM table_name_3 WHERE sites > 62 AND circuit = "cineplex entertainment"
sql_create_context
CREATE TABLE table_train_68 ( "id" int, "sequential_organ_failure_assessment_sofa" int, "pregnancy_or_lactation" bool, "piro_predispose_infection_response_organ_dysfunction_score" int, "systolic_blood_pressure_sbp" int, "hypotension" bool, "age" float, "lactate" int, "NOUSE" float )
meet the sepsis alert criterion ( hypotension ( sbp < 90 after 2 l of fluids or lactate >= 4 ) or piro ( predispose, infection, response, organ dysfunction ) score >= 15 .
SELECT * FROM table_train_68 WHERE (hypotension = 1 OR systolic_blood_pressure_sbp < 90 OR lactate >= 4) OR piro_predispose_infection_response_organ_dysfunction_score >= 15
criteria2sql
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...
患者马浩浩的医疗记录中被开出不低于459.68元的药品有哪几次?查一下医疗就诊的编码
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '马浩浩' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 459.68)
css
CREATE TABLE table_5061 ( "Race" text, "Length" text, "Class" text, "Circuit" text, "Date" text )
Name the circuit with class of gts
SELECT "Circuit" FROM table_5061 WHERE "Class" = 'gts'
wikisql
CREATE TABLE table_name_13 ( date VARCHAR, tie_no VARCHAR )
What is the Date of Tie no 21?
SELECT date FROM table_name_13 WHERE tie_no = "21"
sql_create_context
CREATE TABLE table_63663 ( "Year" real, "Game" text, "Genre" text, "Platform(s)" text, "Developer(s)" text )
What year had Nintendo EAD, Monolith Soft as developers?
SELECT SUM("Year") FROM table_63663 WHERE "Developer(s)" = 'nintendo ead, monolith soft'
wikisql
CREATE TABLE table_22410780_1 ( performance_liaison VARCHAR, dramaturge VARCHAR )
Who were the performance liaisons for the dramaturge Chrisena Ricci?
SELECT performance_liaison FROM table_22410780_1 WHERE dramaturge = "Chrisena Ricci"
sql_create_context
CREATE TABLE table_name_58 ( manufacturer VARCHAR, engine_make_capacity VARCHAR, year VARCHAR )
Who manufactured the car with the jawa 249cc engine that was made in the years 1956-1963?
SELECT manufacturer FROM table_name_58 WHERE engine_make_capacity = "jawa 249cc" AND year = "1956-1963"
sql_create_context
CREATE TABLE table_15187735_6 ( segment_b VARCHAR, segment_d VARCHAR )
What is the Segment B when the Segment D is s Hammock?
SELECT segment_b FROM table_15187735_6 WHERE segment_d = "s Hammock"
sql_create_context
CREATE TABLE table_80439 ( "D 48 +" text, "D 47 +" text, "D 46 +" text, "D 45 O" text, "D 44 O" text, "D 43 \u221a" text, "D 42 \u221a" text, "D 41 \u221a" text )
What is the value of D 45 O when the value of D 44 O is majority?
SELECT "D 45 O" FROM table_80439 WHERE "D 44 O" = '← majority'
wikisql