instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the earliest game with a score of 99-89?
CREATE TABLE table_76884 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text)
SELECT MIN("Game") FROM table_76884 WHERE "Score" = '99-89'
Which Score has a Game larger than 7, and Points smaller than 14?
CREATE TABLE table_name_17 (score VARCHAR,game VARCHAR,points VARCHAR)
SELECT score FROM table_name_17 WHERE game > 7 AND points < 14
provide the number of patients whose primary disease is s/p hanging and year of death is less than or equal to 2174?
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 (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING" AND demographic.dod_year <= "2174.0"
What is the largest overall number of major hurricanes?
CREATE TABLE table_31081 ("Year" real,"Number of tropical storms" real,"Number of hurricanes" real,"Number of major hurricanes" real,"Deaths" text,"Strongest storm" text)
SELECT MAX("Number of major hurricanes") FROM table_31081
Name the height for the player born in 1980 and center?
CREATE TABLE table_17883 ("No" real,"Player" text,"Height" text,"Position" text,"Year born" real,"Current Club" text)
SELECT "Height" FROM table_17883 WHERE "Year born" = '1980' AND "Position" = 'Center'
What was the maximum speed for straight-4, 1.466 cc Type r 150?
CREATE TABLE table_45300 ("Type" text,"Construction period" text,"Cylinder" text,"Capacity" text,"Power" text,"Vmax" text)
SELECT "Vmax" FROM table_45300 WHERE "Cylinder" = 'straight-4' AND "Capacity" = '1.466 cc' AND "Type" = 'r 150'
Give me a histogram for how many events are there for each party?
CREATE TABLE party_events (Event_ID int,Event_Name text,Party_ID int,Member_in_charge_ID int)CREATE TABLE member (Member_ID int,Member_Name text,Party_ID text,In_office text)CREATE TABLE region (Region_ID int,Region_name text,Date text,Label text,Format text,Catalogue text)CREATE TABLE party (Party_ID int,Minister text...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID
What is the smallest diameter for Eirene Tholus?
CREATE TABLE table_name_97 (diameter__km_ INTEGER,name VARCHAR)
SELECT MIN(diameter__km_) FROM table_name_97 WHERE name = "eirene tholus"
For games on December 20, how many points did the scoring leaders get?
CREATE TABLE table_16311 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High points" FROM table_16311 WHERE "Date" = 'December 20'
tell me the first lab test that was given to patient 13838 in 08/2102?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id nu...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13838) AND STRFTIME('%y-%m', labevents.charttime) = '2102-08' ORDER BY labevents.charttime LIMIT 1)
what is the maximum first elected with incumbent being gus yatron
CREATE TABLE table_18254 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT MAX("First elected") FROM table_18254 WHERE "Incumbent" = 'Gus Yatron'
Who was the opponent during the competition in which the bowling figures were 5-33 (10)?
CREATE TABLE table_56381 ("Bowling figures Wickets-Runs (Overs)" text,"Bowler" text,"Versus" text,"Venue" text,"Date" text)
SELECT "Versus" FROM table_56381 WHERE "Bowling figures Wickets-Runs (Overs)" = '5-33 (10)'
For any rating where the name of reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars.
CREATE TABLE Rating (stars VARCHAR,mID VARCHAR,rID VARCHAR)CREATE TABLE Reviewer (name VARCHAR,rID VARCHAR)CREATE TABLE Movie (title VARCHAR,mID VARCHAR,director VARCHAR)
SELECT DISTINCT T3.name, T2.title, T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name
How many grids for peter collins?
CREATE TABLE table_name_71 (grid VARCHAR,driver VARCHAR)
SELECT COUNT(grid) FROM table_name_71 WHERE driver = "peter collins"
Name the current womens lacrosse conference for 6000 enrollment
CREATE TABLE table_3756 ("Institution" text,"City" text,"Nickname" text,"Founded" real,"Affiliation" text,"Enrollment" real,"Tenure" text,"Current womens lacrosse conference" text)
SELECT "Current womens lacrosse conference" FROM table_3756 WHERE "Enrollment" = '6000'
what's the s mestizo with population being 29461933
CREATE TABLE table_18062 ("Country" text,"Population" real,"Native American" text,"Whites" text,"s Mestizo" text,"es Mulatto" text,"Blacks" text,"s Zambo" text,"Asians" text)
SELECT "s Mestizo" FROM table_18062 WHERE "Population" = '29461933'
What are the address and phone number of the buildings managed by 'Brenden'?
CREATE TABLE apartment_facilities (apt_id number,facility_code text)CREATE TABLE apartment_bookings (apt_booking_id number,apt_id number,guest_id number,booking_status_code text,booking_start_date time,booking_end_date time)CREATE TABLE view_unit_status (apt_id number,apt_booking_id number,status_date time,available_yn...
SELECT building_address, building_phone FROM apartment_buildings WHERE building_manager = "Brenden"
Who was the driver when there were 35 laps?
CREATE TABLE table_name_10 (driver VARCHAR,laps VARCHAR)
SELECT driver FROM table_name_10 WHERE laps = "35"
Pie chart. what are the different transaction types, and how many transactions of each have taken place?
CREATE TABLE Customers_Cards (card_id INTEGER,customer_id INTEGER,card_type_code VARCHAR(15),card_number VARCHAR(80),date_valid_from DATETIME,date_valid_to DATETIME,other_card_details VARCHAR(255))CREATE TABLE Customers (customer_id INTEGER,customer_first_name VARCHAR(20),customer_last_name VARCHAR(20),customer_address...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type
What is the attendance of week 1
CREATE TABLE table_name_92 (attendance VARCHAR,week VARCHAR)
SELECT attendance FROM table_name_92 WHERE week = 1
Mike Crowley plays defense for league?
CREATE TABLE table_name_86 (college_junior_club_team__league_ VARCHAR,position VARCHAR,player VARCHAR)
SELECT college_junior_club_team__league_ FROM table_name_86 WHERE position = "defense" AND player = "mike crowley"
show me the ground transportation at DENVER
CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CR...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code
What Inclination has Eccentricity of 0.06 +0.06 0.11?
CREATE TABLE table_62079 ("Companion (in order from star)" text,"Mass" text,"Semimajor axis (AU)" text,"Orbital period (s day)" text,"Eccentricity" text,"Inclination" text)
SELECT "Inclination" FROM table_62079 WHERE "Eccentricity" = '0.06 +0.06 −0.11'
Which Nationality has a Rank larger than 3, and a Name of tom hilde?
CREATE TABLE table_name_71 (nationality VARCHAR,rank VARCHAR,name VARCHAR)
SELECT nationality FROM table_name_71 WHERE rank > 3 AND name = "tom hilde"
how many male patients are below 24 years of age?
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 (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "24"
In how many teams is Waqar Younis the head coach?
CREATE TABLE table_19905183_1 (team VARCHAR,head_coach VARCHAR)
SELECT COUNT(team) FROM table_19905183_1 WHERE head_coach = "Waqar Younis"
get the number of patients who suffered from pneumonia primary disease and were never hospitalized.
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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA" AND demographic.days_stay > "0"
What is Website, when Last Release is 2009-08-09, 1.2.9?
CREATE TABLE table_49051 ("Source Version" text,"Target Version" text,"Last Release" text,"License" text,"Website" text)
SELECT "Website" FROM table_49051 WHERE "Last Release" = '2009-08-09, 1.2.9'
which competition did this runner participate in after the xiamen international marathon ?
CREATE TABLE table_204_880 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text)
SELECT "competition" FROM table_204_880 WHERE id = (SELECT id FROM table_204_880 WHERE "competition" = 'xiamen international marathon') + 1
Who is the original artist of the 3:00 song?
CREATE TABLE table_63567 ("Song" text,"Performer" text,"Original artist" text,"Length" text,"Recorded" text)
SELECT "Original artist" FROM table_63567 WHERE "Length" = '3:00'
provide the number of patients whose discharge location is home health care and lab test name is urea nitrogen?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND lab.label = "Urea Nitrogen"
What character does Italian voice actor Emanuela Damasio play?
CREATE TABLE table_name_48 (character VARCHAR,italian_voice_actor VARCHAR)
SELECT character FROM table_name_48 WHERE italian_voice_actor = "emanuela damasio"
What is the name of the player when the Score was 72-73-67-72=284?
CREATE TABLE table_8311 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real)
SELECT "Player" FROM table_8311 WHERE "Score" = '72-73-67-72=284'
What is the result for an H/A of H and a round value of R6 replay?
CREATE TABLE table_name_29 (result VARCHAR,h___a VARCHAR,round VARCHAR)
SELECT result FROM table_name_29 WHERE h___a = "h" AND round = "r6 replay"
Natural change of 42 689 has which lowest Crude birth rate (per 1000)?
CREATE TABLE table_name_49 (crude_birth_rate__per_1000_ INTEGER,natural_change VARCHAR)
SELECT MIN(crude_birth_rate__per_1000_) FROM table_name_49 WHERE natural_change = "42 689"
What is Jerry Barber's To par?
CREATE TABLE table_name_74 (to_par VARCHAR,player VARCHAR)
SELECT to_par FROM table_name_74 WHERE player = "jerry barber"
What opponent has balboa stadium as the opponent?
CREATE TABLE table_name_4 (opponent VARCHAR,stadium VARCHAR)
SELECT opponent FROM table_name_4 WHERE stadium = "balboa stadium"
Count the number of distinct governors.
CREATE TABLE party (party_id number,year number,party text,governor text,lieutenant_governor text,comptroller text,attorney_general text,us_senate text)CREATE TABLE election (election_id number,counties_represented text,district number,delegate text,party number,first_elected number,committee text)CREATE TABLE county (...
SELECT COUNT(DISTINCT governor) FROM party
which toadies ' song ranked highest in the us main chart in 1995 ?
CREATE TABLE table_203_751 (id number,"year" number,"title" text,"peak chart positions\nus\nair" number,"peak chart positions\nus\nmain" number,"peak chart positions\nus\nmod" number,"album" text)
SELECT "title" FROM table_203_751 WHERE "year" = 1995 ORDER BY "peak chart positions\nus\nmain" LIMIT 1
What's the comp when the score was 393?
CREATE TABLE table_name_81 (comp VARCHAR,score VARCHAR)
SELECT comp FROM table_name_81 WHERE score = "393"
Count the number of patient who were born before the year 1879 and had the drug route dialysis?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1879" AND prescriptions.route = "DIALYS"
Downvoters Hall of Shame (by percentage). The top 100 downvoters by percentage
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Review...
SELECT Id AS "user_link", UpVotes, DownVotes, (DownVotes) * 100 / (DownVotes + UpVotes) AS DownVotesPCT FROM Users WHERE DownVotes > 100 AND Id != -1 ORDER BY DownVotesPCT DESC LIMIT 100
Which company has an author of Aristophanes and play of Plutus?
CREATE TABLE table_name_74 (company VARCHAR,author VARCHAR,play VARCHAR)
SELECT company FROM table_name_74 WHERE author = "aristophanes" AND play = "plutus"
Who is the Constructor for driver Piercarlo Ghinzani and a Ford cosworth dfv 3.0 v8 engine?
CREATE TABLE table_77629 ("Entrant" text,"Constructor" text,"Chassis" text,"Engine" text,"Tyres" text,"Driver" text,"Rounds" text)
SELECT "Constructor" FROM table_77629 WHERE "Driver" = 'piercarlo ghinzani' AND "Engine" = 'ford cosworth dfv 3.0 v8'
What is average quantity, when DRG number is 99 011?
CREATE TABLE table_name_85 (quantity INTEGER,drg_number_s_ VARCHAR)
SELECT AVG(quantity) FROM table_name_85 WHERE drg_number_s_ = "99 011"
What is the total number of weeks that the Seahawks had a record of 5-5?
CREATE TABLE table_71369 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real)
SELECT COUNT("Week") FROM table_71369 WHERE "Record" = '5-5'
Which parishes have a railroad length of 51.8 meters?
CREATE TABLE table_20626 ("No." real,"Name" text,"Mi from Kingston" text,"Km from Kingston" text,"Parish" text,"Length feet" real,"Length meters" text)
SELECT "Parish" FROM table_20626 WHERE "Length meters" = '51.8'
What is the rnd for gt1 winning team for doc bundy andy wallace?
CREATE TABLE table_432 ("Rnd" real,"Circuit" text,"CA Winning Team" text,"GT1 Winning Team" text,"GT2 Winning Team" text,"GT3 Winning Team" text,"Results" text)
SELECT "Rnd" FROM table_432 WHERE "GT1 Winning Team" = 'Doc Bundy Andy Wallace'
What is the amount of points for the team with 13 wins?
CREATE TABLE table_16034882_4 (points VARCHAR,wins VARCHAR)
SELECT points FROM table_16034882_4 WHERE wins = 13
Compare the prices of furnitures which some companies are manufacturing by each name using a bar chart.
CREATE TABLE furniture_manufacte (Manufacturer_ID int,Furniture_ID int,Price_in_Dollar real)CREATE TABLE furniture (Furniture_ID int,Name text,Num_of_Component int,Market_Rate real)CREATE TABLE manufacturer (Manufacturer_ID int,Open_Year real,Name text,Num_of_Factories int,Num_of_Shops int)
SELECT Name, Price_in_Dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID
What is the lowest Total, when Second is '55'?
CREATE TABLE table_61390 ("Season" text,"Premier" real,"First" real,"Second" real,"Total" real)
SELECT MIN("Total") FROM table_61390 WHERE "Second" = '55'
when did patient 25696's last visit to the hospital happen during a year before?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABL...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 25696 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime DESC LIMIT 1
Find the name and level of catalog structure with level between 5 and 10, rank by the bars in asc.
CREATE TABLE Catalog_Structure (catalog_level_number INTEGER,catalog_id INTEGER,catalog_level_name VARCHAR(50))CREATE TABLE Catalogs (catalog_id INTEGER,catalog_name VARCHAR(50),catalog_publisher VARCHAR(80),date_of_publication DATETIME,date_of_latest_revision DATETIME)CREATE TABLE Catalog_Contents (catalog_entry_id IN...
SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 ORDER BY catalog_level_name
when did the last intake of patient 027-106613 have been until 07/17/2103?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-106613')) AND intakeoutput.cellpath LIKE '%intake...
What's the sum of Quantity for the Class of 1928 of CI-30?
CREATE TABLE table_13346 ("Class to 1928" text,"Class from 1928" text,"Seats" text,"Quantity" real,"Year(s) of Manufacture" text)
SELECT SUM("Quantity") FROM table_13346 WHERE "Class from 1928" = 'ci-30'
when did patient 18678 enter the hospital via the phys referral/normal deli for the first time since 3 years ago?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 18678 AND admissions.admission_location = 'phys referral/normal deli' AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY admissions.admittime LIMIT 1
Where was the game site on October 29, 1989?
CREATE TABLE table_20485 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game Site" text,"Attendance" real)
SELECT "Game Site" FROM table_20485 WHERE "Date" = 'October 29, 1989'
what is the average yearly number of people diagnosed with posttraumatic stress dis until 2 years ago?
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id numbe...
SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'posttraumatic stress dis') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-2 year'...
who won with a score of 199 (-14) on oct 31?
CREATE TABLE table_name_21 (winner VARCHAR,score VARCHAR,date VARCHAR)
SELECT winner FROM table_name_21 WHERE score = "199 (-14)" AND date = "oct 31"
Which counties have two or more delegates? Give me the county names.
CREATE TABLE party (party_id number,year number,party text,governor text,lieutenant_governor text,comptroller text,attorney_general text,us_senate text)CREATE TABLE county (county_id number,county_name text,population number,zip_code text)CREATE TABLE election (election_id number,counties_represented text,district numb...
SELECT T1.county_name FROM county AS T1 JOIN election AS T2 ON T1.county_id = T2.district GROUP BY T1.county_id HAVING COUNT(*) >= 2
What was the Name of the person with a Qual 1 of 1:26.056?
CREATE TABLE table_37747 ("Name" text,"Team" text,"Qual 1" text,"Qual 2" text,"Best" text)
SELECT "Name" FROM table_37747 WHERE "Qual 1" = '1:26.056'
Which opponent has a week less than 2?
CREATE TABLE table_62345 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT "Opponent" FROM table_62345 WHERE "Week" < '2'
Return a histogram on what are the names and distances for all airplanes?, and display from low to high by the y axis.
CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,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 employee (eid number(9,0),name varchar2(30),salary nu...
SELECT name, distance FROM aircraft ORDER BY distance
How many steals did jasmine wynne have?
CREATE TABLE table_23346303_4 (steals VARCHAR,player VARCHAR)
SELECT steals FROM table_23346303_4 WHERE player = "Jasmine Wynne"
Draw a scatterplot of school id vs all_games_percent where school id is on the x-axis and points are colored by All_Road
CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce...
SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY All_Road
which team recorded a higher average attendance in the japanese football league in 2001 , jatco fc or ykk fc ?
CREATE TABLE table_203_561 (id number,"pos" number,"team" text,"total" number,"high" number,"low" number,"average" number,"change" text)
SELECT "team" FROM table_203_561 WHERE "team" IN ('jatco fc', 'ykk fc') ORDER BY "average" DESC LIMIT 1
Which City has a Date on october 26, 2007
CREATE TABLE table_name_70 (city VARCHAR,date VARCHAR)
SELECT city FROM table_name_70 WHERE date = "october 26, 2007"
A bar chart showing the average weight for each gender, I want to show from low to high by the y axis.
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 real)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight)
Visualize a bar chart about the distribution of Date_of_Birth and Weight , and could you display x-axis from low to high order?
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 real)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)
SELECT Date_of_Birth, Weight FROM people ORDER BY Date_of_Birth
Who had fa cup goals of 0, league cup goals less than 2, and total goals of 2?
CREATE TABLE table_name_83 (name VARCHAR,total_goals VARCHAR,fa_cup_goals VARCHAR,league_cup_goals VARCHAR)
SELECT name FROM table_name_83 WHERE fa_cup_goals = 0 AND league_cup_goals < 2 AND total_goals = 2
Bar chart x axis year y axis total number of avg(price), and list from low to high by the Y.
CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)
SELECT Year, SUM(AVG(Price)) FROM wine ORDER BY SUM(AVG(Price))
please list all the flights from DALLAS to SAN FRANCISCO
CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE date_day (month_number int,day_number...
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...
Which Condition has an unaffected Prothrombin time and a Bleeding time, and a Partial thromboplastin time of prolonged?
CREATE TABLE table_name_73 (condition VARCHAR,partial_thromboplastin_time VARCHAR,prothrombin_time VARCHAR,bleeding_time VARCHAR)
SELECT condition FROM table_name_73 WHERE prothrombin_time = "unaffected" AND bleeding_time = "unaffected" AND partial_thromboplastin_time = "prolonged"
What Colors has a School of sesser high school?
CREATE TABLE table_61828 ("School" text,"Location" text,"Nickname(s)" text,"Colors" text,"Years Member" text)
SELECT "Colors" FROM table_61828 WHERE "School" = 'sesser high school'
what is the number of patients whose year of birth is less than 2043 and lab test fluid is ascites?
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,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2043" AND lab.fluid = "Ascites"
What was the surface type at Takao Suzuki?
CREATE TABLE table_56312 ("Date" text,"Tournament" text,"Surface" text,"Opponent in the final" text,"Score" text)
SELECT "Surface" FROM table_56312 WHERE "Opponent in the final" = 'takao suzuki'
Get sum of bounty amount by post_id and user Id and give the second highest bounty amount from group.
CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number...
SELECT * FROM TagSynonyms WHERE Id = (SELECT MAX(Id) FROM TagSynonyms)
How many points were scored by car number 10 that ended with a collision?
CREATE TABLE table_name_20 (points VARCHAR,time_retired VARCHAR,car_no VARCHAR)
SELECT points FROM table_name_20 WHERE time_retired = "collision" AND car_no = "10"
What was the result when then opponents conference was Mac (east)?
CREATE TABLE table_28418916_3 (result VARCHAR,opponents_conference VARCHAR)
SELECT result FROM table_28418916_3 WHERE opponents_conference = "MAC (East)"
Plot mean age by grouped by sex as a bar graph, and could you sort bar in asc order?
CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Dorm (dormid INTEGER,dorm_name VARCHAR(20),student_capacity INTEGER,gender VARCHAR(1))CREATE TABLE Has_amenity (dormid INTEGER,amenid INTEGER)CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCH...
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex
On which date was Raymond Felton (6) the high assists and Jason Richardson (42) the high points?
CREATE TABLE table_name_32 (date VARCHAR,high_assists VARCHAR,high_points VARCHAR)
SELECT date FROM table_name_32 WHERE high_assists = "raymond felton (6)" AND high_points = "jason richardson (42)"
Who did Walter B. Jones, Sr. (d) succeeded in office?
CREATE TABLE table_22355 ("District" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date successor seated" text)
SELECT "Vacator" FROM table_22355 WHERE "Successor" = 'Walter B. Jones, Sr. (D)'
Show me a pie chart for how many songs were released for each format?
CREATE TABLE genre (g_name varchar2(20),rating varchar2(10),most_popular_in varchar2(50))CREATE TABLE song (song_name varchar2(50),artist_name varchar2(50),country varchar2(20),f_id number(10),genre_is varchar2(20),rating number(10),languages varchar2(20),releasedate Date,resolution number(10))CREATE TABLE artist (arti...
SELECT formats, COUNT(*) FROM files GROUP BY formats
What is the ratings for the original air date may 25, 2010 22.00 - 22.54?
CREATE TABLE table_28797 ("Episode" real,"Title" text,"Writer" text,"Director" text,"Original airdate" text,"Ratings (Kanto)" text,"Ratings (Kansai)" text)
SELECT "Ratings (Kansai)" FROM table_28797 WHERE "Original airdate" = 'May 25, 2010 22.00 - 22.54'
Away result of 1 1, and a Round of 1r, and a Season of 1967-68 involves what club?
CREATE TABLE table_name_92 (club VARCHAR,season VARCHAR,away_result VARCHAR,round VARCHAR)
SELECT club FROM table_name_92 WHERE away_result = "1–1" AND round = "1r" AND season = "1967-68"
Which church was built in 1600?
CREATE TABLE table_62566 ("Parish (Prestegjeld)" text,"Sub-Parish (Sokn)" text,"Church Name" text,"Year Built" real,"Location of the Church" text)
SELECT "Church Name" FROM table_62566 WHERE "Year Built" = '1600'
In what district is the incumbent John Linder?
CREATE TABLE table_19753079_13 (district VARCHAR,incumbent VARCHAR)
SELECT district FROM table_19753079_13 WHERE incumbent = "John Linder"
tell me the monthly minimum amount of tpn d13.5 in patient 26469's body since 04/2105?
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 icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid nu...
SELECT MIN(inputevents_cv.amount) 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 = 26469)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
What is the record when the game was played at raymond james stadium?
CREATE TABLE table_32822 ("Week" text,"Date" text,"Opponent" text,"Result" text,"Kickoff" text,"Game site" text,"Record" text)
SELECT "Record" FROM table_32822 WHERE "Game site" = 'raymond james stadium'
Find the number of the the date of enrollment of the 'Spanish' course, and list in asc by the Y-axis please.
CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VARCHAR(3),login_name VARCHAR(40),password VARCHAR(40),personal_name VARCHAR(80),middle_name VARCHAR(80),family_name VARCHAR(80),gender_mf VARCHAR(1),address_line_1 VARCHAR(80))CREATE TABLE Student_Course_Enrolment (registration_id INTEGER,stude...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish" ORDER BY COUNT(date_of_enrolment)
Show all artist names who didn't have an exhibition in 2004.
CREATE TABLE artist (artist_id number,name text,country text,year_join number,age number)CREATE TABLE exhibition_record (exhibition_id number,date text,attendance number)CREATE TABLE exhibition (exhibition_id number,year number,theme text,artist_id number,ticket_price number)
SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.year = 2004
What was coach Dick Bennett's overall win percentage?
CREATE TABLE table_name_5 (overall_win_percentage VARCHAR,coach VARCHAR)
SELECT overall_win_percentage FROM table_name_5 WHERE coach = "dick bennett"
which aircraft has the top number of aircraft in service ?
CREATE TABLE table_204_161 (id number,"name" text,"1968 cf\ndesignator" text,"place of\nmanufacture" text,"primary\nrole(s)" text,"service\nperiod" text,"#\nused" number)
SELECT "name" FROM table_204_161 ORDER BY "#\nused" DESC LIMIT 1
i mean what was the first respiration for patient 016-23497 on the last icu visit?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature n...
SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-23497') AND NOT patient.unitdischargetime IS NULL O...
what was the marital status of patient 90165 during the first hospital encounter?
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid...
SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 90165 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
What are the id and name of the stations that have ever had more than 12 bikes available?
CREATE TABLE status (station_id number,bikes_available number,docks_available number,time text)CREATE TABLE station (id number,name text,lat number,long number,dock_count number,city text,installation_date text)CREATE TABLE trip (id number,duration number,start_date text,start_station_name text,start_station_id number,...
SELECT DISTINCT T1.id, T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12
the value of mcv of patient 17237 was last measured on the last hospital visit less than second to last measured on the last hospital visit?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE cost (row_id number,subject_id number,hadm_i...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17237 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...
what were the five most frequent microbiological tests that followed within 2 months for patients who received glucose - d50 since 2101?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucose - d50' AND STRFTIME('%y', treatment....
Number of upvotes and downvotes by a given user.
CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE FlagTypes ...
SELECT Id AS "user_link", UpVotes, DownVotes FROM Users WHERE Id = '##id##'
Which To par has a Player of bernhard langer?
CREATE TABLE table_name_34 (to_par VARCHAR,player VARCHAR)
SELECT to_par FROM table_name_34 WHERE player = "bernhard langer"