table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
count the number of patients whose age is less than 24 and days of hospital stay is greater than 43?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "24" AND demographic.days_stay > "43"
CREATE TABLE table_name_88 ( home_leg VARCHAR, opponents VARCHAR )
What is the home leg who are opponents of rotor volgograd
SELECT home_leg FROM table_name_88 WHERE opponents = "rotor volgograd"
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number...
was there a surgery consultation performed on patient 029-16737 until 3 years ago?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-16737')) AND treatment.treatmentname = 'surgery consultation' AND DATETI...
CREATE TABLE table_name_95 ( score VARCHAR, record VARCHAR )
What is Score, when Record is '2-0'?
SELECT score FROM table_name_95 WHERE record = "2-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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
tell me both the time of admission and discharge for patient francis baseler.
SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.name = "Francis Baseler"
CREATE TABLE table_25675509_1 ( longitude VARCHAR, date__yyyy_mm_dd_ VARCHAR )
What was the longitude for the shock that occured on 2010-01-09?
SELECT longitude FROM table_25675509_1 WHERE date__yyyy_mm_dd_ = "2010-01-09"
CREATE TABLE table_36274 ( "Date" text, "Site" text, "Sport" text, "Winning team" text, "Series" text )
What winning team has volleyball as the sport?
SELECT "Winning team" FROM table_36274 WHERE "Sport" = 'volleyball'
CREATE TABLE table_66260 ( "Date" text, "Name of ship" text, "Flag" text, "Tonnage" real, "Fate" text )
On what date was the Brookwood, which weighed over 5,008 tons, attacked?
SELECT "Date" FROM table_66260 WHERE "Tonnage" > '5,008' AND "Name of ship" = 'brookwood'
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 are admitted under urgent admission type and lab tested for item id 50808?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.itemid = "50808"
CREATE TABLE table_name_9 ( beat_by VARCHAR, distance VARCHAR )
Who beat Chic by 8fm?
SELECT beat_by FROM table_name_9 WHERE distance = "8fm"
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,...
count the number of patients whose admission year is less than 2194 and procedure long title is circumcision?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2194" AND procedures.long_title = "Circumcision"
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid n...
count the number of people who received aortocor bypas-3 cor art during the same month after having been diagnosed with severe sepsis since 2 years ago.
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'severe sepsis') AN...
CREATE TABLE table_name_42 ( score VARCHAR, home VARCHAR )
What is the score of the New Jersey home game?
SELECT score FROM table_name_42 WHERE home = "new jersey"
CREATE TABLE table_77042 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
What is Position in Table, when Replaced By is 'Sergio Bueno'?
SELECT "Position in table" FROM table_77042 WHERE "Replaced by" = 'sergio bueno'
CREATE TABLE table_9460 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
What is the total number of positions for teams with more than 7 draws and under 40 played?
SELECT COUNT("Position") FROM table_9460 WHERE "Drawn" > '7' AND "Played" < '40'
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
how many days have passed since the admission of patient 012-66291 to the hospital?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '012-66291' AND patient.hospitaldischargetime IS NULL
CREATE TABLE Invoices ( Invoice_ID INTEGER, Order_ID INTEGER, payment_method_code CHAR(15), Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255), Order_Item_ID INTEGER ) CREATE TABLE Stores ( Store_ID VARCHAR(100), Address_ID INTEGER, Marketing_Region...
List the distinct payment method codes with the number of orders mad. Show bar chart.
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code
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, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the job_id , order in desc by the y-axis please.
SELECT JOB_ID, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
CREATE TABLE table_name_55 ( football_stadium VARCHAR, team VARCHAR )
What's the name of the carabins stadium?
SELECT football_stadium FROM table_name_55 WHERE team = "carabins"
CREATE TABLE table_name_66 ( assists INTEGER, rank VARCHAR, games VARCHAR )
How many Assists for the Player with a Rank greater than 3 in less than 25 Games?
SELECT AVG(assists) FROM table_name_66 WHERE rank > 3 AND games < 25
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE days ( days_code varchar, ...
show me flights from MINNEAPOLIS to SEATTLE on 7 2
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND date_day.day_number = 2 AND date_day.month_number = 7 AND da...
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
give the number of patients with government insurance and procedure long title thoracocentesis.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Thoracentesis"
CREATE TABLE table_22538587_3 ( total_apps INTEGER, player VARCHAR )
Name the least total apps for jaime
SELECT MIN(total_apps) FROM table_22538587_3 WHERE player = "Jaime"
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE charte...
retrieve the top four most commonly prescribed drugs for patients 20s in 2102?
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) AND STRFTIME('%y', prescriptions.startdate) = '2102' GROUP BY prescriptions.drug) AS t1 WH...
CREATE TABLE table_35301 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What visitor has February 11 as the date?
SELECT "Visitor" FROM table_35301 WHERE "Date" = 'february 11'
CREATE TABLE table_55840 ( "Year" real, "MRHMA" text, "USCA" text, "RTHK" text, "Joint Music Award" text, "Total" real )
What is the USCA that's Total is smaller than 14, with 1 Joint Music Award, MRHMA of 2, and RTHK of 3?
SELECT "USCA" FROM table_55840 WHERE "Total" < '14' AND "Joint Music Award" = '1' AND "MRHMA" = '2' AND "RTHK" = '3'
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport ( ...
show me all flights from DALLAS to SAN FRANCISCO
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 = 'SAN FRA...
CREATE TABLE table_name_89 ( away_team VARCHAR, tie_no VARCHAR )
What away team has 12 as the tie no.?
SELECT away_team FROM table_name_89 WHERE tie_no = "12"
CREATE TABLE table_62447 ( "Elected" text, "Assembled" text, "Dissolved" text, "1st member" text, "2nd member" text )
Who was the 1st member that was elected in 1541/42?
SELECT "1st member" FROM table_62447 WHERE "Elected" = '1541/42'
CREATE TABLE table_49109 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Crowd" real, "Box Score" text, "Report" text )
what is the date when the score is 115-93?
SELECT "Date" FROM table_49109 WHERE "Score" = '115-93'
CREATE TABLE table_60411 ( "Year" real, "Name of Tournament" text, "Champions" text, "Runners-up" text, "Score" text )
In 1987, what is the Runners-up when Stefan Edberg is Champion?
SELECT "Runners-up" FROM table_60411 WHERE "Champions" = 'stefan edberg' AND "Year" = '1987'
CREATE TABLE table_name_17 ( destroyed INTEGER, survived VARCHAR, to_iran VARCHAR, damaged VARCHAR )
What's the average destroyed with a 1990 over 12, more than 1 damaged, 6 survivors, and a to Iran less than 4?
SELECT AVG(destroyed) FROM table_name_17 WHERE 1990 > 12 AND damaged > 1 AND to_iran < 4 AND survived = 6
CREATE TABLE table_name_74 ( constructor VARCHAR, laps VARCHAR, driver VARCHAR )
Who built james hunt's car that went 79 laps?
SELECT constructor FROM table_name_74 WHERE laps = 79 AND driver = "james hunt"
CREATE TABLE table_name_32 ( round VARCHAR, college VARCHAR )
Which round is the player from Oregon from?
SELECT round FROM table_name_32 WHERE college = "oregon"
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by time.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
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, draw a bar chart about the distribution of name and the average of revenue , and group by attribute name, display in asc by the total number.
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T2.Revenue
CREATE TABLE table_name_7 ( nationality VARCHAR, games VARCHAR, player VARCHAR )
What is the Nationality of Mike Gatting, who played 551 games?
SELECT nationality FROM table_name_7 WHERE games = "551" AND player = "mike gatting"
CREATE TABLE table_name_92 ( round VARCHAR, opponent VARCHAR )
What round was the opponent Manny Gamburyan?
SELECT round FROM table_name_92 WHERE opponent = "manny gamburyan"
CREATE TABLE table_204_36 ( id number, "date" text, "opponent" text, "site" text, "result" text, "attendance" number, "record" text )
how many wins did georgetown achieve in 1941 ?
SELECT COUNT(*) FROM table_204_36 WHERE "result" = 'w' AND "date" = 1941
CREATE TABLE table_204_541 ( id number, "name" text, "area" text, "height" text, "floors" number, "year" number )
what tower has at most 10 floors ?
SELECT "name" FROM table_204_541 WHERE "floors" <= 10
CREATE TABLE table_44445 ( "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text )
How many laps have a +0.4865 time/retired?
SELECT "Laps" FROM table_44445 WHERE "Time/Retired" = '+0.4865'
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
provide me the number of patients with lab test item id 51384 who died in or before the year 2133.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2133.0" AND lab.itemid = "51384"
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 ) CREATE TABLE employee ( eid number, name text, ...
What is the name and distance of every aircraft that can cover a distance of more than 5000 and which at least 5 people can fly?
SELECT T2.name FROM certificate AS T1 JOIN aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY COUNT(*) >= 5
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment tex...
Weighted Score of more 'successful' users. Tries to gauge success by weighting number of answers by acceptance percentage. This is done as a way to weed out people who post very infrequently, but are accepted often (counter productive perhaps, but too cautious for my likes).
SELECT u.Id AS "user_link", COUNT(*) AS NumAnswers, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS NumAccepted, (SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * 100.0 / (COUNT(*))) AS AcceptedPercent, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * (SUM(CASE WHEN q.AcceptedAnswe...
CREATE TABLE table_5122 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text )
What opponent has euro '84 qualifying as the type and split as the city?
SELECT "Opponent" FROM table_5122 WHERE "Type of game" = 'euro ''84 qualifying' AND "City" = 'split'
CREATE TABLE table_name_61 ( played INTEGER, draws VARCHAR, goals_for VARCHAR, goal_difference VARCHAR, losses VARCHAR )
Which position had a goal difference of less than 27, lost more than 13 games, scored less than 42 goals and drew 6 games?
SELECT MAX(played) FROM table_name_61 WHERE goal_difference < 27 AND losses > 13 AND goals_for < 42 AND draws = 6
CREATE TABLE table_name_15 ( wins INTEGER, losses VARCHAR, draws VARCHAR, goal_difference VARCHAR )
What is the average wins of the team with more than 13 draws, a goal difference of -14, and losses less than 14?
SELECT AVG(wins) FROM table_name_15 WHERE draws > 13 AND goal_difference = -14 AND losses < 14
CREATE TABLE table_202_253 ( id number, "team" text, "titles" text, "runners-up" text, "third place" text, "fourth place" text )
which team has best percentage of titles to runner up finishes ?
SELECT "team" FROM table_202_253 ORDER BY "titles" / "runners-up" DESC LIMIT 1
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
how many hours have passed since last time that patient 021-111547 stayed in ward 814 in this hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '021-111547' AND patient.wardid = 814 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
CREATE TABLE table_74551 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" text )
Which opponent has unknown attendance, and lost 2-0?
SELECT "Opponent" FROM table_74551 WHERE "Attendance" = 'unknown' AND "Result" = 'lost 2-0'
CREATE TABLE member_attendance ( member_id number, performance_id number, num_of_pieces number ) CREATE TABLE member ( member_id text, name text, nationality text, role text ) CREATE TABLE performance ( performance_id number, date text, host text, location text, attenda...
How many performances are there?
SELECT COUNT(*) FROM performance
CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, resolution number ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABL...
What is the country of origin of the artist who is female and produced a song in Bangla?
SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla"
CREATE TABLE table_34930 ( "Year" real, "Award" text, "Nominated work" text, "Category" text, "Result" text )
What category has a year after 2004?
SELECT "Category" FROM table_34930 WHERE "Year" > '2004'
CREATE TABLE table_33730 ( "Date" text, "Venue" text, "Result" text, "Goals" real, "Competition" text )
How many goals have a result of 0-1 on march 28, 2007?
SELECT COUNT("Goals") FROM table_33730 WHERE "Result" = '0-1' AND "Date" = 'march 28, 2007'
CREATE TABLE table_name_2 ( silver INTEGER, nation VARCHAR, bronze VARCHAR )
Which Silver has a Nation of china, and a Bronze smaller than 7?
SELECT SUM(silver) FROM table_name_2 WHERE nation = "china" AND bronze < 7
CREATE TABLE table_name_93 ( date VARCHAR, japan VARCHAR )
Which date had Japanese sales of 0.61 million?
SELECT date FROM table_name_93 WHERE japan = "0.61 million"
CREATE TABLE table_1723080_1 ( viewers__in_millions_ VARCHAR, broadcast_date VARCHAR )
How many viewers were there on 1august1964?
SELECT viewers__in_millions_ FROM table_1723080_1 WHERE broadcast_date = "1August1964"
CREATE TABLE table_18318 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the result when the incumbent was george h. mahon
SELECT "Result" FROM table_18318 WHERE "Incumbent" = 'George H. Mahon'
CREATE TABLE table_11891841_2 ( type VARCHAR, name VARCHAR )
What is the type where the name is bojan?
SELECT type FROM table_11891841_2 WHERE name = "Bojan"
CREATE TABLE table_name_8 ( role VARCHAR, original_broadway_cast VARCHAR )
What was the role when the original broadway was Adam Riegler?
SELECT role FROM table_name_8 WHERE original_broadway_cast = "adam riegler"
CREATE TABLE table_13694 ( "Lane" real, "Name" text, "Country" text, "Reaction Time" real, "Time" real )
Which Lane has a Country of united states, and a Time smaller than 22.01, and a Reaction Time smaller than 0.193?
SELECT MIN("Lane") FROM table_13694 WHERE "Country" = 'united states' AND "Time" < '22.01' AND "Reaction Time" < '0.193'
CREATE TABLE table_name_56 ( score VARCHAR, game INTEGER )
What was the score at the game earlier than 66?
SELECT score FROM table_name_56 WHERE game < 66
CREATE TABLE table_37008 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text )
What is listed for the Bronze, with the Location of Bangkok, and the Year of 1978?
SELECT "Bronze" FROM table_37008 WHERE "Location" = 'bangkok' AND "Year" = '1978'
CREATE TABLE table_203_548 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
who had the top number of bronze awards ?
SELECT "nation" FROM table_203_548 ORDER BY "bronze" DESC LIMIT 1
CREATE TABLE table_32859 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the venue where Collingwood played as the home team?
SELECT "Venue" FROM table_32859 WHERE "Home team" = 'collingwood'
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 varcha...
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, show me about the distribution of hire_date and the average of department_id bin hire_date by weekday in a bar chart, and I want to rank by the y axis in asc.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID)
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ...
the question count for each tag.
SELECT COUNT(*) FROM Posts WHERE Tags LIKE '%python%'
CREATE TABLE table_2380212_1 ( year INTEGER, avg_attendance VARCHAR )
When was the average attendance 789?
SELECT MIN(year) FROM table_2380212_1 WHERE avg_attendance = 789
CREATE TABLE table_68652 ( "Tournament" text, "2003" text, "2007" text, "2008" text, "2009" text, "2011" text )
What is the 2007 value with 1r in 2009 and 2r in 2011 at the Tournament of Wimbledon?
SELECT "2007" FROM table_68652 WHERE "2009" = '1r' AND "2011" = '2r' AND "Tournament" = 'wimbledon'
CREATE TABLE table_32685 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who played as the home team when the attendance was more than 30,080?
SELECT "Home team" FROM table_32685 WHERE "Crowd" > '30,080'
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text...
can you show me economy class one way fares for flights from OAKLAND to DALLAS on 12 16
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, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE (((CITY_1....
CREATE TABLE table_24455 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" real )
Name the original air date for 9.16 viewers
SELECT "Original air date" FROM table_24455 WHERE "U.S. viewers (million)" = '9.16'
CREATE TABLE table_name_69 ( nature_of_incident VARCHAR, circumstances VARCHAR )
What is the nature of the incident that's a bomb attack?
SELECT nature_of_incident FROM table_name_69 WHERE circumstances = "bomb attack"
CREATE TABLE table_name_19 ( opponents VARCHAR, result VARCHAR )
When the result is d, who are the opponents?
SELECT opponents FROM table_name_19 WHERE result = "d"
CREATE TABLE table_13699 ( "Year" real, "Labour" real, "Lib Dem" real, "Green" real, "IWCA" real, "Independent" real, "Conservative" real )
Name the the average Lib Dem with Conservative smaller than 0?
SELECT AVG("Lib Dem") FROM table_13699 WHERE "Conservative" < '0'
CREATE TABLE table_22050544_1 ( winner VARCHAR, elapsed_time VARCHAR )
Who is the winner with an elapsed time of 12 h 42 min?
SELECT winner FROM table_22050544_1 WHERE elapsed_time = "12 h 42 min"
CREATE TABLE table_name_4 ( gold VARCHAR, nation VARCHAR, silver VARCHAR, bronze VARCHAR )
What is the number of gold when the silver is 1, bronze is 1, and the nation is Austria?
SELECT COUNT(gold) FROM table_name_4 WHERE silver = 1 AND bronze = 1 AND nation = "austria"
CREATE TABLE table_name_6 ( venue VARCHAR, date VARCHAR )
Where was the game played on 30 May 2004?
SELECT venue FROM table_name_6 WHERE date = "30 may 2004"
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id nu...
what was the name of the intake that patient 26350 has last had until 09/30/2105?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26350)) AND STRFTIME('%y-%m-%d', inp...
CREATE TABLE table_50099 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text )
What was the nationality of a point guard position in 1999-2001?
SELECT "Nationality" FROM table_50099 WHERE "Position" = 'point guard' AND "Years for Grizzlies" = '1999-2001'
CREATE TABLE table_11545282_11 ( position VARCHAR, no VARCHAR )
What is the position of number 47?
SELECT position FROM table_11545282_11 WHERE no = "47"
CREATE TABLE table_name_72 ( serial_format VARCHAR, design VARCHAR, serials_issued VARCHAR )
What is the serial format for white on blue with a serial issued of ss-00-00 to zz-99-99?
SELECT serial_format FROM table_name_72 WHERE design = "white on blue" AND serials_issued = "ss-00-00 to zz-99-99"
CREATE TABLE table_26613 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
What's the series number of the episode written by Tim Schlattmann?
SELECT MIN("No. in series") FROM table_26613 WHERE "Written by" = 'Tim Schlattmann'
CREATE TABLE table_64733 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real )
Cass county has 0.008 Water (sqmi), less than 35.874 Land (sqmi), more than 35 Pop. (2010), and what average latitude?
SELECT AVG("Latitude") FROM table_64733 WHERE "Land ( sqmi )" < '35.874' AND "Pop. (2010)" > '35' AND "County" = 'cass' AND "Water (sqmi)" = '0.008'
CREATE TABLE table_63048 ( "Year" real, "Date" text, "Winners" text, "Score" text, "Runners Up" text, "Att." real )
What was the score for the matchup having attendance of 354?
SELECT "Score" FROM table_63048 WHERE "Att." = '354'
CREATE TABLE table_43654 ( "Rank" real, "Country" text, "Year" real, "Males" real, "Females" real, "Total" real )
What is the biggest number of females where the males are at 28.2 with a rank greater than 5?
SELECT MAX("Females") FROM table_43654 WHERE "Males" = '28.2' AND "Rank" > '5'
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...
How many of the divorcee patients were diagnosed with cellulitis of hand?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.short_title = "Cellulitis of hand"
CREATE TABLE table_name_71 ( venue VARCHAR, date VARCHAR )
What was the venue for the game on 10-09-2012?
SELECT venue FROM table_name_71 WHERE date = "10-09-2012"
CREATE TABLE table_27491610_2 ( no_in_season INTEGER, no_in_series VARCHAR )
What number in season is number 141 in series?
SELECT MAX(no_in_season) FROM table_27491610_2 WHERE no_in_series = 141
CREATE TABLE table_60960 ( "Cover Date" text, "Story Title" text, "Writer/s" text, "Letterer/s" text, "Colourist/s" text )
What is the Cover Date of the Story Title Spacehikers (Part 2)?
SELECT "Cover Date" FROM table_60960 WHERE "Story Title" = 'spacehikers (part 2)'
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE STUDENT...
Show the GPA of the students with the top 5 GPAs in a pie chart.
SELECT STU_FNAME, STU_GPA FROM STUDENT ORDER BY STU_GPA DESC LIMIT 5
CREATE TABLE table_49732 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
How many rounds does Colby Robak have with a position of (d)?
SELECT "Round" FROM table_49732 WHERE "Position" = '(d)' AND "Player" = 'colby robak'
CREATE TABLE table_204_131 ( id number, "tops design code" text, "electrical system" text, "max speed" text, "weight" text, "brakes" text, "route availability" number, "notes" text )
how many times is 90v listed as the electrical system ?
SELECT COUNT(*) FROM table_204_131 WHERE "electrical system" = '90 v'
CREATE TABLE table_14500 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
What years does the school have with a roll of 33?
SELECT "Years" FROM table_14500 WHERE "Roll" = '33'
CREATE TABLE stock ( shop_id number, device_id number, quantity number ) CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE shop ( shop_id number, shop_name text, location tex...
Show the name of the shop that have the largest quantity of devices in stock.
SELECT T2.shop_name FROM stock AS T1 JOIN shop AS T2 ON T1.shop_id = T2.shop_id GROUP BY T1.shop_id ORDER BY SUM(T1.quantity) DESC LIMIT 1
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE PROFESSOR ( EMP_NUM int, ...
Show the number of courses for each office in a stacked bar chart The x-axis is office name and group by course description, list total number in desc order.
SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION, PROF_OFFICE ORDER BY COUNT(PROF_OFFICE) DESC
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...
Caculate the number of newborn patients who remained admitted in the hospital for more than 9 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.days_stay > "9"
CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE aircraft ( ai...
Return a histogram on what are the names and distances for all airplanes?, could you order by the x-axis in desc?
SELECT name, distance FROM aircraft ORDER BY name DESC
CREATE TABLE table_66626 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text )
What Class has the Identifier of CBFX-FM-6?
SELECT "Class" FROM table_66626 WHERE "Identifier" = 'cbfx-fm-6'
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ...
what were the top five most frequent procedures that patients were given after the diagnosis of dementia w/o behav dist during the same hospital encounter until 3 years ago?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i...