table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_2522473_1 ( team VARCHAR, seasons VARCHAR )
How many teams have been in Topperserien for 8 seasons?
SELECT COUNT(team) FROM table_2522473_1 WHERE seasons = 8
CREATE TABLE table_57189 ( "Round" text, "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
What was the result for the round of 4 leg 2 when the attendance was less than 20,371?
SELECT "Result" FROM table_57189 WHERE "Attendance" > '20,371' AND "Round" = '4 leg 2'
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ...
Poor quality titles per month.
SELECT YEAR(CreationDate), MONTH(CreationDate) AS "month", COUNT(*) AS "count" FROM Posts WHERE NOT Title LIKE '%Who%' AND NOT Title LIKE '%What%' AND NOT Title LIKE '%When%' AND NOT Title LIKE '%Where%' AND NOT Title LIKE '%Why%' AND NOT Title LIKE '%How%' AND NOT Title LIKE '%Can%' AND NOT Title LIKE '%Is%' AND NOT T...
CREATE TABLE table_13496 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real )
what is the longitude when the water (sqmi) is 0.317 and the ansi code is higher than 1759695?
SELECT AVG("Longitude") FROM table_13496 WHERE "Water (sqmi)" = '0.317' AND "ANSI code" > '1759695'
CREATE TABLE table_name_43 ( wins INTEGER, rank INTEGER )
What number of wins was ranked higher than 5?
SELECT SUM(wins) FROM table_name_43 WHERE rank > 5
CREATE TABLE table_17180 ( "Name of ground" text, "Location" text, "Year" text, "FC matches" real, "LA matches" real, "T20 matches" real, "Total" real )
What is the maximum t20 on green lane?
SELECT MAX("T20 matches") FROM table_17180 WHERE "Name of ground" = 'Green Lane'
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...
Calculate the number of patients who had abnormal lab test results and were born before 2073
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2073" AND lab.flag = "abnormal"
CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(255) ) CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(120), line_2 VARCHAR(120), line_3...
A bar chart for what are the number of the dates of the assessment notes?, and order in asc by the y-axis.
SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes ORDER BY COUNT(date_of_notes)
CREATE TABLE player ( player_id text, birth_year number, birth_month number, birth_day number, birth_country text, birth_state text, birth_city text, death_year number, death_month number, death_day number, death_country text, death_state text, death_city text, na...
List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007.
SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JO...
CREATE TABLE table_24652 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original U.S. air date" text, "Prod. code" real )
Who wrote episode 31 in the series?
SELECT "Written by" FROM table_24652 WHERE "No. in series" = '31'
CREATE TABLE table_name_66 ( country VARCHAR, rank INTEGER )
What is the country is ranked more than 4?
SELECT country FROM table_name_66 WHERE rank > 4
CREATE TABLE customers ( id INTEGER, first_name VARCHAR(40), last_name VARCHAR(20), company VARCHAR(80), address VARCHAR(70), city VARCHAR(40), state VARCHAR(40), country VARCHAR(40), postal_code VARCHAR(10), phone VARCHAR(24), fax VARCHAR(24), email VARCHAR(60), supp...
List the name of all playlist, and count them by a bar chart, sort Y from high to low order please.
SELECT name, COUNT(name) FROM playlists GROUP BY name ORDER BY COUNT(name) DESC
CREATE TABLE table_31293 ( "Eliminated" real, "Wrestler" text, "Entered" real, "Eliminated by" text, "Method of elimination" text, "Time" text )
How many entries are shown for entered at 21:09?
SELECT COUNT("Entered") FROM table_31293 WHERE "Time" = '21:09'
CREATE TABLE Customers_cards ( card_type_code VARCHAR, card_id VARCHAR ) CREATE TABLE Financial_transactions ( card_id VARCHAR )
Show the card type codes and the number of transactions.
SELECT T2.card_type_code, COUNT(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code
CREATE TABLE table_41137 ( "S No" real, "Team (A)" text, "Team (B)" text, "Winner" text, "Margin" text, "Match Date" text )
What is the total number of S No(s), when the Margin is 16 runs?
SELECT COUNT("S No") FROM table_41137 WHERE "Margin" = '16 runs'
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...
what is date of birth and lab test abnormal status of subject name jerry deberry?
SELECT demographic.dob, lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry"
CREATE TABLE table_23619005_3 ( player VARCHAR, cfl_team VARCHAR )
How many different players got drafted for the Ottawa Renegades?
SELECT COUNT(player) FROM table_23619005_3 WHERE cfl_team = "Ottawa Renegades"
CREATE TABLE table_204_624 ( id number, "school" text, "team name" text, "town" text, "county" text, "enrollment (2010-11 & 2011-12)" number, "primary mshsaa class*" number, "football class" number )
how many of the schools had at least 500 students enrolled in the 2010-2011 and 2011-2012 season ?
SELECT COUNT("team name") FROM table_204_624 WHERE "enrollment (2010-11 & 2011-12)" >= 500
CREATE TABLE table_name_47 ( gold INTEGER, nation VARCHAR, silver VARCHAR )
Which Gold has a Nation of malaysia, and a Silver smaller than 0?
SELECT MIN(gold) FROM table_name_47 WHERE nation = "malaysia" AND silver < 0
CREATE TABLE table_16459 ( "No. in season" real, "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text )
What were the names of the episodes that had 3.02 million U.S. viewers?
SELECT "Title" FROM table_16459 WHERE "U.S. viewers (million)" = '3.02'
CREATE TABLE table_69518 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
What was the qualifying time of Jim Rathmann in 1959?
SELECT "Qual" FROM table_69518 WHERE "Year" = '1959'
CREATE TABLE student_course_enrolment ( registration_id number, student_id number, course_id number, date_of_enrolment time, date_of_completion time ) CREATE TABLE courses ( course_id number, author_id number, subject_id number, course_name text, course_description text ) CREAT...
Return the descriptions and names of the courses that have more than two students enrolled in.
SELECT T1.course_description, T1.course_name FROM courses AS T1 JOIN student_course_enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 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 )
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the average of revenue , and group by attribute founder.
SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
CREATE TABLE table_name_26 ( venue VARCHAR, team VARCHAR )
Which team played in the Darida venue?
SELECT venue FROM table_name_26 WHERE team = "darida"
CREATE TABLE table_name_26 ( result VARCHAR, date VARCHAR )
What was the result on 8 October 1961?
SELECT result FROM table_name_26 WHERE date = "8 october 1961"
CREATE TABLE table_203_303 ( id number, "tribunal" text, "number of autos da fe" number, "executions in persona" number, "executions in effigie" number, "penanced" number, "total" number )
which tribunal sentenced the largest number of executions ?
SELECT "tribunal" FROM table_203_303 ORDER BY "total" DESC LIMIT 1
CREATE TABLE Project_Staff ( date_from VARCHAR, date_to VARCHAR, project_id VARCHAR, role_code VARCHAR )
List from which date and to which date these staff work: project staff of the project which hires the most staffs
SELECT date_from, date_to FROM Project_Staff WHERE project_id IN (SELECT project_id FROM Project_Staff GROUP BY project_id ORDER BY COUNT(*) DESC LIMIT 1) UNION SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'leader'
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
in 2105, what are the three most frequent lab tests given to patients within the same hospital visit after receiving a head ct scan - without contrast?
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'head ct scan - wi...
CREATE TABLE table_76293 ( "Name" text, "City" text, "Years as tallest" text, "Height ft / m" text, "Floors" real )
What building in Louisville had more than 35 floors?
SELECT "Name" FROM table_76293 WHERE "City" = 'louisville' AND "Floors" > '35'
CREATE TABLE table_name_89 ( result VARCHAR, opponent VARCHAR, date VARCHAR )
What was the result of the april 6, 2002 game against the greensboro prowlers?
SELECT result FROM table_name_89 WHERE opponent = "greensboro prowlers" AND date = "april 6, 2002"
CREATE TABLE table_74433 ( "Pick #" real, "MLS team" text, "Player" text, "Position" text, "Affiliation" text )
What pick number is Kevan George?
SELECT "Pick #" FROM table_74433 WHERE "Player" = 'Kevan George'
CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80...
How many accounts are opened in each year? Show a line chart.
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts
CREATE TABLE table_name_36 ( county VARCHAR, median_household_income VARCHAR )
What County has a Median household income of $46,872?
SELECT county FROM table_name_36 WHERE median_household_income = "$46,872"
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE station ( id int, network_name text, services text, local...
Compute the number of services by services and then split by local authorities Show the result with a stacked bar graph, sort the number of local authority in ascending order.
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY services, local_authority ORDER BY COUNT(local_authority)
CREATE TABLE table_45265 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the score for the game against San Antonio?
SELECT "Score" FROM table_45265 WHERE "Team" = 'san antonio'
CREATE TABLE table_26250189_1 ( song_choice VARCHAR, original_artist VARCHAR )
What was the choice of song where the original artist was Stevie Wonder?
SELECT song_choice FROM table_26250189_1 WHERE original_artist = "Stevie Wonder"
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int,...
what are the most expensive FIRST class tickets between ATLANTA and DALLAS
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare 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 AN...
CREATE TABLE table_204_147 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text )
how many games have an attendance below 25,000 ?
SELECT COUNT(*) FROM table_204_147 WHERE "attendance" < 25000
CREATE TABLE table_17484 ( "Rd." real, "Grand Prix" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning constructor" text, "Report" text )
what's the grand prix with winning driver being jenson button
SELECT "Grand Prix" FROM table_17484 WHERE "Winning driver" = 'Jenson Button'
CREATE TABLE table_13995 ( "Medal" text, "Name" text, "Sport" text, "Event" text, "Date" real )
Who had the sport of athletics on a date earlier than 16?
SELECT "Name" FROM table_13995 WHERE "Sport" = 'athletics' AND "Date" < '16'
CREATE TABLE table_57488 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was South Melbourne's score as the home team?
SELECT "Home team score" FROM table_57488 WHERE "Home team" = 'south melbourne'
CREATE TABLE table_34439 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" text )
What is the release Date of the 7' single in Catalog 87184?
SELECT "Date" FROM table_34439 WHERE "Format" = '7" single' AND "Catalog" = '87184'
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId numb...
How many times has Jorge Castro been wrong?.
SELECT COUNT(*) FROM Votes AS v INNER JOIN Posts AS p ON v.PostId = p.Id WHERE (v.VoteTypeId = 6) AND p.OwnerUserId = 235
CREATE TABLE table_19517621_4 ( original_airdate VARCHAR, written_by VARCHAR )
What was the original air date of the episode written by Michelle Offen?
SELECT original_airdate FROM table_19517621_4 WHERE written_by = "Michelle Offen"
CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Descri...
Show all role codes and the number of employees in each role Show bar chart, and show from low to high by the y axis.
SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY COUNT(*)
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...
in 2102 how many patients have undergone neurosurgery - therapeutic craniotomy in the same hospital encounter after the diagnosis of pleural effusion - right?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pleural effusion - right' AND STRFTIME('%y', diagnosis.diagnosistime) = '...
CREATE TABLE table_2562572_5 ( population__2002_ INTEGER, urban_settlement VARCHAR )
Name the population for 2002 being ada
SELECT MIN(population__2002_) FROM table_2562572_5 WHERE urban_settlement = "Ada"
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, require...
Which class do you think was the hardest ?
SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) FROM course AS COURSEalias1, program_course AS PROGRAM_COURSEalias1 WH...
CREATE TABLE table_203_615 ( id number, "district" text, "incumbent" text, "party" text, "first\nelected" number, "result" text, "candidates" text )
how many of these congressmen were re elected ?
SELECT COUNT("incumbent") FROM table_203_615 WHERE "result" = 're-elected'
CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real ) CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text )
Return a pie on what are the different parties of representative? Show the party name and the number of representatives in each party.
SELECT Party, COUNT(*) FROM representative GROUP BY Party
CREATE TABLE table_23180 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real )
When did the school from Logan Township, Pennsylvania join the Conference?
SELECT "Joined" FROM table_23180 WHERE "Location" = 'Logan Township, Pennsylvania'
CREATE TABLE table_184 ( "Information" text, "Dysart" text, "Shadow Ridge" text, "Valley Vista" text, "Willow Canyon" text )
How many informations does Michael Hawkins have?
SELECT COUNT("Information") FROM table_184 WHERE "Shadow Ridge" = 'Michael Hawkins'
CREATE TABLE table_name_57 ( dist_from_origin VARCHAR, location__all_in_nagano__ VARCHAR, name VARCHAR )
What is the distance from origin in Azumino including Toyoshina IC?
SELECT dist_from_origin FROM table_name_57 WHERE location__all_in_nagano__ = "azumino" AND name = "toyoshina ic"
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), CO...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a line chart about the change of department_id over hire_date , and could you order X in desc order?
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC
CREATE TABLE table_name_88 ( against INTEGER, played VARCHAR, drawn VARCHAR, difference VARCHAR )
What is the average Against when the drawn is more than 2 and the Difference of- 17, and a Played smaller than 20?
SELECT AVG(against) FROM table_name_88 WHERE drawn > 2 AND difference = "- 17" AND played < 20
CREATE TABLE item ( i_id number, title text ) CREATE TABLE review ( a_id number, u_id number, i_id number, rating number, rank number ) CREATE TABLE trust ( source_u_id number, target_u_id number, trust number ) CREATE TABLE useracct ( u_id number, name text )
Find the titles of items that received both a rating higher than 8 and a rating below 5.
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > 8 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TA...
Tags that might need to be pluralized.
SELECT t.TagName FROM Tags AS t WHERE NOT t.TagName LIKE '%s'
CREATE TABLE table_65070 ( "Project" text, "License" text, "Date" text, "Protocol" text, "Technology" text, "Server" text, "Client" text, "Web Client" text, "Multiple Sessions" text, "Encryption" text, "Authentication" text, "Data Compression" text, "Image Quality" te...
what is the proxy when the image quality is , the encryption is ssl and the license is proprietary?
SELECT "Proxy" FROM table_65070 WHERE "Image Quality" = '✓' AND "Encryption" = 'ssl' AND "License" = 'proprietary'
CREATE TABLE table_name_30 ( date VARCHAR, attendance VARCHAR, score VARCHAR )
On what date was the game with fewer than 6650 in attendance, that finished 0:1?
SELECT date FROM table_name_30 WHERE attendance < 6650 AND score = "0:1"
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text )
A stacked bar graph shows the total number of captains categorize by ranks of different classes, and display in desc by the x-axis.
SELECT Class, COUNT(Class) FROM captain GROUP BY Rank, Class ORDER BY Class DESC
CREATE TABLE table_75888 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text, "React" real )
What is Country, when Lane is 5, and when React is greater than 0.166?
SELECT "Country" FROM table_75888 WHERE "Lane" = '5' AND "React" > '0.166'
CREATE TABLE table_17687 ( "Track Name" text, "Location" text, "Length" text, "Seating" real, "Year Opened" real, "Year Acquired [A ]" real )
What is the location of the track that opened in 1950?
SELECT "Location" FROM table_17687 WHERE "Year Opened" = '1950'
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
What are the names and prices of products that cost at least 180, sorted by price decreasing and name ascending. Show bar chart.
SELECT Name, Price FROM Products WHERE Price >= 180 ORDER BY Price DESC, Name
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_stop ( flight_id in...
list all flights from LONG BEACH to COLUMBUS late saturday
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 ((((flight.departure_time <= 2359 AND flight.departure_time >= 2000) AND date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year...
CREATE TABLE table_5225 ( "Team" text, "Copa Libertadores 1992" text, "Supercopa Sudamericana 1992" text, "Copa CONMEBOL 1992" text, "Recopa Sudamericana 1992" text, "Intercontinental Cup 1992" text )
Which Supercopa Sudamericana 1992 has a Team of santos?
SELECT "Supercopa Sudamericana 1992" FROM table_5225 WHERE "Team" = 'santos'
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
what's the name of the last medication patient 015-54876 was prescribed?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-54876')) ORDER BY medication.drugstarttime DESC LIMIT 1
CREATE TABLE table_name_33 ( home_team VARCHAR, venue VARCHAR )
At the match in windy hill, how much did the home team score?
SELECT home_team AS score FROM table_name_33 WHERE venue = "windy hill"
CREATE TABLE table_51975 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
What is the record of the game on February 25, 2008?
SELECT "Record" FROM table_51975 WHERE "Date" = 'february 25, 2008'
CREATE TABLE table_name_88 ( silver INTEGER, bronze VARCHAR, total VARCHAR )
For all countries with 7 bronze medals and a total number of medals less than 13, what's the sum of silver medals?
SELECT SUM(silver) FROM table_name_88 WHERE bronze = 7 AND total < 13
CREATE TABLE table_27811 ( "Position" real, "Sail number" text, "Yacht" text, "State/country" text, "Yacht type" text, "LOA (Metres)" text, "Skipper" text, "Elapsed time d:hh:mm:ss" text )
Who was the skipper of the yacht with an elapsed time of 3:07:39:33?
SELECT "Skipper" FROM table_27811 WHERE "Elapsed time d:hh:mm:ss" = '3:07:39:33'
CREATE TABLE table_20908 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Production code" real )
How many seasons have a production code of 204?
SELECT COUNT("No. in season") FROM table_20908 WHERE "Production code" = '204'
CREATE TABLE table_47411 ( "Circuit" text, "Location" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winner" text )
What is Winner, when Circuit is June 8?
SELECT "Winner" FROM table_47411 WHERE "Circuit" = 'june 8'
CREATE TABLE phone ( model_name VARCHAR, chip_model VARCHAR, Accreditation_type VARCHAR ) CREATE TABLE chip_model ( model_name VARCHAR, chip_model VARCHAR, Accreditation_type VARCHAR )
Find the names of the chip models that are not used by any phone with full accreditation type.
SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type = 'Full'
CREATE TABLE table_16021 ( "Episode #" real, "Production code" real, "Title" text, "Directed by" text, "Written by" text, "Airdate" text )
what is the episode # for production code 227
SELECT "Episode #" FROM table_16021 WHERE "Production code" = '227'
CREATE TABLE table_name_79 ( season VARCHAR, final_placing VARCHAR, podiums VARCHAR )
Which Season has a Final Place of 8th and 8 Podiums?
SELECT season FROM table_name_79 WHERE final_placing = "8th" AND podiums = "8"
CREATE TABLE table_name_17 ( south_dakota VARCHAR, oklahoma VARCHAR )
What South Dakota has Bush of Oklahoma?
SELECT south_dakota FROM table_name_17 WHERE oklahoma = "bush"
CREATE TABLE table_name_69 ( laps INTEGER, driver VARCHAR )
What were the lowest laps of Tarso Marques?
SELECT MIN(laps) FROM table_name_69 WHERE driver = "tarso marques"
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, ...
SPANISH prerequisites required by CS majors include what courses ?
SELECT DISTINCT course.department, course.name, course.number FROM program_course INNER JOIN course ON program_course.course_id = course.course_id WHERE course.department = 'SPANISH'
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text )
Ignore movies whose director is NULL For each director, what are the titles and ratings for all the movies they reviewed? Show the result by a bar chart, and I want to display X from low to high order please.
SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" ORDER BY title
CREATE TABLE table_21995 ( "No. in series" real, "No. in season" real, "Title" text, "Country" text, "Project" text, "Status at production" text, "Original air date" text )
In what country did the 'amsterdam's futuristic floating city' project take place?
SELECT "Country" FROM table_21995 WHERE "Title" = 'Amsterdam''s Futuristic Floating City'
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 diagnoses ( ...
provide the number of patients whose year of death is less than or equal to 2186 and drug name is neo*iv*fat emulsion?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2186.0" AND prescriptions.drug = "NEO*IV*Fat Emulsion"
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
what would be the maximum daily number of patients diagnosed with splenic trauma - grade ii laceration since 2105?
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'splenic trauma - grade ii laceration' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105' GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1
CREATE TABLE table_name_46 ( name VARCHAR, time VARCHAR )
What Name has a Time of 01:56:52?
SELECT name FROM table_name_46 WHERE time = "01:56:52"
CREATE TABLE table_73984 ( "Name" text, "Park" text, "Length (ft)" real, "Height (ft)" real, "Speed (mph)" text, "Opened" text, "Status" text )
How many parks are called mt. olympus
SELECT COUNT("Name") FROM table_73984 WHERE "Park" = 'Mt. Olympus'
CREATE TABLE table_name_25 ( res VARCHAR, record VARCHAR, time VARCHAR, method VARCHAR )
Which res has a Time of 5:00, and a Method of decision (unanimous), and a Record of 1 0?
SELECT res FROM table_name_25 WHERE time = "5:00" AND method = "decision (unanimous)" AND record = "1–0"
CREATE TABLE table_12591 ( "Year" real, "Date" text, "Home Team" text, "Result" text, "Visiting Team" text, "Venue" text, "Attendance" real )
What year was the game at the Los Angeles Memorial Coliseum, with attendance more than 85,302, on November 9?
SELECT "Year" FROM table_12591 WHERE "Venue" = 'los angeles memorial coliseum' AND "Attendance" > '85,302' AND "Date" = 'november 9'
CREATE TABLE table_75869 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lowest total when the rank is 14 and the gold medals is larger than 0?
SELECT MIN("Total") FROM table_75869 WHERE "Rank" = '14' AND "Gold" > '0'
CREATE TABLE table_10248 ( "Sun Belt" text, "Lost" real, "Tied" real, "Pct." real, "Years" real, "Total Games" real )
What is the low loss total for teams with under 3 years and a less than 0.625% winning percentage?
SELECT MIN("Lost") FROM table_10248 WHERE "Pct." < '0.625' AND "Years" < '3'
CREATE TABLE genre ( genreid number, name text ) CREATE TABLE mediatype ( mediatypeid number, name text ) CREATE TABLE track ( trackid number, name text, albumid number, mediatypeid number, genreid number, composer text, milliseconds number, bytes number, unitprice ...
What is the average unit price of rock tracks?
SELECT AVG(T2.unitprice) FROM genre AS T1 JOIN track AS T2 ON T1.genreid = T2.genreid WHERE T1.name = "Rock"
CREATE TABLE table_name_69 ( opponent VARCHAR, week VARCHAR )
Who was the opponent in week 12?
SELECT opponent FROM table_name_69 WHERE week = 12
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...
count the number of patients whose marital status is widowed and procedure short title is transplant cadaver donor?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.short_title = "Transplant cadaver donor"
CREATE TABLE table_203_564 ( id number, "hand" text, "1 credit" number, "2 credits" number, "3 credits" number, "4 credits" number, "5 credits" number )
what is the difference of payout on 3 credits , between a straight flush and royal flush ?
SELECT ABS((SELECT "3 credits" FROM table_203_564 WHERE "hand" = 'straight flush') - (SELECT "3 credits" FROM table_203_564 WHERE "hand" = 'royal flush'))
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 stadium ( ID int, name text, Capacity int, City text, Coun...
A bar chart shows the distribution of meter_200 and the sum of ID , and group by attribute meter_200, and list meter_200 in asc order please.
SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY meter_200
CREATE TABLE Stores ( Store_ID VARCHAR(100), Address_ID INTEGER, Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARCHAR(255), Store_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Bookings_Services ( Order_ID INTEGER, Product_ID INTEGER ) ...
Show the number of services for each service type description with a bar chart, order in desc by the x axis.
SELECT Service_Type_Description, COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code ORDER BY Service_Type_Description DESC
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is diagnoses short title of subject id 64208?
SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "64208"
CREATE TABLE table_name_93 ( attendance INTEGER, score VARCHAR )
What was the the total top attendance with a score of 0 4?
SELECT MAX(attendance) FROM table_name_93 WHERE score = "0 – 4"
CREATE TABLE table_17322817_10 ( location_attendance VARCHAR, date VARCHAR )
Name the location attendance for april 5
SELECT location_attendance FROM table_17322817_10 WHERE date = "April 5"
CREATE TABLE table_name_66 ( date VARCHAR, home_team VARCHAR )
When did South Melbourne play as the home team?
SELECT date FROM table_name_66 WHERE home_team = "south melbourne"
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, visualize a scatter chart about the correlation between code and revenue , and group by attribute founder.
SELECT T1.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABL...
morphine sulfate sr what is the price?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'morphine sulfate sr')