table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_55487 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
When was andrea g miz the opponent?
SELECT "Date" FROM table_55487 WHERE "Opponent" = 'andrea gámiz'
CREATE TABLE table_name_7 ( opponent VARCHAR, score VARCHAR )
Name the opponent with score of 1 6, 6 4, 6 4
SELECT opponent FROM table_name_7 WHERE score = "1–6, 6–4, 6–4"
CREATE TABLE table_10428 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the mean number of laps where time/retired was +1:05.564?
SELECT AVG("Laps") FROM table_10428 WHERE "Time/Retired" = '+1:05.564'
CREATE TABLE table_27116696_1 ( us_viewers__million_ VARCHAR, directed_by VARCHAR )
How many U.S. viewers (million) watched the episode directed by Allison Liddi-Brown?
SELECT us_viewers__million_ FROM table_27116696_1 WHERE directed_by = "Allison Liddi-Brown"
CREATE TABLE table_11634 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When playing at the Kardinia Park; what was the home teams score?
SELECT "Home team score" FROM table_11634 WHERE "Venue" = 'kardinia park'
CREATE TABLE ship ( ship_id number, name text, type text, built_year number, class text, flag text ) CREATE TABLE captain ( captain_id number, name text, ship_id number, age text, class text, rank text )
Find the captain rank that has no captain in Third-rate ship of the line class.
SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE class = 'Third-rate ship of the line'
CREATE TABLE table_2715355_1 ( total_prize_pool VARCHAR, location VARCHAR )
What was the prize pool in New Orleans?
SELECT total_prize_pool FROM table_2715355_1 WHERE location = "New Orleans"
CREATE TABLE Addresses ( Address_ID VARCHAR(100), Line_1 VARCHAR(255), Line_2 VARCHAR(255), City_Town VARCHAR(255), State_County VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Service_Types ( Service_Type_Code CHAR(15), Parent_Service_Type_Code CHAR(15), Service_Type_De...
A bar chart for what are the number of the order dates of orders with price higher than 1000?
SELECT Order_Date, COUNT(Order_Date) FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_Price > 1000
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), ...
Draw a bar chart of first name versus manager_id, could you rank in desc by the y-axis?
SELECT FIRST_NAME, MANAGER_ID FROM employees ORDER BY MANAGER_ID DESC
CREATE TABLE table_33527 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" real )
What was CTE Racing-hvm's Best with a Qual 2 of 50.312?
SELECT "Best" FROM table_33527 WHERE "Team" = 'cte racing-hvm' AND "Qual 2" = '50.312'
CREATE TABLE table_25352324_5 ( points VARCHAR, rebounds VARCHAR, blocks VARCHAR )
What is every value for points if rebounds is 6 and blocks is 0?
SELECT points FROM table_25352324_5 WHERE rebounds = 6 AND blocks = 0
CREATE TABLE table_77328 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
WHAT IS THE TO PAR WITH A FINISH OF T11, FOR DAVID GRAHAM?
SELECT "To par" FROM table_77328 WHERE "Finish" = 't11' AND "Player" = 'david graham'
CREATE TABLE table_76537 ( "Scorer" text, "Club" text, "League goals" text, "FA Cup goals" text, "League Cup goals" real, "Texaco Cup goals" text, "Euro competitions" text, "Total" real )
What is the total number of Total, when Club is Leeds United, and when League Goals is 13?
SELECT COUNT("Total") FROM table_76537 WHERE "Club" = 'leeds united' AND "League goals" = '13'
CREATE TABLE table_54804 ( "Frequency" text, "Call sign" text, "Name" text, "Format" text, "Owner" text )
Which owner has the frequency of 103.3 FM?
SELECT "Owner" FROM table_54804 WHERE "Frequency" = '103.3 fm'
CREATE TABLE table_7905 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" text, "Competition" text, "Man of the Match" text )
What Away Competition had a Result of lost 2-4?
SELECT "Competition" FROM table_7905 WHERE "Venue" = 'away' AND "Result" = 'lost 2-4'
CREATE TABLE table_17582 ( "Season" text, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
Who won the Mens Singles when the Mixed doubles went to Stellan Mohlin Kerstin St hl , Aik?
SELECT "Mens singles" FROM table_17582 WHERE "Mixed doubles" = 'Stellan Mohlin Kerstin Ståhl , AIK'
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
tell me the number of patients who had been prescribed potassium chloride inj this year.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'potassium chloride inj' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
CREATE TABLE table_261895_1 ( institution VARCHAR, type VARCHAR )
which institutions can be categorized as private/united church of christ?
SELECT institution FROM table_261895_1 WHERE type = "Private/United Church of Christ"
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_stop ( flight_id in...
give me the cheapest one way flights between BOSTON and PHILADELPHIA which arrive after 1200 on a TUESDAY
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, days, fare, flight, flight_fare WHERE ((((((flight.arrival_time < flight.departure_time) AND days.day_name = 'MONDAY' AND flight.flight_days = days.days_code) OR (days.day_na...
CREATE TABLE table_12125069_2 ( winning_pitcher VARCHAR, attendance VARCHAR )
Who is the winning pitcher when attendance is 38109?
SELECT winning_pitcher FROM table_12125069_2 WHERE attendance = 38109
CREATE TABLE table_name_20 ( score VARCHAR, place VARCHAR, player VARCHAR )
What is score of the game played in place t8 with Byron Nelson playing?
SELECT score FROM table_name_20 WHERE place = "t8" AND player = "byron nelson"
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time,...
what were the top five most common output events a year before?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY outputevents.itemid) AS...
CREATE TABLE table_25319 ( "Game" text, "Date" text, "Champion" text, "Score" text, "Runner Up" text, "Stadium" text, "City" text, "Ted Morris Memorial Trophy (Game MVP)" text, "Bruce Coulter Award" text )
Name the ted morris memorial trophy 34th game
SELECT "Ted Morris Memorial Trophy (Game MVP)" FROM table_25319 WHERE "Game" = '34th'
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE field ( fie...
coauthors of Noah A Smith
SELECT DISTINCT AUTHOR_1.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Noah A Smith' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejectio...
Developer in Israel That Do C++/C#. Users with Israel in their location who are active in C++/C#, sorted by rep (having more than 100 rep)
SELECT Users.DisplayName, Users.Reputation, Users.Id AS ID, Users.WebsiteUrl FROM Users JOIN (SELECT Users.Id AS UserId FROM Posts JOIN PostTags ON Posts.Id = PostTags.PostId JOIN Users ON Users.Id = Posts.OwnerUserId WHERE (PostTags.TagId = 10 OR PostTags.TagId = 9) GROUP BY Users.Id) AS TopicUsers ON UserId = Users.I...
CREATE TABLE table_49338 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
what is the to par for Dave hill?
SELECT "To par" FROM table_49338 WHERE "Player" = 'dave hill'
CREATE TABLE table_60943 ( "Place" real, "Nation" text, "All Around" real, "Final" real, "Total" real )
What is the average final with an all around greater than 19.35 and a total over 40?
SELECT AVG("Final") FROM table_60943 WHERE "All Around" > '19.35' AND "Total" > '40'
CREATE TABLE table_name_86 ( opponent VARCHAR, score VARCHAR )
who is the opponent when the score is 7 5, 7 6 (8 6)?
SELECT opponent FROM table_name_86 WHERE score = "7–5, 7–6 (8–6)"
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, ...
What teachers are offering Other classes next Winter ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
CREATE TABLE grapes ( id number, grape text, color text ) 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 numbe...
Give the maximum price and score for wines produced in the appelation St. Helena.
SELECT MAX(price), MAX(score) FROM wine WHERE appelation = "St. Helena"
CREATE TABLE table_22083 ( "Birth Name" text, "Birth Name As Announced in Latin (Accusative case Forename Undeclined Surname)" text, "Papal Name" text, "Papal Name As Announced in Latin" text, "Latin declension of Papal Name" text, "Numeral in Papal Name" text )
What is the Papal name of the Pope announced as Ioannis Pauli Primi?
SELECT "Papal Name" FROM table_22083 WHERE "Papal Name As Announced in Latin" = 'Ioannis Pauli primi'
CREATE TABLE table_name_24 ( attendance VARCHAR, home_team VARCHAR )
What is the attendance of the match with F.C. central chugoku as the home team?
SELECT attendance FROM table_name_24 WHERE home_team = "f.c. central chugoku"
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
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, give me the comparison about the average of department_id over the hire_date bin hire_date by weekday by a bar chart.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
CREATE TABLE table_49040 ( "Name (English)" text, "Name (German)" text, "Abbr." text, "Ideology" text, "Position" text, "Votes (2011)" text, "Seats in Hamburgische B\u00fcrgerschaft" real )
WHAT IS THE ABBR WITH VOTES OF 11.2% IN 2011?
SELECT "Abbr." FROM table_49040 WHERE "Votes (2011)" = '11.2%'
CREATE TABLE table_name_55 ( athlete VARCHAR, punishment VARCHAR )
Which athlete had a six month suspension from IIHF?
SELECT athlete FROM table_name_55 WHERE punishment = "six month suspension from iihf"
CREATE TABLE table_12086 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
Can you tell me the sum of Money ($) that has the Score of 69-72-67-71=279, and the Player of loren roberts?
SELECT SUM("Money ( $ )") FROM table_12086 WHERE "Score" = '69-72-67-71=279' AND "Player" = 'loren roberts'
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 prescriptions...
look for the number of patients taking drug via pr route who were admitted before 2155.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2155" AND prescriptions.route = "PR"
CREATE TABLE table_name_6 ( location_attendance VARCHAR, record VARCHAR )
What is the location and attendance of the game with a 3-1-0 record?
SELECT location_attendance FROM table_name_6 WHERE record = "3-1-0"
CREATE TABLE table_27768 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text )
What is the title of the episode directed by Linda Mendoza?
SELECT "Title" FROM table_27768 WHERE "Directed by" = 'Linda Mendoza'
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_star...
What is the number of booking start dates of the apartments with type code 'Duplex' in each year? Return a bar chart, show y axis in ascending order.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex" ORDER BY COUNT(booking_start_date)
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
give me the number of patients admitted to the hospital before 2167 with the procedure icd9 code 3532.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2167" AND procedures.icd9_code = "3532"
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 ethnicity is asian and year of death is less than or equal to 2155?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dod_year <= "2155.0"
CREATE TABLE table_name_49 ( wins INTEGER, starts VARCHAR, podiums VARCHAR, points VARCHAR )
what is the average wins when the podiums is more than 1, points is 80 and starts is less than 28?
SELECT AVG(wins) FROM table_name_49 WHERE podiums > 1 AND points = 80 AND starts < 28
CREATE TABLE table_75309 ( "Season" text, "Season Premiere" text, "Season Finale" text, "Winner" text, "Runner-up" text, "Number of Contestants" real, "Winner's Country" text, "Runner Up's Country" text )
How many contestants were there on March 1, 2009 during the season premiere?
SELECT SUM("Number of Contestants") FROM table_75309 WHERE "Season Premiere" = 'march 1, 2009'
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, t...
What intelligent systems classes are required prior to taking 463 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.pre_course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.course_id INNER JOIN area ON COURSE_0.course_id = area.course_id ...
CREATE TABLE table_23083 ( "Scorecard" real, "Date" text, "Venue" text, "Team 1" text, "Team 2" text, "Result" text, "Man of the Match" text )
Who was the man of the match when the Rockets won by 9 wickets?
SELECT "Man of the Match" FROM table_23083 WHERE "Result" = 'Rockets won by 9 wickets'
CREATE TABLE table_70632 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What is the try bonus when there were 58 points?
SELECT "Try bonus" FROM table_70632 WHERE "Points" = '58'
CREATE TABLE table_50874 ( "Show" text, "Last Aired" real, "Previous Network" text, "Retitled as/Same" text, "New/Returning/Same Network" text, "Returning" text )
Which network returns april 3, and a Show of shop 'til you drop?
SELECT "New/Returning/Same Network" FROM table_50874 WHERE "Returning" = 'april 3' AND "Show" = 'shop ''til you drop'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
provide the number of patients whose gender is m and lab test name is potassium, whole blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Potassium, Whole Blood"
CREATE TABLE table_10333 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the score of the other team that played Geelong?
SELECT "Away team score" FROM table_10333 WHERE "Home team" = 'geelong'
CREATE TABLE document_types ( document_type_code text, document_description text ) CREATE TABLE projects ( project_id number, organisation_id number, project_details text ) CREATE TABLE research_outcomes ( outcome_code text, outcome_description text ) CREATE TABLE grants ( grant_id nu...
From what date and to what date do the staff work on a project that has the most staff and has staff in a leader role?
SELECT date_from, date_to FROM project_staff WHERE project_id IN (SELECT project_id FROM project_staff GROUP BY project_id ORDER BY COUNT(*) DESC LIMIT 1) UNION SELECT date_from, date_to FROM project_staff WHERE role_code = 'leader'
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...
get the number of white-russian patients admitted before the year 2150.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear < "2150"
CREATE TABLE table_train_233 ( "id" int, "serum_bicarbonate" int, "language" string, "hemoglobin_a1c_hba1c" float, "creatinine_clearance_cl" float, "admission_blood_glucose" int, "urine_albumin" int, "ketoacidosis" bool, "age" float, "NOUSE" float )
hba1c of 6.5 to 8
SELECT * FROM table_train_233 WHERE hemoglobin_a1c_hba1c >= 6.5 AND hemoglobin_a1c_hba1c <= 8
CREATE TABLE table_name_96 ( to_par VARCHAR, place VARCHAR, country VARCHAR )
What to par has t3 as the place and england as the country?
SELECT to_par FROM table_name_96 WHERE place = "t3" AND country = "england"
CREATE TABLE table_name_49 ( round VARCHAR, pick__number VARCHAR )
What is the total round of the 129 pick?
SELECT COUNT(round) FROM table_name_49 WHERE pick__number = 129
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_...
What are the purchase details of transactions with amount bigger than 10000, and count them by a bar chart, order by the bar 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 purchase_details DESC
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Top 100 most recent closed posts. Demo for R package RStackExchange
SELECT Title FROM Posts ORDER BY ClosedDate DESC LIMIT 100
CREATE TABLE table_test_16 ( "id" int, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "severe_hypertension" bool, "adrenaline" bool, "stroke" bool, "renal_disease" bool, "severe_uncontrolled_arterial_hypertension" bool, "hepatic_disease" bool, "...
moderate to severe renal impairment ( crea level > 1.7 mg / dl or glomerular filtration rate < 35 ml / min ) .
SELECT * FROM table_test_16 WHERE renal_disease = 1 OR (creatinine_clearance_cl > 1.7 OR estimated_glomerular_filtration_rate_egfr < 35)
CREATE TABLE table_204_946 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number )
how many finished all 225 laps ?
SELECT COUNT(*) FROM table_204_946 WHERE "laps" = 225
CREATE TABLE table_name_44 ( height_ft__m_ VARCHAR, floors VARCHAR, year VARCHAR )
How tall is the building built in 1985 with 22 floors?
SELECT height_ft__m_ FROM table_name_44 WHERE floors = 22 AND year = 1985
CREATE TABLE table_name_46 ( team VARCHAR, game VARCHAR )
What is the Team in Game 38?
SELECT team FROM table_name_46 WHERE game = 38
CREATE TABLE table_37479 ( "Date" text, "City" text, "Result" text, "Score" text, "Competition" text )
Which Date has a Result of w, and a Score of 3-0?
SELECT "Date" FROM table_37479 WHERE "Result" = 'w' AND "Score" = '3-0'
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDa...
Comments asking the downvoter to explain.
SELECT Comments.Id AS "comment_link", Comments.UserId AS "user_link", Posts.ClosedDate AS Closed, Comments.CreationDate FROM Comments INNER JOIN Posts ON Comments.PostId = Posts.Id WHERE (LOWER(Text) LIKE '%@downvoter%' OR LOWER(Text) LIKE '%downvoter%' OR LOWER(Text) LIKE '%the downvote%' OR LOWER(Text) LIKE '%downvot...
CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text )
Show different nominees and the number of musicals they have been nominated Plot them as bar chart, and could you order the total number in desc order?
SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC
CREATE TABLE table_name_96 ( points INTEGER, year VARCHAR )
What are the lowest points in 2004?
SELECT MIN(points) FROM table_name_96 WHERE year = 2004
CREATE TABLE table_66921 ( "!accented mora" text, "one mora" text, "two-mora word" text, "three-mora word" text, "gloss" text )
What is the one mora for the three-mora word /kaze/ [k z ]?
SELECT "one mora" FROM table_66921 WHERE "three-mora word" = '/kaze/ [kázé]'
CREATE TABLE table_name_78 ( allsvenskan_titles INTEGER, introduced VARCHAR, stars_symbolizes VARCHAR, club VARCHAR )
How many allsvenskan titles did club aik have after its introduction after 2000, with stars symbolizing the number of swedish championship titles ?
SELECT SUM(allsvenskan_titles) FROM table_name_78 WHERE stars_symbolizes = "number of swedish championship titles" AND club = "aik" AND introduced > 2000
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
tell me the cost of a upper respiratory obstruction diagnosis?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'upper respiratory obstruction')
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId n...
Can you really own things?.
SELECT Id AS "post_link", OwnerUserId, OwnerDisplayName, CommunityOwnedDate FROM Posts WHERE Id = '##PostId##'
CREATE TABLE table_name_54 ( year INTEGER, date VARCHAR )
In what Year was the Game on September 26?
SELECT SUM(year) FROM table_name_54 WHERE date = "september 26"
CREATE TABLE table_name_68 ( date VARCHAR, result VARCHAR, location VARCHAR, year VARCHAR, loser VARCHAR )
Which date had a year under 1988, loser of Philadelphia Eagles, location of Giants Stadium, and a result of 21-0?
SELECT date FROM table_name_68 WHERE year < 1988 AND loser = "philadelphia eagles" AND location = "giants stadium" AND result = "21-0"
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, su...
in the previous year, what are the top three most frequently prescribed drugs to patients in the same month after receiving other gastrostomy?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ...
CREATE TABLE table_name_63 ( gender VARCHAR, name VARCHAR )
Name the gender for elsthorpe school
SELECT gender FROM table_name_63 WHERE name = "elsthorpe school"
CREATE TABLE table_16916 ( "Institution" text, "Nickname" text, "Status" text, "Founded" real, "Color" text, "Location" text )
What was the founding of navy blue?
SELECT "Founded" FROM table_16916 WHERE "Color" = 'Navy Blue'
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
Count the number of people of each sex who have a weight higher than 85 by a bar chart, and I want to order by the X in asc.
SELECT Sex, COUNT(*) FROM people WHERE Weight > 85 GROUP BY Sex ORDER BY Sex
CREATE TABLE table_16102 ( "No. in series" real, "No. in season" real, "Title" text, "Setting" text, "Directed by" text, "Written by" text, "Original air date" text )
What episode number of the season was 'The Northern Uprising'?
SELECT "No. in season" FROM table_16102 WHERE "Title" = 'The Northern Uprising'
CREATE TABLE table_26383 ( "Original" text, "IPA ( Lisbon )" text, "IPA ( Rio de Janeiro )" text, "IPA ( S\u00e3o Paulo )" text, "IPA ( Santiago de Compostela )" text, "Translation" text )
What is the original of the ipa ( rio de janeiro )translation ki mo t a w n t t i t n ?
SELECT "Translation" FROM table_26383 WHERE "IPA ( Rio de Janeiro )" = 'ki̥ mo̞ɕˈtɾaɾɜ̃w̃ nɐ ˈtɛʁə tɕĩʑiˈtɜ̃nə'
CREATE TABLE table_name_9 ( qual VARCHAR, rank VARCHAR )
What is the qual with a rank 9?
SELECT qual FROM table_name_9 WHERE rank = "9"
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
Questions with multiple bounties by the same user.
SELECT questions.Id AS "post_link", Votes.UserId AS "user_link", 'site://posts/' + CAST(questions.Id AS TEXT) + '/timeline|timeline' AS "Timeline link", COUNT(*) AS "Number of bounties" FROM Posts AS questions LEFT JOIN Votes AS votes ON Votes.PostId = questions.Id WHERE Votes.VoteTypeId = 8 GROUP BY questions.Id, Vote...
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real...
What are the names and ages of artists? Show the result in a bar graph, and sort by the total number in ascending.
SELECT Name, Age FROM artist ORDER BY Age
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
provide the number of patients whose drug code is levobase3?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "LEVOBASE3"
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
count the number of patients whose ethnicity is hispanic or latino and procedure icd9 code is 3950?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND procedures.icd9_code = "3950"
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 marital status and date of birth of subject id 92796?
SELECT demographic.marital_status, demographic.dob FROM demographic WHERE demographic.subject_id = "92796"
CREATE TABLE table_17118657_10 ( date VARCHAR, high_assists VARCHAR )
On which date is high assists Dupree (6)?
SELECT date FROM table_17118657_10 WHERE high_assists = "Dupree (6)"
CREATE TABLE table_name_83 ( Id VARCHAR )
What is the 2006 value with a 2011 value greater than 4113 and a 2008 value less than 7181?
SELECT SUM(2006) FROM table_name_83 WHERE 2011 > 4113 AND 2008 < 7181
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 younger than 70 years have got the cerebrospinal fluid (csf) lab test done?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "70" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
CREATE TABLE table_2527617_1 ( best_player VARCHAR, season VARCHAR )
Who is the best player in the 1998 season?
SELECT best_player FROM table_2527617_1 WHERE season = 1998
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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d...
how much patient 84346 has changed in urea nitrogen last measured on the last hospital visit compared to the first value measured on the last hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 84346 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.l...
CREATE TABLE table_name_5 ( lower_index_kcal__nm_3 INTEGER, lower_index_mj__nm_3 VARCHAR, upper_index_kcal__nm_3 VARCHAR )
What is the Lower index Kcal/ Nm 3 entry, for the row with entries of an Upper index Kcal/ Nm 3 smaller than 19,376, and a Lower index MJ/ Nm 3 of 74.54?
SELECT AVG(lower_index_kcal__nm_3) FROM table_name_5 WHERE lower_index_mj__nm_3 = 74.54 AND upper_index_kcal__nm_3 < 19 OFFSET 376
CREATE TABLE table_75276 ( "Surname" text, "First" text, "D.O.B." text, "Uni#" real, "Bats" text, "Throws" text, "Position" text )
Which player has a last name of baron?
SELECT "Bats" FROM table_75276 WHERE "Surname" = 'baron'
CREATE TABLE table_5848 ( "Year Ended" text, "Passengers Flown" real, "Passenger Load Factor (%)" real, "Revenue (\u20acm)" real, "Profit / (Loss) Before Tax (\u20acm)" text, "Net Profit / (Loss) (\u20acm)" text )
What is the Profit / (Loss) Before Tax ( m) that has a Revenue ( m) larger than 1,115.8, and on 31 december 2012?
SELECT "Profit / (Loss) Before Tax (\u20acm)" FROM table_5848 WHERE "Revenue (\u20acm)" > '1,115.8' AND "Year Ended" = '31 december 2012'
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...
give me the number of patients whose admission type is elective and drug code is warf25?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.formulary_drug_cd = "WARF25"
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
what is the diagnosis short title and procedure short title of subject id 83678?
SELECT diagnoses.short_title, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "83678"
CREATE TABLE table_name_18 ( draw INTEGER, artist VARCHAR )
How many draws feature artist wendy fierce?
SELECT SUM(draw) FROM table_name_18 WHERE artist = "wendy fierce"
CREATE TABLE table_33684 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How many points did Carlton score?
SELECT "Home team score" FROM table_33684 WHERE "Away team" = 'carlton'
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
how many patients had been discharged from the hospital since 3 years ago.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime) >= DATETIME(CURRENT_TIME(), '-3 year')
CREATE TABLE table_30280 ( "Position" text, "Number" real, "Player" text, "Super League" real, "Champions League" real, "Swiss Cup" real, "Total" real )
List the lowest super league for a 0 champion league.
SELECT MIN("Super League") FROM table_30280 WHERE "Champions League" = '0'
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...
Tell me the number of patients who had elective hospital admissions and other body fluid lab tests.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.fluid = "Other Body Fluid"
CREATE TABLE status ( station_id VARCHAR, bikes_available VARCHAR ) CREATE TABLE station ( name VARCHAR, id VARCHAR )
Return the unique name for stations that have ever had 7 bikes available.
SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available = 7
CREATE TABLE table_name_79 ( wounded VARCHAR, complement VARCHAR )
How many were Wounded while in a Unit with a Complement of 83 off 9 Men?
SELECT wounded FROM table_name_79 WHERE complement = "83 off 9 men"