context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_29395291_2 ( subscribers__2006___thousands_ VARCHAR, provider VARCHAR )
How many 2006 subscribers are named Vodafone?
SELECT COUNT(subscribers__2006___thousands_) FROM table_29395291_2 WHERE provider = "Vodafone"
sql_create_context
CREATE TABLE table_203_208 ( id number, "team" text, "location" text, "venue" text, "capacity" number, "position in 1993-94" number )
what was the name of the last team listed on this chart ?
SELECT "team" FROM table_203_208 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(10), order_date DATETIME ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Departments ( d...
what is the average price for each type of product?
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code
nvbench
CREATE TABLE table_name_14 ( date VARCHAR, home_team VARCHAR )
What was the date when South Melbourne was the home team?
SELECT date FROM table_name_14 WHERE home_team = "south melbourne"
sql_create_context
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, ...
what 's the earliest flight from DALLAS to HOUSTON
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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTO...
atis
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 admission time of subject name kelly gallardo?
SELECT demographic.admittime FROM demographic WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE table_45272 ( "Year" real, "Tournaments played" real, "Cuts made" real, "Wins" real, "Best finish" text, "Earnings ( $ )" real, "Money list rank" text )
how many times is the money list rank 221 and cuts more than 2?
SELECT COUNT("Tournaments played") FROM table_45272 WHERE "Money list rank" = '221' AND "Cuts made" > '2'
wikisql
CREATE TABLE election ( Committee VARCHAR, Party VARCHAR ) CREATE TABLE party ( Party_ID VARCHAR, Party VARCHAR )
Return all the committees that have delegates from Democratic party.
SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic"
sql_create_context
CREATE TABLE table_1507806_1 ( winning_score VARCHAR, year VARCHAR )
WHAT WAS THE WINNING SCORE IN YEAR 1922?
SELECT winning_score FROM table_1507806_1 WHERE year = 1922
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, ...
how many patients whose religion is jehovah's witness and diagnoses short title is lumbago?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.religion = "JEHOVAH'S WITNESS" AND diagnoses.short_title = "Lumbago"
mimicsql_data
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, ...
select top(50000) OwnerUserId, Body from posts ORDER BY posts.ViewCount DESC.
SELECT TOP(50000) AS OwnerUserId, Body FROM Posts ORDER BY Posts.ViewCount DESC
sede
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
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, a bar chart shows the distribution of hire_date and the amount of hire_date bin hire_date by weekday, and rank by the total number in descending.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY COUNT(HIRE_DATE) DESC
nvbench
CREATE TABLE table_34939 ( "Rank" real, "Airport" text, "Code (IATA/ICAO)" text, "Total Cargo (Metric Tonnes)" real, "% Change" text )
What is the full amount of Total Cargo (in Metric Tonnes) where the Code (IATA/ICAO) is pvg/zspd, and the rank is less than 3?
SELECT SUM("Total Cargo (Metric Tonnes)") FROM table_34939 WHERE "Code (IATA/ICAO)" = 'pvg/zspd' AND "Rank" < '3'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
白蛋白的参考值范围下限和上限在哪个数值范围内,门诊可诊断患者患有痴呆
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '痴呆' AND jyjgzbb.JCZBMC = '白蛋白' UNION SELECT jyjgzbb.CKZFWXX, jyj...
css
CREATE TABLE table_25583 ( "Rank" real, "Metropolitan area" text, "Principal city" text, "10,000+ places" real, "Densest incorporated place" text, "Density" text )
Name the density for pennsbury village
SELECT "Density" FROM table_25583 WHERE "Densest incorporated place" = 'Pennsbury Village'
wikisql
CREATE TABLE table_27753492_2 ( womens_doubles VARCHAR, mixed_doubles VARCHAR, tour VARCHAR )
Who were the womens doubles when the mixed doubles were zhang nan zhao yunlei on the tour all england super series?
SELECT womens_doubles FROM table_27753492_2 WHERE mixed_doubles = "Zhang Nan Zhao Yunlei" AND tour = "All England Super Series"
sql_create_context
CREATE TABLE table_75906 ( "RR Romaja" text, "M\u2013R Romaja" text, "Hangul/Chosongul" text, "Hanja" text, "Area" text, "Capital" text, "Region" text, "Country" text )
What is the RR Romaja for the province that has Hangul of and capital of Wonsan?
SELECT "RR Romaja" FROM table_75906 WHERE "Hangul/Chosongul" = '강원도' AND "Capital" = 'wonsan'
wikisql
CREATE TABLE submission ( submission_id number, scores number, author text, college text ) CREATE TABLE acceptance ( submission_id number, workshop_id number, result text ) CREATE TABLE workshop ( workshop_id number, date text, venue text, name text )
Which colleges have both authors with submission score above 90 and authors with submission score below 80?
SELECT college FROM submission WHERE scores > 90 INTERSECT SELECT college FROM submission WHERE scores < 80
spider
CREATE TABLE employment ( Company_ID int, People_ID int, Year_working int ) CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sales_in_Billion real, Profits_in_Billion real, Assets_in_Billion real, Market_Value_in_Billion real ) CREATE TAB...
Show the number of headquarters from each headquarters, and I want to rank by the X in asc.
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY Headquarters
nvbench
CREATE TABLE table_79933 ( "Year" real, "Awards" text, "Categorie" text, "Movie" text, "Result" text )
What was the categorie in 2002 at the Berlin international Film Festival that Danielle Darrieux was in?
SELECT "Categorie" FROM table_79933 WHERE "Year" = '2002' AND "Awards" = 'berlin international film festival'
wikisql
CREATE TABLE table_name_39 ( pick__number INTEGER, college VARCHAR )
What is buffalo's pick #?
SELECT MAX(pick__number) FROM table_name_39 WHERE college = "buffalo"
sql_create_context
CREATE TABLE table_203_452 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number )
what is the number of laps completed by neel jani ?
SELECT "laps" FROM table_203_452 WHERE "driver" = 'neel jani'
squall
CREATE TABLE table_11336756_6 ( population_area VARCHAR, remarks VARCHAR )
Which population areas have 'replaced by us 83' listed in their remarks section?
SELECT population_area FROM table_11336756_6 WHERE remarks = "Replaced by US 83"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
what is the cost of the diagnostic of facial bone fracture - maxillary fracture?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'facial bone fracture - maxillary fracture')
eicu
CREATE TABLE table_37926 ( "Date" text, "Time" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
On what date was the team's record 61-66?
SELECT "Date" FROM table_37926 WHERE "Record" = '61-66'
wikisql
CREATE TABLE dept_locations ( Dnumber INTEGER, Dlocation TEXT ) CREATE TABLE project ( Pname Text, Pnumber INTEGER, Plocation TEXT, Dnum INTEGER ) CREATE TABLE dependent ( Essn INTEGER, Dependent_name TEXT, Sex TEXT, Bdate TEXT, Relationship TEXT ) CREATE TABLE department ...
Find the number of employees of each gender whose salary is lower than 50000 Visualize by bar chart, could you rank in descending by the Sex?
SELECT Sex, COUNT(*) FROM employee WHERE Salary < 50000 GROUP BY Sex ORDER BY Sex DESC
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...
calculate the number of patients who stayed in ward 337 during this year.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 337 AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE state ( state_code text, state_name text, country_name text ) 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...
i would like to leave around 7 o'clock in the morning
SELECT DISTINCT flight_id FROM flight WHERE departure_time <= 730 AND departure_time >= 630
atis
CREATE TABLE table_name_78 ( bronze INTEGER, nation VARCHAR, gold VARCHAR, rank VARCHAR )
Which Bronze has a Gold smaller than 1, and a Rank of 17, and a Nation of china?
SELECT MAX(bronze) FROM table_name_78 WHERE gold < 1 AND rank = "17" AND nation = "china"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, Ta...
Highest Score on SO For Answered Question That Was Not Accepted.
WITH AnsweredQuestions AS (SELECT Id, AcceptedAnswerId FROM Posts WHERE PostTypeId = 1 AND NOT AcceptedAnswerId IS NULL), NonAcceptedAnswers AS (SELECT p.Id, p.ParentId, Score, RANK() OVER (ORDER BY Score DESC) AS ScoreRank FROM Posts AS p JOIN AnsweredQuestions AS aq ON p.ParentId = aq.Id WHERE p.PostTypeId = 2 AND p....
sede
CREATE TABLE table_14165 ( "Debut year" real, "Player" text, "Games" real, "Goals" real, "Years at club" text )
How many Goals have Games smaller than 6, and a Debut year of 1939, and Years at club of 1939, 1941?
SELECT COUNT("Goals") FROM table_14165 WHERE "Games" < '6' AND "Debut year" = '1939' AND "Years at club" = '1939, 1941'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE TagSynonyms ( Id number...
Users with over 2000 answers.
SELECT U.Id AS "user_link", COUNT(Pt.Id) AS ANSWERS FROM Users AS U, Posts AS P, PostHistory AS Ph, PostTypes AS Pt WHERE Pt.Id = Ph.PostHistoryTypeId AND U.Id = P.OwnerUserId AND P.Id = Ph.PostId AND Pt.Id = 2 GROUP BY U.Id HAVING COUNT(Pt.Id) > 2000 ORDER BY ANSWERS DESC
sede
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Posts ( Id number, PostTypeId number, Accepted...
Closed questions with highest (current) OP reputation.
SELECT Posts.Id AS "post_link", Posts.Id AS PostId, Posts.Score, Users.Id AS "user_link", Users.Id AS UserId, Users.Reputation AS UserReputation FROM Posts, Users WHERE Posts.OwnerUserId = Users.Id AND NOT Posts.ClosedDate IS NULL ORDER BY Users.Reputation DESC, Users.Id LIMIT 100
sede
CREATE TABLE table_name_71 ( tournament VARCHAR )
In the Hamburg Masters Tournament, during which Ji Nov k was absent(A) in 1996, how did he do in 2003?
SELECT 2003 FROM table_name_71 WHERE 1996 = "a" AND tournament = "hamburg masters"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
列出医院7148894中不同疾病的平均患者多大年龄,根据入院诊断疾病名称?
SELECT IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '7148894' GROUP BY IN_DIAG_DIS_NM
css
CREATE TABLE table_5226 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What's the score of the game with a Loss of Glavine (12-5) that more than 29,007 people attended?
SELECT "Score" FROM table_5226 WHERE "Attendance" > '29,007' AND "Loss" = 'glavine (12-5)'
wikisql
CREATE TABLE table_20601 ( "Country" text, "Donor payment" text, "Children per donor" text, "Donor anonymity" text, "Allowed recipients" text )
What is the country where there are 8 children per donor and no data for donor payments?
SELECT "Country" FROM table_20601 WHERE "Children per donor" = '8 children' AND "Donor payment" = 'no data'
wikisql
CREATE TABLE table_204_330 ( id number, "finished" text, "horse" text, "jockey" text, "trainer" text, "owner" text, "time / behind" text )
which was the last horse to finish ?
SELECT "horse" FROM table_204_330 ORDER BY "finished" DESC LIMIT 1
squall
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...
Next Winter , who is teaching Aesthetics ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN cou...
advising
CREATE TABLE table_203_346 ( id number, "date" text, "location" text, "venue" text, "opening act" text, "supporting" text )
were more concerts played in quebec or in british columbia ?
SELECT "location" FROM table_203_346 WHERE "location" IN ('quebec', 'british columbia') GROUP BY "location" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
哪些工号及姓名的医务人员在患者沈云梦就诊过程中为他检测地高辛的,时间是从0二年二月六日到0四年五月十二日
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZ...
css
CREATE TABLE table_203_485 ( id number, "year" text, "show" text, "role" text, "notes" text )
how many total television shows has gauri starred in ?
SELECT COUNT("show") FROM table_203_485
squall
CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE t...
Show the name of all trains, count the name and show them with a bar chart, could you rank in asc by the X please?
SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY Name
nvbench
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 whose primary disease is sternal wound infection and lab test category is hematology?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "STERNAL WOUND INFECTION" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_name_70 ( results¹ VARCHAR, city VARCHAR )
What's the result of the game played in Belgrade?
SELECT results¹ FROM table_name_70 WHERE city = "belgrade"
sql_create_context
CREATE TABLE table_name_94 ( sundsvall VARCHAR, falun VARCHAR )
What did Sundsvall score when Falun scored 2?
SELECT sundsvall FROM table_name_94 WHERE falun = "2"
sql_create_context
CREATE TABLE table_35823 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text )
what are the results of the opponent of spain?
SELECT "Results\u00b9" FROM table_35823 WHERE "Opponent" = 'spain'
wikisql
CREATE TABLE table_name_70 ( week INTEGER, date VARCHAR, attendance VARCHAR )
What is the lowest week that has September 19, 1965 as the date, with an attendance less than 46,941?
SELECT MIN(week) FROM table_name_70 WHERE date = "september 19, 1965" AND attendance < 46 OFFSET 941
sql_create_context
CREATE TABLE table_55952 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Where week is greater than 14 and Opponent is Dallas Cowboys, what is the result?
SELECT "Result" FROM table_55952 WHERE "Week" > '14' AND "Opponent" = 'dallas cowboys'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
03652738号患者在02年3月6日到04月10月25日期间其所有检验结果指标记录中的检测方法是啥呢?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE table_59630 ( "Round" text, "Date" text, "Event" text, "Circuit" text, "Winning Driver" text, "Winning Team" text )
Who was the winning team on May 12?
SELECT "Winning Team" FROM table_59630 WHERE "Date" = 'may 12'
wikisql
CREATE TABLE table_name_30 ( score VARCHAR, match_no VARCHAR )
What is the score of match 15?
SELECT score FROM table_name_30 WHERE match_no = "15"
sql_create_context
CREATE TABLE table_name_8 ( name VARCHAR, term_expires VARCHAR, appointing_governor VARCHAR )
Which person has an expiring term of December 31, 2020, and has Terry Branstad as the appointing governor?
SELECT name FROM table_name_8 WHERE term_expires = "december 31, 2020" AND appointing_governor = "terry branstad"
sql_create_context
CREATE TABLE table_name_22 ( draws INTEGER, against VARCHAR, losses VARCHAR, geelong_fl VARCHAR )
What is the largest number of draws of St Josephs with losses greater than 6 and less than 1250 against?
SELECT MAX(draws) FROM table_name_22 WHERE losses > 6 AND geelong_fl = "st josephs" AND against < 1250
sql_create_context
CREATE TABLE table_76585 ( "2006/ 07" text, "2008/ 09" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text )
What is 2008/09, when 2010/11 is UR?
SELECT "2008/ 09" FROM table_76585 WHERE "2010/ 11" = 'ur'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate ti...
how many hours have elapsed since the first time patient 92788 was prescribed gabapentin during their current hospital encounter.
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92788 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'gabapentin' ORDER BY prescriptions.startdate...
mimic_iii
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
Bar graph to show the average of age from different gender, and I want to show by the bars in desc.
SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY gender DESC
nvbench
CREATE TABLE table_11870 ( "Name" text, "Premiere" text, "Finale" text, "Original teams" text, "The Biggest Loser" text, "At-Home Winner" text )
What was the premiere date of the season won by Matt Hoover?
SELECT "Premiere" FROM table_11870 WHERE "The Biggest Loser" = 'matt hoover'
wikisql
CREATE TABLE table_name_84 ( original_air_date VARCHAR, title VARCHAR )
When did Julie gets Validated originally air?
SELECT original_air_date FROM table_name_84 WHERE title = "julie gets validated"
sql_create_context
CREATE TABLE table_56074 ( "Round" real, "Overall" text, "Player" text, "Position" text, "Nationality" text, "Club team" text )
What is the highest round of a player from Sweden who plays right wing?
SELECT MAX("Round") FROM table_56074 WHERE "Nationality" = 'sweden' AND "Position" = 'right wing'
wikisql
CREATE TABLE table_name_60 ( college VARCHAR, overall VARCHAR, name VARCHAR )
What college did jerry hackenbruck come from who had an overall pick less than 344?
SELECT college FROM table_name_60 WHERE overall < 344 AND name = "jerry hackenbruck"
sql_create_context
CREATE TABLE table_79195 ( "Rank" text, "Capacity" real, "City" text, "State" text, "Year opened" text )
What was the year opened for North Carolina with a smaller than 21,500 capacity?
SELECT "Year opened" FROM table_79195 WHERE "State" = 'north carolina' AND "Capacity" < '21,500'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description...
Get Reputation of Users Whose Questions You've Answered. This query will look for all your answers, and get the Users and Reputations of the Users whose questions you've answered.
SELECT X.*, u.Reputation FROM (SELECT q.OwnerUserId AS "user_link" FROM Posts AS a JOIN Posts AS q ON q.Id = a.ParentId WHERE a.PostTypeId = 2 AND a.OwnerUserId = '##UserId##') AS X JOIN Users AS u ON u.Id = 'user_link'
sede
CREATE TABLE movie ( movie_id number, title text, year number, director text, budget_million number, gross_worldwide number ) CREATE TABLE book_club ( book_club_id number, year number, author_or_editor text, book_title text, publisher text, category text, result text...
What are all company names that have a corresponding movie directed in the year 1999?
SELECT T2.company_name FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.year = 1999
spider
CREATE TABLE table_203_354 ( id number, "party" text, "candidate(s)" text, "votes" number, "percentage" number )
which party received the most votes ?
SELECT "party" FROM table_203_354 ORDER BY "votes" DESC LIMIT 1
squall
CREATE TABLE people ( Name VARCHAR, People_ID VARCHAR ) CREATE TABLE body_builder ( People_ID VARCHAR, Total VARCHAR )
What are the names of body builders in descending order of total scores?
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
how many black/cape verdean patients have procedure icd9 code 8674?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.icd9_code = "8674"
mimicsql_data
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1...
Show all the buildings along with the number of faculty members the buildings have with a bar chart, and could you display in desc by the y-axis?
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_204_587 ( id number, "drop(s)" text, "multiplayer map(s)" text, "spec ops mission(s)" text, "face off map(s)" text, "xbox 360 release date" text, "playstation 3 release date" text )
tell me the number of face off maps .
SELECT SUM("face off map(s)") FROM table_204_587
squall
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time,...
how many patients had been discharged from the hospital last year.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_name_63 ( res VARCHAR, time VARCHAR )
What is the result for the match that was only 2:48 long?
SELECT res FROM table_name_63 WHERE time = "2:48"
sql_create_context
CREATE TABLE table_13741576_6 ( drawn VARCHAR, tries_for VARCHAR )
Risca RFC has 54 tries for and how many draws?
SELECT drawn FROM table_13741576_6 WHERE tries_for = "54"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
名叫马文敏的患者抓过的药品盐酸帕罗西汀片都是在什么医院开的?
SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '马文敏' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '盐酸帕罗西汀片') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '马文敏' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_I...
css
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
what is the five most commonly performed procedure for patients aged 30s since 2103?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
CREATE TABLE manager ( manager_id number, name text, country text, working_year_starts text, age number, level number ) CREATE TABLE train ( train_id number, train_num text, name text, from text, arrival text, railway_id number ) CREATE TABLE railway_manage ( railwa...
List the builders of railways in ascending alphabetical order.
SELECT builder FROM railway ORDER BY builder
spider
CREATE TABLE table_40254 ( "Spoofed Title" text, "Actual Title" text, "Writer" text, "Artist" text, "Issue" real, "Date" text )
Which Spoofed title is from February 1998?
SELECT "Spoofed Title" FROM table_40254 WHERE "Date" = 'february 1998'
wikisql
CREATE TABLE table_2162 ( "#" real, "Player" text, "Age" text, "Australian Open" real, "French Open" real, "Wimbledon" real, "US Open" real )
When was the Australian open?
SELECT MAX("Australian Open") FROM table_2162
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 a bar chart for what are the total enrollments of universities of each affiliation type?, display by the y axis from low to high please.
SELECT Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY SUM(Enrollment)
nvbench
CREATE TABLE table_26342 ( "Music Library" text, "Year" real, "Media type" text, "Name of the media" text, "Composition name" text, "Composer" text, "Genre" text )
What is every media type for the Psychedelic Trance genre?
SELECT "Media type" FROM table_26342 WHERE "Genre" = 'Psychedelic Trance'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
what is one year survival rate of patients diagnosed with dvt - spontaneous?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
CREATE TABLE table_35469 ( "Stage" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Young rider classification" text )
What is the point classification with chris anker s rensen as the young rider classification and Christian vande velde as the general classification?
SELECT "Points classification" FROM table_35469 WHERE "Young rider classification" = 'chris anker sørensen' AND "General classification" = 'christian vande velde'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid nu...
what is the maximum number of daily diagnosed cases of rash, infectious - candida dermatitis in this year?
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'rash, infectious - candida dermatitis' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY STRFTIME('%y-%m-%d', diagnosis.di...
eicu
CREATE TABLE table_63259 ( "Draw" real, "Artist" text, "Song" text, "Percentage" text, "Place" real )
What Artist had a Percentage of 17.14%?
SELECT "Artist" FROM table_63259 WHERE "Percentage" = '17.14%'
wikisql
CREATE TABLE table_name_4 ( discovery VARCHAR, operator_s_ VARCHAR )
Which Discoveryhas an Operator(s) of lundin?
SELECT discovery FROM table_name_4 WHERE operator_s_ = "lundin"
sql_create_context
CREATE TABLE table_name_78 ( position VARCHAR, current_club VARCHAR )
What is the Position of the Player from the Toronto Raptors?
SELECT position FROM table_name_78 WHERE current_club = "toronto raptors"
sql_create_context
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
A bar chart about the average of maximum price of wines each year, bin the year into the weekday interval.
SELECT Year, AVG(MAX(Price)) FROM wine
nvbench
CREATE TABLE table_39731 ( "Code" text, "Years" text, "Displacement (bore x stroke)/Type" text, "Power@rpm" text, "torque@rpm" text, "Compression (:1)" text )
Code of 1.6 duratec ti-vct, and a Power@rpm of ps (kw; hp)@6300 has what torque@rpm?
SELECT "torque@rpm" FROM table_39731 WHERE "Code" = '1.6 duratec ti-vct' AND "Power@rpm" = 'ps (kw; hp)@6300'
wikisql
CREATE TABLE table_54430 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" real, "Club/province" text )
Which player on the Bulls has a 6 May 1978 birthday?
SELECT "Player" FROM table_54430 WHERE "Club/province" = 'bulls' AND "Date of Birth (Age)" = '6 may 1978'
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 primary disease is left internal jugular vein thrombosis;left arm edema and year of death is less than or equal to 2131?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" AND demographic.dod_year <= "2131.0"
mimicsql_data
CREATE TABLE table_67364 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the largest total with a Silver of 1, and a Rank larger than 7?
SELECT MAX("Total") FROM table_67364 WHERE "Silver" = '1' AND "Rank" > '7'
wikisql
CREATE TABLE table_60627 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the week number for the date of September 14, 1980?
SELECT MAX("Week") FROM table_60627 WHERE "Date" = 'september 14, 1980'
wikisql
CREATE TABLE table_2342078_4 ( directed_by VARCHAR, written_by VARCHAR )
List all directors when Brad Radnitz was the writer?
SELECT directed_by FROM table_2342078_4 WHERE written_by = "Brad Radnitz"
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...
count the number of patients whose discharge locations is snf and diagnosis long title is cerebral artery occlusion, unspecified with cerebral infarction.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "SNF" AND diagnoses.long_title = "Cerebral artery occlusion, unspecified with cerebral infarction"
mimicsql_data
CREATE TABLE table_204_266 ( id number, "#" number, "event year" number, "season" text, "flag bearer" text )
which female athlete has been the flag bearer for georgia in the olympics twice ?
SELECT "flag bearer" FROM table_204_266 GROUP BY "flag bearer" HAVING COUNT(*) = 2
squall
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,...
就诊结算日期在13年11月17日到14年4月24日内的患者29469375所有医疗就诊记录编号分别是有哪些?
SELECT MED_CLINIC_ID FROM t_kc24 WHERE PERSON_ID = '29469375' AND CLINIC_SLT_DATE BETWEEN '2013-11-17' AND '2014-04-24'
css
CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real...
Give me a pie to show how many competition type from different competition type.
SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type
nvbench
CREATE TABLE table_45040 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College/junior/club team" text )
What was the College/junior/club team of the player with the united states nationality?
SELECT "College/junior/club team" FROM table_45040 WHERE "Nationality" = 'united states'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( 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...
在患者朱安翔吃药期间吃的药品均高于6593.0元的时候在其医疗记录里有多少次?医疗的就诊编号是多些?
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 <= 6593.0)
css
CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number )...
What is the salaray and name of the employee that is certified to fly the most planes?
SELECT T1.name, T1.salary FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY COUNT(*) DESC LIMIT 1
spider
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...
医疗机构7573983就诊人数里,外地来的有多少
SELECT COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE MED_SER_ORG_NO = '7573983' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')
css