context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_59 ( clubs_involved INTEGER, winners_from_previous_round VARCHAR, clubs_remaining VARCHAR )
How many clubs are involved when there are 4 winners from the previous rounds and more than 4 clubs remaining?
SELECT MIN(clubs_involved) FROM table_name_59 WHERE winners_from_previous_round = "4" AND clubs_remaining > 4
sql_create_context
CREATE TABLE d_icd_diagnoses ( 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id numb...
count how many times patient 69895 has had a urine out foley out on 02/10/2105.
SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 69895)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine out foley' A...
mimic_iii
CREATE TABLE research_staff ( staff_id number, employer_organisation_id number, staff_details text ) CREATE TABLE organisations ( organisation_id number, organisation_type text, organisation_details text ) CREATE TABLE project_staff ( staff_id number, project_id number, role_code t...
What are the details and id of the project with the most outcomes?
SELECT T1.project_details, T1.project_id FROM projects AS T1 JOIN project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_15 ( points INTEGER, goals_scored VARCHAR, goals_conceded VARCHAR, place VARCHAR )
what is the points when the goals conceded is less than 24, place is less than 6 and goals scored is less than 26?
SELECT SUM(points) FROM table_name_15 WHERE goals_conceded < 24 AND place < 6 AND goals_scored < 26
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number...
Top SO from seoul, south korea.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%seoul%' OR UPPER(Location) LIKE '%SEOUL%' OR Location LIKE '%Seoul%' AND Reputation >= 1000 ORDER BY Reputation DESC
sede
CREATE TABLE table_56647 ( "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text )
Who held the pole position in SPA-Francorchamps?
SELECT "Pole Position" FROM table_56647 WHERE "Location" = 'spa-francorchamps'
wikisql
CREATE TABLE table_32578 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was the home team when Carlton was the away team?
SELECT "Home team" FROM table_32578 WHERE "Away team" = 'carlton'
wikisql
CREATE TABLE table_2534387_10 ( prize VARCHAR, entries VARCHAR )
Name the prize pool for 706 (481 r, 346 a)
SELECT prize AS Pool FROM table_2534387_10 WHERE entries = "706 (481 R, 346 A)"
sql_create_context
CREATE TABLE table_40921 ( "Week" real, "Date" text, "Kickoff ( ET )" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "NFL.com Recap" text )
What is the Week when the kick off was at 4:05 pm, and the result was w 31 14?
SELECT "Week" FROM table_40921 WHERE "Kickoff ( ET )" = '4:05 pm' AND "Result" = 'w 31–14'
wikisql
CREATE TABLE table_name_26 ( home VARCHAR, date VARCHAR )
What's the stadium on November 8?
SELECT home FROM table_name_26 WHERE date = "november 8"
sql_create_context
CREATE TABLE table_50947 ( "Season" text, "Series" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
What is the lowest Wins, when Season is 2011, when Podiums is 1, and when Poles is less than 0?
SELECT MIN("Wins") FROM table_50947 WHERE "Season" = '2011' AND "Podiums" = '1' AND "Poles" < '0'
wikisql
CREATE TABLE table_16729071_1 ( week VARCHAR, attendance VARCHAR )
How many weeks had an attendance of 60038?
SELECT COUNT(week) FROM table_16729071_1 WHERE attendance = 60038
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, ...
give me the number of patients whose admission type is newborn 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.admission_type = "NEWBORN" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_41232 ( "Location" text, "Aircraft" text, "Tail number" text, "Aircraft damage" text, "Fatalities" text )
How many fatalities occurred for an unknown tail number?
SELECT "Fatalities" FROM table_41232 WHERE "Tail number" = 'unknown'
wikisql
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id num...
Average Time to Answer for a single user.
SELECT MAX(uss.userid) AS "user_link", AVG(uss.TTA) AS "average_time_to_answer" FROM (SELECT u.Id AS userid, p.Id, p.CreationDate AS acreat, p2.CreationDate AS qcreat, (CAST((JULIANDAY(CreationDate) - JULIANDAY(p2.CreationDate)) AS INT)) AS TTA, p.Score FROM Posts AS p INNER JOIN Posts AS p2 ON p.ParentId = p2.Id INNER...
sede
CREATE TABLE table_52703 ( "Player" text, "Rec." real, "Yards" real, "Avg." real, "TD's" real, "Long" real )
Which largest average had 1229 yards?
SELECT MAX("Avg.") FROM table_52703 WHERE "Yards" = '1229'
wikisql
CREATE TABLE table_66270 ( "School" text, "Mascot" text, "Location" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "County" text )
What county is Whiteland Community School in?
SELECT "County" FROM table_66270 WHERE "School" = 'whiteland community'
wikisql
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_...
cheapest airfare from ORLANDO to TACOMA
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ORLANDO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city...
atis
CREATE TABLE table_name_52 ( pos VARCHAR, asts INTEGER )
What's the pos for an asts less than 117?
SELECT pos FROM table_name_52 WHERE asts < 117
sql_create_context
CREATE TABLE table_53681 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total where the nation is South Africa (rsa) and bronze is less than 1?
SELECT SUM("Total") FROM table_53681 WHERE "Nation" = 'south africa (rsa)' AND "Bronze" < '1'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, countr...
Which instructor teaches SOC 324 ?
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'SOC' AND course.number = 324 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.of...
advising
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, econ...
i want to go and take a plane in ATLANTA and fly to BOSTON
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON...
atis
CREATE TABLE table_name_56 ( ties INTEGER, gp INTEGER )
What was the largest tie when the G.P was more than 5?
SELECT MAX(ties) FROM table_name_56 WHERE gp > 5
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskSt...
A list of the top 500 users with the highest average answer score excluding community wiki / closed posts. A list of the top 500 users with the highest average answer score excluding community wiki / closed posts or users with less than 10 answers
SELECT Users.Id AS "user_link", COUNT(Posts.Id) AS Questions, Users.Reputation AS Reputation, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_question_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, Use...
sede
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...
find the number of patients with left colon cancer primary disease who had urine test done.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "LEFT COLON CANCER" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
During the Summer , has MICRBIOL 440 ever been offered ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MICRBIOL' AND course.number = 440 AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester
advising
CREATE TABLE table_name_16 ( distance VARCHAR, event VARCHAR, location VARCHAR )
Which Distance has an Event of breaststroke, and a Location of beijing, chn?
SELECT distance FROM table_name_16 WHERE event = "breaststroke" AND location = "beijing, chn"
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...
医院6367701的非科室1908负责的所有医疗就诊在2009-05-23到2019-05-26内有哪些记录?
SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6367701' AND gwyjzb.IN_HOSP_DATE BETWEEN '2009-05-23' AND '2019-05-26' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6367701' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2009-05-23' AND '2019-05-26' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '636770...
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...
give me the number of elective hospital admission patients who had cardiopulmonary resuscitation, not otherwise specified.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Cardiopulmonary resuscitation, not otherwise specified"
mimicsql_data
CREATE TABLE table_203_853 ( id number, "date" text, "opponent" text, "home/away" text, "field" text, "result" text )
what was the total amount of wins that the bridgeport barrage had in 2002 ?
SELECT COUNT(*) FROM table_203_853 WHERE "result" = 'w'
squall
CREATE TABLE table_2677 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who was the opponent in the game in which Hakim Warrick (14) did the most high points?
SELECT "Team" FROM table_2677 WHERE "High points" = 'Hakim Warrick (14)'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutput...
what was the five most common specimen test that was given since 2102?
SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) >= '2102' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5
eicu
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 PostFeedback ( Id number, PostId number, IsAnonymous boolean, ...
Questions that would be orphaned by automated burnination of the [row] rag.
SELECT Id FROM Posts WHERE Tags = '<row>'
sede
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
名为任凌霜的病人有哪些检验报告单的检验结果指标均正常?列出这些检验报告的单号
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 Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, show me about the distribution of name and code , and group by attribute founder in a bar chart, rank in asc by the total number.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code
nvbench
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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 varc...
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, draw a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, rank by the Y-axis in descending.
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_79312 ( "Name" text, "Height" text, "Weight" text, "Spike" text, "2008 club" text )
what is the name when the 2008 club is uralochka?
SELECT "Name" FROM table_79312 WHERE "2008 club" = 'uralochka'
wikisql
CREATE TABLE table_19227 ( "Country/Territory" text, "Former pageant" text, "Last competed" real, "New pageant" text, "Franchise since" real )
which is the former pageant in the country where the new pageant is miss bahamas?
SELECT "Former pageant" FROM table_19227 WHERE "New pageant" = 'Miss Bahamas'
wikisql
CREATE TABLE table_18811741_15 ( podiums VARCHAR, stage_wins VARCHAR )
How many podiums for the driver with 18 stage wins?
SELECT COUNT(podiums) FROM table_18811741_15 WHERE stage_wins = 18
sql_create_context
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 school_id by acc regular season in a histogram, show in descending by the y axis.
SELECT ACC_Regular_Season, School_ID FROM basketball_match ORDER BY School_ID DESC
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
what's the name of the last test patient 008-10139 has received since 04/2104?
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-10139')) AND STRFTIME('%y-%m', lab.labresulttime) >= '2104-04' ORDER BY lab.labresult...
eicu
CREATE TABLE table_23010 ( "No." real, "State/Region" text, "Districts" real, "Town ships" real, "Cities/ Towns" real, "Wards" real, "Village groups" real, "Villages" real )
How many townships are there in region number 2?
SELECT MAX("Town ships") FROM table_23010 WHERE "No." = '2'
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...
患者59707759所有检验结果指标记录在2019年2月27日到2019年5月21日内,有什么检测方法?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_in...
css
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, Creatio...
select top 10 from Posts.
SELECT * FROM Posts WHERE ViewCount > 31000 AND ViewCount <= 33000 ORDER BY ViewCount DESC
sede
CREATE TABLE table_38472 ( "Storm name" text, "Dates active" text, "Max 1-min wind mph (km/h)" text, "Min. press. ( mbar )" text, "Damage (millions USD )" text, "Deaths" text )
What is the cost of 972 Min Press caused 52 death?
SELECT "Damage (millions USD )" FROM table_38472 WHERE "Min. press. ( mbar )" = '972' AND "Deaths" = '52'
wikisql
CREATE TABLE diagnoses ( 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 ) C...
how many patients have stayed in the hospital for more than 1 day?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "1"
mimicsql_data
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 )
Return a bar chart on what is the total revenue of each manufacturer?, could you sort by the bars from high to low?
SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name DESC
nvbench
CREATE TABLE table_name_61 ( outcome VARCHAR, date VARCHAR )
What Outcome happened on a Date that was 20 november 2011?
SELECT outcome FROM table_name_61 WHERE date = "20 november 2011"
sql_create_context
CREATE TABLE table_13737 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
With the title 'Memories by Moonlight', and a less than 39 number in season, and a greater than 66 number in series, who was the written by?
SELECT "Written by" FROM table_13737 WHERE "No. in series" > '66' AND "No. in season" < '39' AND "Title" = 'memories by moonlight'
wikisql
CREATE TABLE table_name_79 ( name VARCHAR, altitude__meters_ VARCHAR, range VARCHAR, rank VARCHAR )
What name is associated with a rank greater than 69, an altitude (meters) smaller than 2154, and a range of Sivorgfjella?
SELECT name FROM table_name_79 WHERE range = "sivorgfjella" AND rank > 69 AND altitude__meters_ < 2154
sql_create_context
CREATE TABLE table_name_99 ( gold INTEGER, bronze VARCHAR, silver VARCHAR )
Bronze of 2, and a Silver smaller than 0 then what is the sum of the gold?
SELECT SUM(gold) FROM table_name_99 WHERE bronze = 2 AND silver < 0
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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), ...
For those employees who did not have any job in the past, give me the comparison about the sum of salary over the job_id , and group by attribute job_id.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
how many patients stayed on the 517 ward since 2 years ago?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 517 AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-2 year')
eicu
CREATE TABLE table_name_65 ( goals INTEGER, player VARCHAR, tries VARCHAR )
What is the number of goals Dave Taylor, who has more than 1 tries, has?
SELECT SUM(goals) FROM table_name_65 WHERE player = "dave taylor" AND tries > 1
sql_create_context
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( program_id int, name v...
According to Other requirements which courses in Special African Art should be taken ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Special African Art%' OR course.description LIKE '%Special African Art%' OR course.name LIKE '%S...
advising
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
罗列出从00年10月18日到2005年2月27日内患者04312120所有检验结果指标记录的检测人为孙幼安的检验指标流水序号是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz...
css
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( ...
Suggested edits on a specific post.
SELECT Id AS "suggested_edit_link", CreationDate, OwnerUserId, Comment, Text, Title, Tags FROM SuggestedEdits WHERE PostId = '##postid?3376##' ORDER BY Id
sede
CREATE TABLE table_name_5 ( platform_s_ VARCHAR, year VARCHAR, director VARCHAR )
What is the platform of the 2010 game with Shuichiro Nishiya as director?
SELECT platform_s_ FROM table_name_5 WHERE year = 2010 AND director = "shuichiro nishiya"
sql_create_context
CREATE TABLE table_name_88 ( latin_commander VARCHAR, battle VARCHAR )
Who is the Latin Commander of the Siege of Constantinople?
SELECT latin_commander FROM table_name_88 WHERE battle = "siege of constantinople"
sql_create_context
CREATE TABLE table_23476 ( "#" real, "Title" text, "Maneater" text, "Television Premiere" text, "DVD release" text, "Writer" text, "Director" text, "Producer" text )
When was the dvd release directed by Billy O'Brien?
SELECT "DVD release" FROM table_23476 WHERE "Director" = 'Billy O''Brien'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
let me know the number of patients with drug code ris1l for whom pleural fluid lab test order was placed.
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 = "RIS1L" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_23649244_1 ( level VARCHAR, artist_1 VARCHAR, artist_2 VARCHAR )
Which level has marvin gaye as artist 1 and david bowie as artist 2?
SELECT level FROM table_23649244_1 WHERE artist_1 = "Marvin Gaye" AND artist_2 = "David Bowie"
sql_create_context
CREATE TABLE bank ( bname VARCHAR, branch_id VARCHAR ) CREATE TABLE loan ( branch_id VARCHAR )
Find the total amount of loans offered by each bank branch.
SELECT SUM(amount), T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname
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, ...
what is the total number of patients diagnosed with mal neo middle 3rd esoph who received drug via pb route.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Mal neo middle 3rd esoph" AND prescriptions.route = "PB"
mimicsql_data
CREATE TABLE table_18219 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "Opponent" text )
What year was incumbent Martin Lancaster elected?
SELECT MIN("Elected") FROM table_18219 WHERE "Incumbent" = 'Martin Lancaster'
wikisql
CREATE TABLE publication ( publication_id number, book_id number, publisher text, publication_date text, price number ) CREATE TABLE book ( book_id number, title text, issues number, writer text )
What are the titles of the books whose writer is not 'Elaine Lee'?
SELECT title FROM book WHERE writer <> "Elaine Lee"
spider
CREATE TABLE table_204_479 ( id number, "defendant" text, "arrested" text, "charge" text, "result" text, "sentence" text )
how many years was gordon larsen convicted to ?
SELECT "sentence" FROM table_204_479 WHERE "defendant" = 'gordon larsen'
squall
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
how did patient 14397 last be admitted to the hospital?
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 14397 ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_27091128_2 ( replaced_by VARCHAR, team VARCHAR )
Who replaced the previous manager of Altay?
SELECT replaced_by FROM table_27091128_2 WHERE team = "Altay"
sql_create_context
CREATE TABLE table_75055 ( "Rank" real, "Airport" text, "Code (IATA/ICAO)" text, "Total Cargo (Metric Tonnes)" real, "% Change" text )
What is the rank for ord/kord with more than 1,332,123 total cargo?
SELECT MIN("Rank") FROM table_75055 WHERE "Code (IATA/ICAO)" = 'ord/kord' AND "Total Cargo (Metric Tonnes)" > '1,332,123'
wikisql
CREATE TABLE table_56276 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the score of the away team who played the home team who scored 7.14 (56)?
SELECT "Away team score" FROM table_56276 WHERE "Home team score" = '7.14 (56)'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_re...
i'd like to see the fare code again QX
SELECT DISTINCT fare_basis_code FROM fare_basis WHERE fare_basis_code = 'QX'
atis
CREATE TABLE table_48633 ( "Source" text, "Dates administered" text, "Democrat: Christine Gregoire" text, "Republican: Dino Rossi" text, "Lead Margin" real )
What is the source of the poll that had Republican: Dino Rossi at 46%, Democrat: Christine Gregoire at 50%, and the lead margin was larger than 3?
SELECT "Source" FROM table_48633 WHERE "Republican: Dino Rossi" = '46%' AND "Lead Margin" > '3' AND "Democrat: Christine Gregoire" = '50%'
wikisql
CREATE TABLE table_6457 ( "Race" text, "Trophy" text, "Rider(s)" text, "Machine" text, "Year" real, "Average speed" text, "Time" text )
Who holds the time of 17:11.572?
SELECT "Race" FROM table_6457 WHERE "Time" = '17:11.572'
wikisql
CREATE TABLE table_10586064_2 ( county VARCHAR, precincts VARCHAR )
What is the county of precints 515?
SELECT county FROM table_10586064_2 WHERE precincts = 515
sql_create_context
CREATE TABLE table_name_30 ( weeks_on_chart__uk_ VARCHAR, entered_chart__uk_ VARCHAR )
How many weeks did the single that entered the charts 14 september 2002 stay on the charts ?
SELECT COUNT(weeks_on_chart__uk_) FROM table_name_30 WHERE entered_chart__uk_ = "14 september 2002"
sql_create_context
CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Tota...
Stacked bar chart of the number of country for with each Competition_type in each country
SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country
nvbench
CREATE TABLE table_203_413 ( id number, "rank" text, "city" text, "population" number, "area\n(km2)" number, "density\n(inhabitants/km2)" number, "altitude\n(mslm)" number )
how many cities do not have lower populations than valenza ?
SELECT COUNT("city") FROM table_203_413 WHERE "city" <> 'valenza' AND "population" >= (SELECT "population" FROM table_203_413 WHERE "city" = 'valenza')
squall
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
provide the number of patients whose diagnoses icd9 code is v1000 and lab test category is blood gas?
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.icd9_code = "V1000" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
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...
give me the number of patients whose marital status is widowed and lab test name is ck-mb index?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "CK-MB Index"
mimicsql_data
CREATE TABLE table_204_405 ( id number, "team 1" text, "agg." text, "team 2" text, "1st leg" text, "2nd leg" text )
how many ties occurred in the second round ?
SELECT COUNT(*) FROM table_204_405 WHERE "2nd leg" = "2nd leg"
squall
CREATE TABLE table_41218 ( "Ballarat FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the lowest draw that has less than 4 wins, 14 losses, and against more than 1836?
SELECT MIN("Draws") FROM table_41218 WHERE "Wins" < '4' AND "Losses" = '14' AND "Against" > '1836'
wikisql
CREATE TABLE Apartments ( apt_type_code VARCHAR, bathroom_count INTEGER )
Show the most common apartment type code among apartments with more than 1 bathroom.
SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_91 ( pick__number VARCHAR, college VARCHAR )
Which 2006 cfl draft pick played college ball at Idaho state?
SELECT pick__number FROM table_name_91 WHERE college = "idaho state"
sql_create_context
CREATE TABLE table_31346 ( "Season" text, "Division" text, "League Apps" real, "League Goals" real, "FA Cup Apps" real, "FA Cup Goals" real, "Other Apps" real, "Other Goals" real, "Total Apps" real, "Total Goals" real )
Name the total number of division for fa cups being 9
SELECT COUNT("Division") FROM table_31346 WHERE "FA Cup Apps" = '9'
wikisql
CREATE TABLE table_204_363 ( id number, "res." text, "record" text, "opponent" text, "method" text, "event" text, "date" text, "round" number, "time" text, "location" text, "notes" text )
what event comes after ufc 121 ?
SELECT "event" FROM table_204_363 WHERE id = (SELECT id FROM table_204_363 WHERE "event" = 'ufc 121') + 1
squall
CREATE TABLE table_36272 ( "Date" text, "Site" text, "Sport" text, "Winning team" text, "Series" text )
Which winning team has Iowa city as the site, and december 3, 2006 as the date?
SELECT "Winning team" FROM table_36272 WHERE "Site" = 'iowa city' AND "Date" = 'december 3, 2006'
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...
患者14484033在被门诊诊断为患有帕金森病性痴呆(震颤麻痹性痴呆)的时候其检测指标353555的结果定量及其单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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.Y...
css
CREATE TABLE table_26514 ( "Rank" real, "Dismissals" real, "Player" text, "Caught" real, "Stumped" real, "Matches" real, "Innings" real )
How many matches were 44?
SELECT COUNT("Dismissals") FROM table_26514 WHERE "Matches" = '44'
wikisql
CREATE TABLE table_name_19 ( rank INTEGER, nation VARCHAR, gold VARCHAR )
what is the highest rank for italy when gold is more than 1?
SELECT MAX(rank) FROM table_name_19 WHERE nation = "italy" AND gold > 1
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAno...
Usuarios que preguntan mucho y aceptan poco.
SELECT U.Id AS "user_link", U.DisplayName, COUNT(CASE WHEN P.AcceptedAnswerId IS NULL THEN 1 ELSE NULL END) AS PreguntasSinAceptar, COUNT(CASE WHEN NOT P.AcceptedAnswerId IS NULL THEN 1 ELSE NULL END) AS PreguntasAceptadas, U.LastAccessDate AS UltimoAcceso FROM Users AS U INNER JOIN Posts AS P ON U.Id = P.OwnerUserId W...
sede
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
how many rooms have king beds? Report the number for each decor type, and could you list x-axis from high to low order?
SELECT decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor ORDER BY decor DESC
nvbench
CREATE TABLE table_train_107 ( "id" int, "systolic_blood_pressure_sbp" int, "body_weight" float, "modified_hachinski_ischemia_scale" int, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "clinical_dementia_rating_cdr" float, "NOUSE" float )
blood pressure greater than 160 / 100 mmhg.
SELECT * FROM table_train_107 WHERE systolic_blood_pressure_sbp >= 160 OR diastolic_blood_pressure_dbp >= 100
criteria2sql
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, ...
Out of total number of patients who were newborn, how many of them had a lab test for urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_name_5 ( attendance INTEGER, week VARCHAR, result VARCHAR )
What is the attendance in a week earlier than 4, and result is w 31-20?
SELECT AVG(attendance) FROM table_name_5 WHERE week < 4 AND result = "w 31-20"
sql_create_context
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 hz_info ( KH text, KLX number...
在08年5月15日到08年10月14日内患者67621156所有检验结果指标记录中的检测方法是什么?
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 fgwyjzb ( 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, ...
编号是91530632的患者医疗费总额大于4446.07元的其医疗记录入院诊断疾病编码和名称,列出其都是什么?
SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '91530632' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 4446.07) UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '91530632' AND fgw...
css
CREATE TABLE table_63340 ( "Rank" text, "Rider" text, "Horse" text, "Nation" text, "Judge E" text, "Judge C" text, "Judge M" text, "Penalty Points" real )
what is the horse that ranked 69?
SELECT "Horse" FROM table_63340 WHERE "Rank" = '69'
wikisql
CREATE TABLE table_name_50 ( strain VARCHAR, genes VARCHAR )
Which strain has 1,312 genes?
SELECT strain FROM table_name_50 WHERE genes = "1,312"
sql_create_context
CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
在13年9月2日到21年5月16日这段时间里91296755号病患的所有检验结果指标记录中的都有什么检测方法?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_in...
css