table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
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, ...
count the number of patients whose year of death is less than or equal to 2138 and diagnoses icd9 code is 53190?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2138.0" AND diagnoses.icd9_code = "53190"
CREATE TABLE table_9288 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
What opponent had a record of 37-27?
SELECT "Opponent" FROM table_9288 WHERE "Record" = '37-27'
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, ...
give me the number of patients whose death status is 0 and diagnoses long title is intestinal bypass or anastomosis status?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Intestinal bypass or anastomosis status"
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft (...
show me the airlines from DAL
SELECT DISTINCT airline.airline_code FROM airline, airport, flight WHERE airport.airport_code = 'DAL' AND flight.airline_code = airline.airline_code AND flight.from_airport = airport.airport_code
CREATE TABLE table_25406 ( "Season" real, "Episodes" real, "Timeslot (ET)" text, "Season Premiere" text, "Season Finale" text, "TV Season" text, "Rank" text, "Viewers (in millions)" text )
What was the season number that had a premiere on December 11, 2010?
SELECT MAX("Season") FROM table_25406 WHERE "Season Premiere" = 'December 11, 2010'
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_...
please tell me the times of the flights between BOSTON and BALTIMORE
SELECT DISTINCT flight.arrival_time, flight.departure_time 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND ...
CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(...
Bar chart of how many building from each building, and could you rank by the X in asc?
SELECT building, COUNT(building) FROM department GROUP BY building ORDER BY building
CREATE TABLE table_name_29 ( lap_by_lap VARCHAR, year VARCHAR, ratings VARCHAR )
Who was the lap-by-lap broadcaster before 1994 who garnered ratings of 8.0/21?
SELECT lap_by_lap FROM table_name_29 WHERE year < 1994 AND ratings = "8.0/21"
CREATE TABLE table_30804 ( "Year" text, "Position" real, "Games played" real, "Won" real, "Tied" real, "Lost" real, "Goals Scored" real, "Goals Against" real, "Points" real, "Postseason place" text )
What are goals scored when postition is 17 and tied is 5?
SELECT "Goals Scored" FROM table_30804 WHERE "Position" = '17' AND "Tied" = '5'
CREATE TABLE table_22552 ( "Nation" text, "Rider" text, "Horse" text, "Cross Country Penalties" text, "Total Penalties" text, "Total Team Penalties" text, "Team Rank" real )
Which nation is where the horse parkmore ed is?
SELECT "Nation" FROM table_22552 WHERE "Horse" = 'Parkmore Ed'
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, P...
Question score as a function of length. Plots average question score, +/- 1 standard deviation, as a function of binned question length.
SELECT AVG(LENGTH(Body)) AS AverageLength, AVG(Score) AS QuestionScore, AVG(Score) + STDEV(Score) AS PlusOneSigma, AVG(Score) - STDEV(Score) AS MinusOneSigma FROM Posts WHERE PostTypeId = 1 AND LENGTH(Body) <= 8000 GROUP BY ROUND(LENGTH(Body), -2) ORDER BY ROUND(LENGTH(Body), -2)
CREATE TABLE table_name_7 ( title_rank VARCHAR, series VARCHAR, character VARCHAR )
What is the title rank of the actor who played the character of arthur hastings during series 1-8, 13?
SELECT title_rank FROM table_name_7 WHERE series = "1-8, 13" AND character = "arthur hastings"
CREATE TABLE table_27103 ( "Total" real, "#" real, "Title" text, "Director" text, "Writer(s)" text, "Viewers" text, "Air date" text, "Production code" real )
When 3 is the number what is the highest total?
SELECT MAX("Total") FROM table_27103 WHERE "#" = '3'
CREATE TABLE table_54298 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What is the margin of victory for the winning score of 10 (71-65-68-70=274)?
SELECT "Margin of victory" FROM table_54298 WHERE "Winning score" = '−10 (71-65-68-70=274)'
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CRE...
ground transportation ATLANTA
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'ATLANTA' AND ground_service.city_code = city.city_code
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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime ...
had any tpn w/lipids been given to patient 2238 in their last hospital visit?
SELECT COUNT(*) > 0 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 = 2238 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND inputevents_c...
CREATE TABLE table_5435 ( "Church name" text, "Organized by" text, "Date" text, "Split off / Continuation of" text, "Current status" text )
What was the Independent Church's Split off/ Continuation?
SELECT "Split off / Continuation of" FROM table_5435 WHERE "Church name" = 'independent church'
CREATE TABLE table_203_486 ( id number, "place" number, "team" text, "matches" number, "won" number, "drawn" number, "lost" number, "difference" text, "points" number )
which country performed better during the 1951 world ice hockey championships , switzerland or great britain ?
SELECT "team" FROM table_203_486 WHERE "team" IN ('switzerland', 'great britain') ORDER BY "place" LIMIT 1
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number...
patient 022-67644 had any heparin 100 units-in in the first hospital visit?
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-67644' AND NOT patient.hospitaldischargetime IS NULL ORDER BY pati...
CREATE TABLE table_78185 ( "Title" text, "Published in" text, "Publication Date" text, "Setting" text, "Fictional date" text, "Main characters" text )
Name what was published in july 1934 with a setting of mars
SELECT "Published in" FROM table_78185 WHERE "Setting" = 'mars' AND "Publication Date" = 'july 1934'
CREATE TABLE table_name_33 ( team_2 VARCHAR )
What is the second leg that Valencia was on?
SELECT 2 AS nd_leg FROM table_name_33 WHERE team_2 = "valencia"
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 ( ...
what is the number of patients whose gender is f and diagnoses short title is joint replaced knee?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Joint replaced knee"
CREATE TABLE table_45011 ( "Fin. Pos" text, "Car No." text, "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text )
Which team had a driver with a finish position of 7?
SELECT "Team" FROM table_45011 WHERE "Fin. Pos" = '7'
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) ...
i would like to fly from SALT LAKE CITY back to ST. PETERSBURG on wednesday
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 = 'ST. PETERSBURG' AND date_day.day_number = 23 AND date_day.month_number = ...
CREATE TABLE table_name_42 ( gold VARCHAR, rank VARCHAR, total VARCHAR )
What's the gold medal count ranked 2 with a total of more than 21?
SELECT COUNT(gold) FROM table_name_42 WHERE rank = 2 AND total > 21
CREATE TABLE table_name_47 ( touchdowns INTEGER, player VARCHAR, extra_points VARCHAR, points VARCHAR )
Which Touchdowns have an Extra points of 0, and Points larger than 5, and a Player of curtis redden?
SELECT AVG(touchdowns) FROM table_name_47 WHERE extra_points = 0 AND points > 5 AND player = "curtis redden"
CREATE TABLE college ( college_id text, name_full text, city text, state text, country text ) CREATE TABLE fielding ( player_id text, year number, stint number, team_id text, league_id text, pos text, g number, gs number, inn_outs number, po number, a num...
Find the players' first name and last name who won award both in 1960 and in 1961.
SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1960 INTERSECT SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1961
CREATE TABLE table_name_37 ( award VARCHAR, year VARCHAR, result VARCHAR )
Which award was nominated for in 2000?
SELECT award FROM table_name_37 WHERE year = 2000 AND result = "nominated"
CREATE TABLE table_48696 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of departure" text, "Incoming manager" text, "Date hired" text, "Position in table" text )
What was the manner of departure for the outgoing manager, miguel brindisi?
SELECT "Manner of departure" FROM table_48696 WHERE "Outgoing manager" = 'miguel brindisi'
CREATE TABLE table_80373 ( "2002/ 03" text, "2004/ 05" text, "2006/ 07" text, "2007/ 08" text, "2008/ 09" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text )
Name the 2006/07 with 2011/12 of lq and 2010/11 of lq with 2002/03 of lq
SELECT "2006/ 07" FROM table_80373 WHERE "2011/ 12" = 'lq' AND "2010/ 11" = 'lq' AND "2002/ 03" = 'lq'
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_l...
What are all the upper-level electives being offered in the Spring and Summer ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = '...
CREATE TABLE table_32870 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the away team's score when the crowd was larger than 16,500 and the home team scored 15.15 (105)?
SELECT "Away team score" FROM table_32870 WHERE "Crowd" > '16,500' AND "Home team score" = '15.15 (105)'
CREATE TABLE table_name_65 ( year_s__won VARCHAR, finish VARCHAR, player VARCHAR )
What is Year(s) Won, when Finish is 'T31', and when Player is 'Nick Price'?
SELECT year_s__won FROM table_name_65 WHERE finish = "t31" AND player = "nick price"
CREATE TABLE table_name_21 ( height VARCHAR, name VARCHAR, spike VARCHAR, block VARCHAR )
What is the total number of Height(s), when Spike is less than 352, when Block is greater than 300, and when Name is Pablo Meana?
SELECT COUNT(height) FROM table_name_21 WHERE spike < 352 AND block > 300 AND name = "pablo meana"
CREATE TABLE table_39989 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" text, "Time" text, "Location" text )
What was the total time for the match that ocurred in Round 3 with opponent Keith Wisniewski?
SELECT "Time" FROM table_39989 WHERE "Round" = '3' AND "Opponent" = 'keith wisniewski'
CREATE TABLE table_18470 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Which candidates ran in the Alabama 6 district?
SELECT "Candidates" FROM table_18470 WHERE "District" = 'Alabama 6'
CREATE TABLE table_name_56 ( type VARCHAR, quantity VARCHAR )
WHAT IS THE TYPE WITH 124?
SELECT type FROM table_name_56 WHERE quantity = "124"
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, salary number ) CREATE TABLE aircraft ( aid number, name text, di...
What is the average distance and average price for flights from Los Angeles.
SELECT AVG(distance), AVG(price) FROM flight WHERE origin = "Los Angeles"
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...
calculate the maximum age of patients with newborn primary disease who died before 2138.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "NEWBORN" AND demographic.dod_year < "2138.0"
CREATE TABLE table_name_94 ( date VARCHAR, leading_scorer VARCHAR, visitor VARCHAR )
While the Hornets were visiting, what date was Deron Williams (29) the leading scorer?
SELECT date FROM table_name_94 WHERE leading_scorer = "deron williams (29)" AND visitor = "hornets"
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is the average age of patients who have government insurance policy and got admitted in or after the year 2176?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.admityear >= "2176"
CREATE TABLE customers ( customer_id number, customer_details text ) CREATE TABLE claims_processing ( claim_processing_id number, claim_id number, claim_outcome_code text, claim_stage_id number, staff_id number ) CREATE TABLE claim_headers ( claim_header_id number, claim_status_cod...
Find the names of customers who either have an deputy policy or uniformed policy.
SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy" OR t1.policy_type_code = "Uniform"
CREATE TABLE table_name_61 ( results¹ VARCHAR, city VARCHAR )
What were the results against the game against Skoplje?
SELECT results¹ FROM table_name_61 WHERE city = "skoplje"
CREATE TABLE table_204_309 ( id number, "model" text, "released" number, "usage" text, "features" text, "storage" text )
what is . the last feature on the chart
SELECT "features" FROM table_204_309 ORDER BY id DESC LIMIT 1
CREATE TABLE table_19176 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text )
When platense is the home (2nd leg) what is the 2nd leg?
SELECT "2nd leg" FROM table_19176 WHERE "Home (2nd leg)" = 'Platense'
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(5...
Find the number of booking start date for the apartments that have more than two bedrooms for each weekday in a bar chart, order by the Y from low to high please.
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.bedroom_count > 2 ORDER BY COUNT(booking_start_date)
CREATE TABLE table_204_613 ( id number, "title" text, "year" number, "peak chart positions\nus" number, "peak chart positions\nus\nr&b" number, "peak chart positions\nus\nrap" number, "album" text )
how many total singles has this rapper released thus far ?
SELECT COUNT("title") FROM table_204_613
CREATE TABLE table_42575 ( "Hangul" text, "Hanja" text, "Revised" text, "McCune-Reischauer" text, "2000 n South Korea population *" real )
What is the Hanja for McCune-Reischauer of ch n?
SELECT "Hanja" FROM table_42575 WHERE "McCune-Reischauer" = 'chŏn'
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many patients with government insurance had the procedure icd9 code as 3727?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.icd9_code = "3727"
CREATE TABLE table_70342 ( "Year" text, "Total (000s)" real, "Israel" real, "Germany" real, "Jews (Halakha) in Israel" text )
What is the amount of 000s from 1996?
SELECT SUM("Total (000s)") FROM table_70342 WHERE "Year" = '1996'
CREATE TABLE procedures ( 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 prescription...
provide the number of patients whose admission type is emergency and lab test name is red blood cells?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Red Blood Cells"
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImage...
Closed questions ordered by votes.
SELECT p.Score, p.Id AS "post_link" FROM Posts AS p INNER JOIN ReviewTasks AS rt ON rt.PostId = p.Id WHERE NOT rt.DeletionDate IS NULL ORDER BY p.Score
CREATE TABLE table_12159115_2 ( production_code VARCHAR, us_viewers__millions_ VARCHAR )
What's the production code of the episode seen by 11.64 million US viewers?
SELECT production_code FROM table_12159115_2 WHERE us_viewers__millions_ = "11.64"
CREATE TABLE table_name_89 ( year INTEGER, title VARCHAR )
what is the average year when the title is baka to test to sh kanj ?
SELECT AVG(year) FROM table_name_89 WHERE title = "baka to test to shōkanjū"
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
I need to see Masters Thesis Proj courses of 5 credits .
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Masters Thesis Proj%' OR name LIKE '%Masters Thesis Proj%') AND credits = 5
CREATE TABLE table_23014476_1 ( gore__number INTEGER, others__number VARCHAR )
Name the gore number for others # 6.6%
SELECT MIN(gore__number) FROM table_23014476_1 WHERE others__number = "6.6%"
CREATE TABLE table_name_16 ( year_named INTEGER, name VARCHAR, diameter__km_ VARCHAR )
What's the average year for the name aida-wedo dorsa with a diameter less than 450?
SELECT AVG(year_named) FROM table_name_16 WHERE name = "aida-wedo dorsa" AND diameter__km_ < 450
CREATE TABLE table_71944 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
What is the date of the game against the Royals that had an attendance of 12,699?
SELECT "Date" FROM table_71944 WHERE "Opponent" = 'royals' AND "Attendance" = '12,699'
CREATE TABLE table_train_212 ( "id" int, "pregnancy_or_lactation" bool, "postmeal_c_peptide" float, "chemotherapy" bool, "liver_disease" bool, "alcohol_abuse" bool, "NOUSE" float )
active chemotherapy
SELECT * FROM table_train_212 WHERE chemotherapy = 1
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Clai...
For all the claims whose claimed amount is larger than the average, bin the claim date into day of week interval and count them for visualizing a bar chart, I want to list total number in asc order.
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Claimed > (SELECT AVG(Amount_Claimed) FROM Claims) ORDER BY COUNT(Date_Claim_Made)
CREATE TABLE table_name_18 ( chart VARCHAR, debut_position VARCHAR, peak_position VARCHAR )
How many chart runs had a debut position of more than 7 when peak position was 11?
SELECT COUNT(chart) AS run FROM table_name_18 WHERE debut_position > 7 AND peak_position = 11
CREATE TABLE table_24990183_5 ( ws_points VARCHAR )
What was the 08-09 i/o best of the player with 1386 points?
SELECT 08 AS _09_i_o_best FROM table_24990183_5 WHERE ws_points = 1386
CREATE TABLE table_63710 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the lane with a time of 1:56.64, and a tank smaller than 7?
SELECT COUNT("Lane") FROM table_63710 WHERE "Time" = '1:56.64' AND "Rank" < '7'
CREATE TABLE table_name_60 ( round VARCHAR, name VARCHAR, overall VARCHAR )
What is the number of the round in which Ron Hansen was drafted and the overall is greater than 332?
SELECT COUNT(round) FROM table_name_60 WHERE name = "ron hansen" AND overall > 332
CREATE TABLE table_34958 ( "Outcome" text, "Year" text, "Venue" text, "Last opponent" text, "Score" text )
Score of 0 3 (11 21, 14 21) had what outcome?
SELECT "Outcome" FROM table_34958 WHERE "Score" = '0–3 (11–21, 14–21)'
CREATE TABLE table_37824 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the Attendance on September 11, 1983?
SELECT "Attendance" FROM table_37824 WHERE "Date" = 'september 11, 1983'
CREATE TABLE table_204_517 ( id number, "name" text, "date of birth" text, "club" text, "division" text, "appointed" text, "time as manager" text )
who has served longer , regi van acker or dante brogno ?
SELECT "name" FROM table_204_517 WHERE "name" IN ('regi van acker', 'dante brogno') ORDER BY "time as manager" DESC LIMIT 1
CREATE TABLE table_name_76 ( open_1st_viii VARCHAR, crew VARCHAR )
What is the Open 1st VIII for the 2012 crew?
SELECT open_1st_viii FROM table_name_76 WHERE crew = 2012
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod...
what's the number of patients who had a d5w w/20gm cagluc intake since 2105?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd5w w/20gm cagluc' ...
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, ...
show me flights from SAN FRANCISCO to DENVER
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
CREATE TABLE table_1341640_39 ( district VARCHAR, incumbent VARCHAR )
What district is Ray Musto the incumbent of?
SELECT district FROM table_1341640_39 WHERE incumbent = "Ray Musto"
CREATE TABLE table_name_40 ( total VARCHAR, bronze VARCHAR )
How many totals have 2 for the bronze?
SELECT COUNT(total) FROM table_name_40 WHERE bronze = 2
CREATE TABLE table_name_30 ( surface VARCHAR, outcome VARCHAR, score VARCHAR )
On what Surface was the match with a Score of 6 4, 6 3 and Runner-up Outcome played?
SELECT surface FROM table_name_30 WHERE outcome = "runner-up" AND score = "6–4, 6–3"
CREATE TABLE table_31124 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
What is the production code for the episode whose original air date was May15,2000?
SELECT "Production code" FROM table_31124 WHERE "Original air date" = 'May15,2000'
CREATE TABLE table_name_47 ( season INTEGER, assists VARCHAR, minutes VARCHAR )
What is the earliest year that Assists were less than 13 and minutes were under 91?
SELECT MIN(season) FROM table_name_47 WHERE assists < 13 AND minutes < 91
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...
inform me about lansoprazole oral disintegrating tab medications drug code and drug type.
SELECT prescriptions.drug_type, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Lansoprazole Oral Disintegrating Tab"
CREATE TABLE table_29182 ( "Rank" real, "Rider" text, "Sat 21 Aug" text, "Mon 23 Aug" text, "Tues 24 Aug" text, "Wed 25 Aug" text, "Thurs 26 Aug" text, "Fri 27 Aug" text, "Sat 28 Aug" text )
If the time on Wed aug 25 was 20' 09.25 112.324mph, what was the time on sat Aug 28?
SELECT "Sat 28 Aug" FROM table_29182 WHERE "Wed 25 Aug" = '20'' 09.25 112.324mph'
CREATE TABLE table_22962 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text )
When 4th, great lakes is the regular season what is the league?
SELECT "League" FROM table_22962 WHERE "Regular Season" = '4th, Great Lakes'
CREATE TABLE table_34055 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" text )
What is the Format o Catalog F4 87199?
SELECT "Format" FROM table_34055 WHERE "Catalog" = 'f4 87199'
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE transfers ( r...
when was the first time patient 13806 had had an intake on 01/21/2102?
SELECT inputevents_cv.charttime 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 = 13806)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) = '2102-01-21' ORDER BY inputeven...
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is average age of patients whose insurance is medicare and year of death is less than 2111?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.dod_year < "2111.0"
CREATE TABLE table_203_121 ( id number, "name" text, "pos." text, "caps" number, "goals" number, "club" text )
played on the same team as rune killing emanuelsson
SELECT "name" FROM table_203_121 WHERE "name" <> 'rune "killing" emanuelsson' AND "club" = (SELECT "club" FROM table_203_121 WHERE "name" = 'rune "killing" emanuelsson')
CREATE TABLE table_name_69 ( score VARCHAR, record VARCHAR )
What is the Score of a Record 24 23 3?
SELECT score FROM table_name_69 WHERE record = "24–23–3"
CREATE TABLE table_56281 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the smallest crowd size for away team Fitzroy?
SELECT MIN("Crowd") FROM table_56281 WHERE "Away team" = 'fitzroy'
CREATE TABLE table_name_3 ( score VARCHAR, record VARCHAR )
What is the Score of the game with a Record of 31 37 9?
SELECT score FROM table_name_3 WHERE record = "31–37–9"
CREATE TABLE table_name_87 ( method VARCHAR, round VARCHAR, event VARCHAR )
What was the method in round 1 of the UFC 20 event?
SELECT method FROM table_name_87 WHERE round = 1 AND event = "ufc 20"
CREATE TABLE table_23670057_6 ( height__f_ VARCHAR, player VARCHAR )
Name the height of demond greene
SELECT height__f_ FROM table_23670057_6 WHERE player = "Demond Greene"
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...
give me the number of patients whose diagnoses long title is personal history of surgery to other organs?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Personal history of surgery to other organs"
CREATE TABLE table_33914 ( "Year" real, "Championship" text, "Winning score" text, "Margin" text, "Runner(s)-up" text )
What was the Winning Score when Betsy Rawls was the Runner(s)-up?
SELECT "Winning score" FROM table_33914 WHERE "Runner(s)-up" = 'betsy rawls'
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 having their admission location as clinic referral/premature have been diagnosed with hepatitis nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.short_title = "Hepatitis NOS"
CREATE TABLE table_38157 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
What shows for IATA for the City of sapporo?
SELECT "IATA" FROM table_38157 WHERE "City" = 'sapporo'
CREATE TABLE catalog_contents ( catalog_entry_id number, catalog_level_number number, parent_entry_id number, previous_entry_id number, next_entry_id number, catalog_entry_name text, product_stock_number text, price_in_dollars number, price_in_euros number, price_in_pounds number...
Find the name of the product that has the smallest capacity.
SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity LIMIT 1
CREATE TABLE table_204_913 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
in how many games did sri lanka score at least 2 goals ?
SELECT COUNT(*) FROM table_204_913 WHERE "score" >= 2
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 female patients have been diagnosed with infectious mononucleosis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Infectious mononucleosis"
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Or...
What is the relationship between account name and id for each account? Return a scatter chart.
SELECT account_name, T1.account_id FROM Financial_Transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id
CREATE TABLE table_16849531_2 ( ncbi_accession_number__mrna_protein_ VARCHAR, length__bp_aa_ VARCHAR )
What is the NCBI Accession Number for the length of 5304bp/377aa?
SELECT ncbi_accession_number__mrna_protein_ FROM table_16849531_2 WHERE length__bp_aa_ = "5304bp/377aa"
CREATE TABLE captain ( rank VARCHAR )
How many captains are in each rank?
SELECT COUNT(*), rank FROM captain GROUP BY rank
CREATE TABLE table_name_73 ( opponent VARCHAR, site_stadium VARCHAR )
Who was the opponent at Lindsey Nelson Stadium?
SELECT opponent FROM table_name_73 WHERE site_stadium = "lindsey nelson stadium"
CREATE TABLE Organisations ( organisation_id INTEGER, organisation_type VARCHAR(10), organisation_details VARCHAR(255) ) CREATE TABLE Staff_Roles ( role_code VARCHAR(10), role_description VARCHAR(255) ) CREATE TABLE Documents ( document_id INTEGER, document_type_code VARCHAR(10), grant...
When do all the researcher role staff start to work? Bin the time into YEAR interval and count them with a line chart.
SELECT date_from, COUNT(date_from) FROM Project_Staff
CREATE TABLE table_204_605 ( id number, "date" text, "round" text, "opponents" text, "h / a" text, "result\nf-a" text, "scorers" text, "attendance" number )
what is the most amount of people to attend a single game this season ?
SELECT MAX("attendance") FROM table_204_605