table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion number, profits_billion number, assets_billion number, market_value number ) CREATE TABLE station_company ( station_id number, company_id number, ran...
What are the names and headquarters of all companies ordered by descending market value?
SELECT company, headquarters FROM company ORDER BY market_value DESC
CREATE TABLE table_204_912 ( id number, "rank" number, "athlete" text, "country" text, "time" number, "notes" text )
how many competitors were from the soviet union ?
SELECT COUNT("athlete") FROM table_204_912 WHERE "country" = 'soviet union'
CREATE TABLE table_name_25 ( event VARCHAR, opponent VARCHAR )
In what event is the opponent Joe Nameth?
SELECT event FROM table_name_25 WHERE opponent = "joe nameth"
CREATE TABLE city ( City_ID int, City text, Hanzi text, Hanyu_Pinyin text, Regional_Population int, GDP real ) CREATE TABLE hosting_city ( Year int, Match_ID int, Host_City text ) CREATE TABLE temperature ( City_ID int, Jan real, Feb real, Mar real, Apr real, ...
For each competition, count the number of matches, and rank in desc by the X-axis.
SELECT Competition, COUNT(*) FROM match GROUP BY Competition ORDER BY Competition DESC
CREATE TABLE table_48047 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What score did Australia get?
SELECT "Score" FROM table_48047 WHERE "Country" = 'australia'
CREATE TABLE table_name_99 ( week INTEGER, opponent VARCHAR, attendance VARCHAR )
What is the average week with St. Louis Cardinals with less than 80,010 attendance?
SELECT AVG(week) FROM table_name_99 WHERE opponent = "st. louis cardinals" AND attendance < 80 OFFSET 010
CREATE TABLE table_79560 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Which tie number had an away team of Arsenal?
SELECT "Tie no" FROM table_79560 WHERE "Away team" = 'arsenal'
CREATE TABLE table_78047 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Trofeo Fast Team" text )
who was the trofeo fast team in stage 10?
SELECT "Trofeo Fast Team" FROM table_78047 WHERE "Stage" = '10'
CREATE TABLE table_47836 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the score when Fulham is the away team?
SELECT "Score" FROM table_47836 WHERE "Away team" = 'fulham'
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 ...
how much ns was prescribed during this month for the first time to patient 76332?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76332) AND prescriptions.drug = 'ns' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY presc...
CREATE TABLE table_name_44 ( attendance VARCHAR, result VARCHAR )
How many people attended the game when the game was won 4-2?
SELECT COUNT(attendance) FROM table_name_44 WHERE result = "won 4-2"
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 )
What is the total revenue of each manufacturer, sort in ascending by the names.
SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name
CREATE TABLE table_name_93 ( byes INTEGER, losses VARCHAR, draws VARCHAR )
What is the highest number of byes where the losses were 9 and the draws were less than 0?
SELECT MAX(byes) FROM table_name_93 WHERE losses = 9 AND draws < 0
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( fieldid int, ...
what author is most cited ?
SELECT DISTINCT author.authorname, COUNT(cite.citingpaperid) FROM author, cite, writes WHERE writes.authorid = author.authorid AND writes.paperid = cite.citedpaperid GROUP BY author.authorname ORDER BY COUNT(cite.citingpaperid) DESC
CREATE TABLE table_13118 ( "Mark" text, "Wind*" text, "Athlete" text, "Nationality" text, "Venue" text, "Date" text )
Which Wind* has a Nationality of united states, and an Athlete of jackie joyner-kersee?
SELECT "Wind*" FROM table_13118 WHERE "Nationality" = 'united states' AND "Athlete" = 'jackie joyner-kersee'
CREATE TABLE table_name_20 ( episode INTEGER, segment_d VARCHAR )
What episode has a manual motorcycle transmissions section D?
SELECT SUM(episode) FROM table_name_20 WHERE segment_d = "manual motorcycle transmissions"
CREATE TABLE table_29827 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the score when andray blatche , al thornton (20) had the high points?
SELECT "Score" FROM table_29827 WHERE "High points" = 'Andray Blatche , Al Thornton (20)'
CREATE TABLE table_65198 ( "Rank" text, "Country" text, "Jerseys" real, "Giro wins" real, "Points" real, "Young rider" real, "Most recent cyclist" text, "Most recent date" text, "Different holders" real )
what is the least different holders when the country is ireland and giro wins is less than 1?
SELECT MIN("Different holders") FROM table_65198 WHERE "Country" = 'ireland' AND "Giro wins" < '1'
CREATE TABLE table_name_81 ( result VARCHAR, date VARCHAR )
What was the result on 27 august 2003?
SELECT result FROM table_name_81 WHERE date = "27 august 2003"
CREATE TABLE table_name_66 ( december INTEGER, score VARCHAR )
What is the lowest December, when Score is '4 - 4'?
SELECT MIN(december) FROM table_name_66 WHERE score = "4 - 4"
CREATE TABLE individuals ( individual_id number, individual_first_name text, individual_middle_name text, inidividual_phone text, individual_email text, individual_address text, individual_last_name text ) CREATE TABLE party_services ( booking_id number, customer_id number, serv...
Find the name of organizations whose names contain 'Party'.
SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%"
CREATE TABLE table_14135 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "TV Time" text, "Attendance" text )
Which week was the December 21, 2003 game?
SELECT "Week" FROM table_14135 WHERE "Date" = 'december 21, 2003'
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
when were patient 20332 first prescribed for aspirin and potassium chl 20 meq / 1000 ml d5 1/2 ns at the same time?
SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'aspirin' AND admissions.subject_id = 20332) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JO...
CREATE TABLE VOTING_RECORD ( Id VARCHAR )
Find the number of voting records in total.
SELECT COUNT(*) FROM VOTING_RECORD
CREATE TABLE table_28891101_3 ( census_2006_population VARCHAR, area__km_2__ VARCHAR )
What is the 2006 census population when the area is 159?
SELECT COUNT(census_2006_population) FROM table_28891101_3 WHERE area__km_2__ = 159
CREATE TABLE table_52412 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What was the biggest draws, for wins under 4, and points of 20-18?
SELECT MAX("Draws") FROM table_52412 WHERE "Points" = '20-18' AND "Wins" < '4'
CREATE TABLE table_41784 ( "Year" real, "Country" text, "Team" text, "Individual" text, "Location" text )
What is the Team when the match was in buenos aires , argentina?
SELECT "Team" FROM table_41784 WHERE "Location" = 'buenos aires , argentina'
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
count the number of times that patient 005-46456 had received a protein - csf test during the previous month?
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND lab.labname = 'protein - csf' AND DATETIME(lab.labresulttime, 'start of mon...
CREATE TABLE table_22178 ( "Season" real, "Average Attendance Home" text, "Highest Attendance Home" text, "Average Attendance Away" text, "Highest Attendance Away" text, "Division / Section" text, "Level" text, "Average Attendance League" text )
When the average away attendance is 1.889 in the Superettan, what's the average home attendance?
SELECT "Average Attendance Home" FROM table_22178 WHERE "Division / Section" = 'Superettan' AND "Average Attendance Away" = '1.889'
CREATE TABLE table_name_85 ( round INTEGER, position VARCHAR )
what is the round when the position is (c)?
SELECT MAX(round) FROM table_name_85 WHERE position = "(c)"
CREATE TABLE table_62451 ( "Class" text, "Number(s)" text, "Quantity" text, "Year(s) of Manufacture" text, "Type" text )
What is the quantity of class B V?
SELECT "Quantity" FROM table_62451 WHERE "Class" = 'b v'
CREATE TABLE table_name_39 ( date_of_attack VARCHAR, fate VARCHAR, cargo VARCHAR )
What is the Date of attack of the ship with iron ore sunk by u-101 *?
SELECT date_of_attack FROM table_name_39 WHERE fate = "sunk by u-101 *" AND cargo = "iron ore"
CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
where is a good place in mountain view for arabic food ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
CREATE TABLE products ( product_id VARCHAR, product_type_code VARCHAR, product_price VARCHAR )
What are the product id and product type of the cheapest product?
SELECT product_id, product_type_code FROM products ORDER BY product_price LIMIT 1
CREATE TABLE table_name_75 ( game_site VARCHAR, opponent VARCHAR )
Which game site has an Opponent of buffalo bills?
SELECT game_site FROM table_name_75 WHERE opponent = "buffalo bills"
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
how many patients stayed in hospital for more than 10 days and procedured for coronary arteriography using two catheters?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "10" AND procedures.long_title = "Coronary arteriography using two catheters"
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE status ( station_i...
For each station, just simply show its longitude and the average duration of trips that started from the station using a scatter chart.
SELECT long, AVG(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id GROUP BY T2.start_station_id
CREATE TABLE table_68760 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Which tournament has a Date of april 20, 1987?
SELECT "Tournament" FROM table_68760 WHERE "Date" = 'april 20, 1987'
CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team i...
How many players played each position. Plot them as bar chart.
SELECT Position, COUNT(*) FROM match_season GROUP BY Position
CREATE TABLE table_204_603 ( id number, "pos" text, "no" number, "rider" text, "bike" text, "laps" number, "time" text, "grid" number, "points" number )
what rider finished next after jonas folger ?
SELECT "rider" FROM table_204_603 WHERE "pos" = (SELECT "pos" FROM table_204_603 WHERE "rider" = 'jonas folger') + 1
CREATE TABLE table_18069 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text )
Name the number of shows when there was 2 million views
SELECT COUNT("U.S. viewers (million)") FROM table_18069 WHERE "No. in season" = '2'
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, show me about the correlation between salary and manager_id in a scatter chart.
SELECT SALARY, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
had patient 016-1459's systemicdiastolic been normal.
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-1459')) AND vitalperiodic.systemicdiastolic BETWEEN diastolic_bp...
CREATE TABLE table_name_11 ( width__inches_ VARCHAR, length__feet_ VARCHAR, engine VARCHAR, retired VARCHAR )
For a vehicle below 25 feet, that was retired in 2005 and had a navistar t444e engine, what was the total width?
SELECT COUNT(width__inches_) FROM table_name_11 WHERE engine = "navistar t444e" AND retired = "2005" AND length__feet_ < 25
CREATE TABLE table_name_5 ( fa_cup_goals INTEGER, league_goals VARCHAR )
What is the sum of FA Cup goals when there are 19 league goals?
SELECT SUM(fa_cup_goals) FROM table_name_5 WHERE league_goals = "19"
CREATE TABLE table_2009095_2 ( year INTEGER, opponents VARCHAR )
Name the least year for evonne goolagong helen gourlay
SELECT MIN(year) FROM table_2009095_2 WHERE opponents = "Evonne Goolagong Helen Gourlay"
CREATE TABLE table_32745 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
What laps have a Time of +28.778?
SELECT "Laps" FROM table_32745 WHERE "Time" = '+28.778'
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
Visualize a bar chart about the distribution of Nationality and the sum of meter_100 , and group by attribute Nationality, and I want to display from high to low by the y-axis.
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY SUM(meter_100) DESC
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE T...
Highest and lowest voted posts.
SELECT 'site://questions/' + CAST(Id AS TEXT) AS "question_with_highest_score" FROM Posts ORDER BY Score DESC LIMIT 1
CREATE TABLE table_79764 ( "Tournament" text, "Wins" real, "Top-25" real, "Events" real, "Cuts made" real )
How many cuts did he make at the PGA championship in 3 events?
SELECT MAX("Cuts made") FROM table_79764 WHERE "Tournament" = 'pga championship' AND "Events" > '3'
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE T...
JavaScript MVC Framework Trends (Bottom-Tier, from TodoMVC) (# of Questions per Month).
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
CREATE TABLE table_28485 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
What is the order # for the original artist sarah mclachlan?
SELECT "Order #" FROM table_28485 WHERE "Original artist" = 'Sarah McLachlan'
CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE video...
Show all advisors who have at least two students.
SELECT advisor FROM student GROUP BY advisor HAVING COUNT(*) >= 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...
for how many days did the subject id 64208 stay in the hospital?
SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "64208"
CREATE TABLE table_204_384 ( id number, "#" number, "air date" text, "timeslot (est)" text, "season" text, "rating" number, "share" number, "18-49 (rating/share)" text, "viewers (m)" number, "weekly rank (#)" number )
what episode had the highest rating ?
SELECT "air date" FROM table_204_384 ORDER BY "rating" DESC LIMIT 1
CREATE TABLE table_68093 ( "Name" text, "Position" text, "Club career" text, "League apps" real, "League goals" real, "Total apps" real, "Total goals" real )
What is the fewest total goals scored for players with under 171 league appearances, 151 total appearances, and the DF position?
SELECT MIN("Total goals") FROM table_68093 WHERE "League apps" < '171' AND "Total apps" = '151' AND "Position" = 'df'
CREATE TABLE table_name_76 ( potassium VARCHAR, lithium VARCHAR, sodium VARCHAR )
what is the properties of potassium when lithium is h a l o g e n s and sodium is bromine?
SELECT potassium FROM table_name_76 WHERE lithium = "h a l o g e n s" AND sodium = "bromine"
CREATE TABLE table_name_7 ( loss VARCHAR, record VARCHAR )
Which loss had a record of 79-49?
SELECT loss FROM table_name_7 WHERE record = "79-49"
CREATE TABLE table_9281 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text )
Which Record has a Date of june 26?
SELECT "Record" FROM table_9281 WHERE "Date" = 'june 26'
CREATE TABLE table_36262 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" real )
Opponent of chicago bears involved what date?
SELECT "Date" FROM table_36262 WHERE "Opponent" = 'chicago bears'
CREATE TABLE table_name_77 ( blagojevich__d_ VARCHAR, date VARCHAR )
Which Blagojevich (D) happened on october 16, 2006?
SELECT blagojevich__d_ FROM table_name_77 WHERE date = "october 16, 2006"
CREATE TABLE table_66513 ( "Year" real, "Category" text, "Nominee(s)" text, "Episode" text, "Result" text )
What was the result for the years after 2001?
SELECT "Result" FROM table_66513 WHERE "Year" > '2001'
CREATE TABLE table_27061 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
When 120 is the number in series who is the writer?
SELECT "Written by" FROM table_27061 WHERE "No. in series" = '120'
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) ...
Give me the comparison about meter_100 over the meter_500 by a bar chart, rank in asc by the bar.
SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_500
CREATE TABLE table_34133 ( "Year" text, "Title" text, "Director" text, "Distributor(s)" text, "Box office" text )
What is the movie that Paul Schneider directed?
SELECT "Title" FROM table_34133 WHERE "Director" = 'paul schneider'
CREATE TABLE table_18894 ( "Title and Source" text, "Developer(s)/Publisher(s)" text, "JP -210-" text, "NA -350-" text, "PAL -295-" text, "Wii Points" text )
what's the wii points with title and source being ts shin taikyoku: igo d j 2700-mon
SELECT "Wii Points" FROM table_18894 WHERE "Title and Source" = 'Tsūshin Taikyoku: Igo Dōjō 2700-Mon'
CREATE TABLE table_name_30 ( score VARCHAR, date VARCHAR )
WHich Score has a Date on november 11?
SELECT score FROM table_name_30 WHERE date = "november 11"
CREATE TABLE table_train_108 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "deficiency_to_iga" bool, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "NOUSE" float )
body mass index >= 18 and <= 32 kg / m2 at screening
SELECT * FROM table_train_108 WHERE body_mass_index_bmi >= 18 AND body_mass_index_bmi <= 32
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state ...
Give me a histogram for what are the different names and credit scores of customers who have taken a loan?, and I want to order X in asc order please.
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY cust_name
CREATE TABLE table_name_87 ( city___state VARCHAR, winner VARCHAR )
What is the city/state of the circuit where Russell Ingall Larry Perkins was the winner?
SELECT city___state FROM table_name_87 WHERE winner = "russell ingall larry perkins"
CREATE TABLE table_20624 ( "No." real, "Name" text, "Mi from Kingston" text, "Km from Kingston" text, "Parish" text, "Length feet" real, "Length meters" text )
How many feet in length are there when the length is 106.1 meters?
SELECT COUNT("Length feet") FROM table_20624 WHERE "Length meters" = '106.1'
CREATE TABLE table_203_8 ( id number, "player" text, "rec." number, "yards" number, "avg." number, "td's" number, "long" number )
which player did not have positive yardage ?
SELECT "player" FROM table_203_8 WHERE "yards" <= 0
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20),...
What is the lowest salary in departments with average salary greater than the overall average. Plot them as bar chart.
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name
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, give me the comparison about the sum of manufacturer over the headquarter , and group by attribute headquarter by a bar chart, could you list by the total number in ascending?
SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Manufacturer)
CREATE TABLE table_3186 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
When dennis ross (r) unopposed is the candidate what is the party?
SELECT "Party" FROM table_3186 WHERE "Candidates" = 'Dennis Ross (R) unopposed'
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 Subject...
Find the number of the latest logon date of the students whose family name is 'Jaskolski' or 'Langosh', and could you list y axis in ascending order?
SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" ORDER BY COUNT(date_of_latest_logon)
CREATE TABLE table_name_17 ( scorer VARCHAR, club VARCHAR, league_goals VARCHAR )
Which scorer plays for Aldershot and has scored a total of 19 League goals?
SELECT scorer FROM table_name_17 WHERE club = "aldershot" AND league_goals = "19"
CREATE TABLE table_name_41 ( score VARCHAR, opponent_in_the_final VARCHAR )
What is the score of the tournament with olivier dela tre as the opponent in the final?
SELECT score FROM table_name_41 WHERE opponent_in_the_final = "olivier delaître"
CREATE TABLE table_43669 ( "Match" text, "Date" text, "Location" text, "Lineup" text, "Result" text, "Competition" text )
Which Match has a Competition of Group Stage on 2000-09-17?
SELECT "Match" FROM table_43669 WHERE "Competition" = 'group stage' AND "Date" = '2000-09-17'
CREATE TABLE table_name_8 ( deleted VARCHAR, name VARCHAR )
On what date was Anniston Army Depot (SE Industrial Area) deleted?
SELECT deleted FROM table_name_8 WHERE name = "anniston army depot (se industrial area)"
CREATE TABLE table_name_79 ( score VARCHAR, opponent VARCHAR )
what is the score when the opponent is ann grossman?
SELECT score FROM table_name_79 WHERE opponent = "ann grossman"
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ins...
Do any classes not have lab sessions ?
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
CREATE TABLE table_14577 ( "Pos." text, "Player" text, "Team" text, "Height" text, "Weight" real, "First round" real, "Final round" text )
What is the pos for the New York Knicks?
SELECT "Pos." FROM table_14577 WHERE "Team" = 'new york knicks'
CREATE TABLE table_30923 ( "Stage" real, "Winner" text, "General classification" text, "Mountains Classification" text, "Points classification" text, "Sprints Classification" text, "Team Classification" text )
Name the points classification for levi leipheimer
SELECT "Points classification" FROM table_30923 WHERE "General classification" = 'Levi Leipheimer'
CREATE TABLE table_32389 ( "Player" text, "Home Town" text, "College/Prior" text, "Drafting Team" text, "Graduated" real )
From what town was Steve Zakuani?
SELECT "Home Town" FROM table_32389 WHERE "Player" = 'steve zakuani'
CREATE TABLE table_69565 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Which loss has a Date of april 26?
SELECT "Loss" FROM table_69565 WHERE "Date" = 'april 26'
CREATE TABLE table_name_19 ( opponent VARCHAR, record VARCHAR )
Name the opponent with record of 6-2
SELECT opponent FROM table_name_19 WHERE record = "6-2"
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CR...
what flights has CO from ATLANTA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_airport = AIR...
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, visualize a bar chart about the distribution of email and employee_id , sort in ascending by the EMAIL.
SELECT EMAIL, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL
CREATE TABLE table_203_330 ( id number, "year of election" number, "candidates elected" number, "# of seats available" number, "# of votes" number, "% of popular vote" text )
what was the smallest number of votes before 2003 ?
SELECT MIN("# of votes") FROM table_203_330 WHERE "year of election" < 2003
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
what is the total average cost of a hospital that includes a drug called insulin regular human 100 unit/ml ij soln until 2103?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'insulin regular human 100 unit/ml ij soln')) A...
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Class 746 has been taught by Prof. Beth Wilensky how many times ?
SELECT COUNT(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 746 AND instructor.name LIKE '%Beth Wilensky%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offer...
CREATE TABLE table_21150 ( "Religion" text, "Suriname" text, "Paramaribo" text, "Wanica" text, "Nickerie" text, "Coronie" text, "Saramacca" text, "Commewijne" text, "Marowijne" text, "Para" text, "Brokopondo" text, "Sipaliwini" text )
Name the para for 1.5% commewijne
SELECT "Para" FROM table_21150 WHERE "Commewijne" = '1.5%'
CREATE TABLE diagnoses ( 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 are discharged to disc-tran cancer/chldrn h and lab tested for basophils?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND lab.label = "Basophils"
CREATE TABLE table_name_94 ( date VARCHAR, opponent VARCHAR )
when is the opponent lyoto machida?
SELECT date FROM table_name_94 WHERE opponent = "lyoto machida"
CREATE TABLE table_name_9 ( points INTEGER, club VARCHAR, goal_difference VARCHAR )
Which Points have a Club of cf calvo sotelo, and a Goal Difference larger than -3?
SELECT MAX(points) FROM table_name_9 WHERE club = "cf calvo sotelo" AND goal_difference > -3
CREATE TABLE table_name_12 ( team__number1 VARCHAR )
Which 1st leg that has hemofarm?
SELECT 1 AS st_leg FROM table_name_12 WHERE team__number1 = "hemofarm"
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, C...
Users who downvoted you the most.
SELECT Score FROM Posts WHERE Id = 298680
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
How many patients admitted before the year 2144 had a lab test named heparin and Imw?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2144" AND lab.label = "Heparin, LMW"
CREATE TABLE table_name_12 ( country VARCHAR, place VARCHAR, player VARCHAR )
From what Country is T6 Place Player Tom Weiskopf?
SELECT country FROM table_name_12 WHERE place = "t6" AND player = "tom weiskopf"