table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_204_360 (
id number,
"year" number,
"host" text,
"gold" text,
"silver" text,
"bronze" text
) | which country has brought home the most gold ? | SELECT "gold" FROM table_204_360 GROUP BY "gold" ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_29395291_2 (
subscribers__2006___thousands_ INTEGER,
provider VARCHAR
) | What is the maximum number of 2006 subscribers for Glo Mobile? | SELECT MAX(subscribers__2006___thousands_) FROM table_29395291_2 WHERE provider = "Glo Mobile" |
CREATE TABLE team (
name VARCHAR,
team_id VARCHAR
)
CREATE TABLE salary (
team_id VARCHAR,
salary INTEGER
) | What are the name and id of the team offering the lowest average salary? | SELECT T1.name, T1.team_id FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id ORDER BY AVG(T2.salary) LIMIT 1 |
CREATE TABLE table_67775 (
"Year" real,
"Role" text,
"Author" text,
"Radio Station/Production Company" text,
"Release/Air Date" text
) | Role of narrator, and a Year larger than 2009, and a Release/Air Date of 7 october 2010 belongs to what author? | SELECT "Author" FROM table_67775 WHERE "Role" = 'narrator' AND "Year" > '2009' AND "Release/Air Date" = '7 october 2010' |
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 (
... | give me the number of patients whose gender is m and primary disease is guillain barre syndrome? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "GUILLAIN BARRE SYNDROME" |
CREATE TABLE table_29598261_1 (
hometown VARCHAR,
name VARCHAR
) | what is the hometown for mike ladd? | SELECT hometown FROM table_29598261_1 WHERE name = "Mike Ladd" |
CREATE TABLE table_57911 (
"Year" real,
"Title" text,
"Original channel" text,
"Role" text,
"Note" text
) | what is the title when the year is after 2011 and the original channel is nhk? | SELECT "Title" FROM table_57911 WHERE "Year" > '2011' AND "Original channel" = 'nhk' |
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 prescriptions... | provide the number of patients whose admission year is less than 2175 and diagnoses short title is chronic liver dis nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2175" AND diagnoses.short_title = "Chronic liver dis NEC" |
CREATE TABLE accounts (
account_id number,
customer_id number,
account_name text,
other_account_details text
)
CREATE TABLE financial_transactions (
transaction_id number,
previous_transaction_id number,
account_id number,
card_id number,
transaction_type text,
transaction_date ... | What is the customer id of the customer with the most accounts, and how many accounts does this person have? | SELECT customer_id, COUNT(*) FROM accounts GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE airport_aircraft (
id number,
airport_id number,
aircraft_id number
)
CREATE TABLE airport (
airport_id number,
airport_name text,
total_passengers number,
%_change_2007 text,
international_passengers number,
domestic_passengers number,
transit_passengers number,
... | List the name of the aircraft that has been named winning aircraft the most number of times. | SELECT T1.aircraft FROM aircraft AS T1 JOIN match AS T2 ON T1.aircraft_id = T2.winning_aircraft GROUP BY T2.winning_aircraft ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_name_12 (
finishes VARCHAR,
stage_wins VARCHAR,
starts VARCHAR,
points VARCHAR
) | What is the number of finishes associated with 13 starts, more than 169 points, and 96 stage wins? | SELECT finishes FROM table_name_12 WHERE starts = 13 AND points > 169 AND stage_wins = 96 |
CREATE TABLE table_66641 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | What was the score of the game where stafford rangers was the away team? | SELECT "Score" FROM table_66641 WHERE "Away team" = 'stafford rangers' |
CREATE TABLE Ref_Incident_Type (
incident_type_code VARCHAR(10),
incident_type_description VARCHAR(80)
)
CREATE TABLE Students (
student_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_addr... | Give me the comparison about the sum of monthly_rental over the date_address_from , and group by attribute other_details and bin date_address_from by weekday. | SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC |
CREATE TABLE table_36185 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | What's the lowest February for less than 57 points? | SELECT MIN("February") FROM table_36185 WHERE "Points" < '57' |
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 products with a price between 60 and 120, return a bar chart about the distribution of name and manufacturer . | SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 |
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... | provide the number of patients whose ethnicity is hispanic/latino - puerto rican and drug type is base? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug_type = "BASE" |
CREATE TABLE table_32025 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | When there was a draw, what was the time? | SELECT "Time" FROM table_32025 WHERE "Res." = 'draw' |
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 semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE... | I 'm looking for the easiest class I can take to fulfill the Core requirement . | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... |
CREATE TABLE table_name_32 (
away_team VARCHAR,
home_team VARCHAR
) | What team was the away team when the home team was Hereford United? | SELECT away_team FROM table_name_32 WHERE home_team = "hereford united" |
CREATE TABLE table_name_36 (
crowd INTEGER,
venue VARCHAR
) | What was the average crowd attendance for the Junction Oval venue? | SELECT AVG(crowd) FROM table_name_36 WHERE venue = "junction oval" |
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | Compare the average of artists' age by country in a bar graph. | SELECT Country, AVG(Age) FROM artist GROUP BY Country |
CREATE TABLE table_24910733_2 (
episode VARCHAR,
rating VARCHAR
) | How many episodes received rating of 8.2? | SELECT COUNT(episode) FROM table_24910733_2 WHERE rating = "8.2" |
CREATE TABLE table_68677 (
"Year" text,
"Title" text,
"( Title in English )" text,
"Director" text,
"Character" text
) | What is the year of the TV series directed by Soroush Sehat? | SELECT "Year" FROM table_68677 WHERE "Director" = 'soroush sehat' |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | Give me the comparison about meter_100 over the meter_600 , display X in descending order. | SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_600 DESC |
CREATE TABLE table_33062 (
"Year" text,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Attendance Average" text
) | What is the average attendance of the team that had a regular season result of 2nd aisa, 24-16? | SELECT "Attendance Average" FROM table_33062 WHERE "Reg. Season" = '2nd aisa, 24-16' |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_i... | since 5 years ago, what are the top four most frequent procedures given to patients in the same hospital visit after diagnosis of adv eff fibrinolysis agt? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i... |
CREATE TABLE table_77133 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the home team with scarborough as the away team? | SELECT "Home team" FROM table_77133 WHERE "Away team" = 'scarborough' |
CREATE TABLE table_name_75 (
rank INTEGER,
name VARCHAR,
birth VARCHAR
) | What rank is He Yingqin who was born before 1890? | SELECT AVG(rank) FROM table_name_75 WHERE name = "he yingqin" AND birth < 1890 |
CREATE TABLE table_name_1 (
score VARCHAR,
team VARCHAR
) | What is the Score with a Team that is @ portland? | SELECT score FROM table_name_1 WHERE team = "@ portland" |
CREATE TABLE table_76096 (
"Week of" text,
"Tier" text,
"Winner" text,
"Runner-up" text,
"Semi finalists" text
) | Who are the semi finalists on the week of 12 june, when the runner-up is listed as Lori McNeil? | SELECT "Semi finalists" FROM table_76096 WHERE "Week of" = '12 june' AND "Runner-up" = 'lori mcneil' |
CREATE TABLE table_30720 (
"Athens XI" text,
"PIFA Colaba FC u-17" text,
"Tata Power" text,
"Dadar XI \u2018B\u2019" text,
"IDBI" text,
"World Network Services" text,
"United FC" text,
"Good Shepherd" text
) | what is the dadar xi b where pifa colaba is sporting options? | SELECT "Dadar XI \u2018B\u2019" FROM table_30720 WHERE "PIFA Colaba FC u-17" = 'Sporting Options' |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Comments (
Id number,
PostId num... | Comments on my posts containing two given phrases (case insensitive). | SELECT c.Id AS "comment_link", c.Text, c.UserId AS "user_link", c.CreationDate FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id WHERE (p.OwnerUserId = '##UserId?8297##') AND (c.Text LIKE '%##Word1?chat##%' COLLATE Latin1_General_CI_AI) AND (c.Text LIKE '%##Word2?here##%' COLLATE Latin1_General_CI_AI) |
CREATE TABLE customer_orders (
order_date VARCHAR,
customer_id VARCHAR
)
CREATE TABLE customers (
customer_name VARCHAR,
customer_id VARCHAR
) | Find the customer name and date of the orders that have the status 'Delivered'. | SELECT t1.customer_name, t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered" |
CREATE TABLE table_77602 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the score of the away team while playing at the arden street oval? | SELECT "Away team score" FROM table_77602 WHERE "Venue" = 'arden street oval' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | what is the number of patients whose age is less than 61 and lab test name is monocytes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "61" AND lab.label = "Monocytes" |
CREATE TABLE table_24574 (
"Train No." text,
"Train Name" text,
"Destination" text,
"Category" text,
"Frequency" text
) | What is the frequency of trains numbered 12671/12672? | SELECT "Frequency" FROM table_24574 WHERE "Train No." = '12671/12672' |
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... | Top 10 Zero score questions with highest view count. | SELECT Id AS "post_link", ViewCount FROM Posts AS p WHERE Score = 0 ORDER BY ViewCount DESC LIMIT 10 |
CREATE TABLE table_204_858 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | what is the different between the number of people who attended august 30th and the number of people who attended november 1st | SELECT ABS((SELECT "attendance" FROM table_204_858 WHERE "date" = 'august 30') - (SELECT "attendance" FROM table_204_858 WHERE "date" = 'november 1')) |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | give me the number of patients whose gender is m and item id is 51148? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.itemid = "51148" |
CREATE TABLE table_203_157 (
id number,
"year" number,
"film" text,
"role" text,
"language" text,
"notes" text
) | how many films has neha sharma been in ? | SELECT COUNT("film") FROM table_203_157 |
CREATE TABLE table_70538 (
"Frame size" text,
"Width" real,
"Height" real,
"Mpix" real,
"Aspect Ratio" text,
"Maximum fps" real,
"Maximum fps HDRx" real,
"least compression at 24 fps" text,
"least compression at maximum fps" text
) | What is the lowest maximum of fps with a width of 3072 and a height less than 1620? | SELECT MIN("Maximum fps") FROM table_70538 WHERE "Width" = '3072' AND "Height" < '1620' |
CREATE TABLE table_26998135_2 (
replaced_by VARCHAR,
date_of_vacancy VARCHAR
) | Who is the replaced by when the date of vacancy is 27 december 2010? | SELECT replaced_by FROM table_26998135_2 WHERE date_of_vacancy = "27 December 2010" |
CREATE TABLE table_204_29 (
id number,
"rank" number,
"lane" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
) | what is the total number of names ? | SELECT COUNT("name") FROM table_204_29 |
CREATE TABLE table_name_50 (
visitor VARCHAR,
series VARCHAR
) | What is the Visitor with a Series with 3 2? | SELECT visitor FROM table_name_50 WHERE series = "3 – 2" |
CREATE TABLE table_20212 (
"#" real,
"Season" real,
"Bowl game" text,
"Result" text,
"Opponent" text,
"Stadium" text,
"Location" text,
"Attendance" text
) | What is the lowest # in Atlanta, GA with the Georgia Bulldogs as an opponent? | SELECT MIN("#") FROM table_20212 WHERE "Location" = 'Atlanta, GA' AND "Opponent" = 'Georgia Bulldogs' |
CREATE TABLE table_name_41 (
team VARCHAR,
circuit VARCHAR
) | What was the team features at Oran Park Raceway? | SELECT team FROM table_name_41 WHERE circuit = "oran park raceway" |
CREATE TABLE table_10959 (
"Year" real,
"Result" text,
"Award" text,
"Category" text,
"Film or series" text,
"Character" text
) | What character won the best dramatic performance award? | SELECT "Character" FROM table_10959 WHERE "Category" = 'best dramatic performance' |
CREATE TABLE table_29612224_1 (
colors VARCHAR,
location VARCHAR
) | How many different combinations of team colors are there in all the schools in Maroa, Illinois? | SELECT COUNT(colors) FROM table_29612224_1 WHERE location = "Maroa, Illinois" |
CREATE TABLE table_24419 (
"Year" real,
"Song Title" text,
"Artist" text,
"Genre" text,
"Original Game" text,
"Band Tier/Venue" text,
"Exportable to GH5/BH" text
) | What is every song title for 2007? | SELECT "Song Title" FROM table_24419 WHERE "Year" = '2007' |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose primary disease is overdose and lab test abnormal status is delta? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "OVERDOSE" AND lab.flag = "delta" |
CREATE TABLE races (
name VARCHAR
) | List the names of all distinct races in reversed lexicographic order? | SELECT DISTINCT name FROM races ORDER BY name DESC |
CREATE TABLE table_60816 (
"Year" real,
"Grand Slam" text,
"Round" text,
"Winner" text,
"Loser" text
) | In which year is Nerida Gregory listed as the loser? | SELECT AVG("Year") FROM table_60816 WHERE "Loser" = 'nerida gregory' |
CREATE TABLE table_6224 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" real
) | Game site of candlestick park had what opponent? | SELECT "Opponent" FROM table_6224 WHERE "Game site" = 'candlestick park' |
CREATE TABLE table_2105 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Joined" real,
"Division" text
) | How many teams have skyhawks as a nickname? | SELECT COUNT("Division") FROM table_2105 WHERE "Nickname" = 'Skyhawks' |
CREATE TABLE table_204_937 (
id number,
"rank" number,
"lane" number,
"athlete" text,
"time" number
) | name the only athlete from sri lanka . | SELECT "athlete" FROM table_204_937 WHERE "athlete" = 'sri' |
CREATE TABLE Things (
thing_id INTEGER,
organization_id INTEGER,
Type_of_Thing_Code CHAR(15),
service_type_code CHAR(10),
service_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_details VARCHAR(255)
)
CREATE TABLE Services (
service_id INTEGER,
organiz... | Please use a bar chart to compare the number of customers of each customer's move in date, and rank by the total number from low to high. | SELECT date_moved_in, COUNT(date_moved_in) FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY date_moved_in ORDER BY COUNT(date_moved_in) |
CREATE TABLE table_name_87 (
date VARCHAR,
opponent VARCHAR,
result VARCHAR,
name VARCHAR
) | What is the date of the match with a result of ud 12/12 between Pernell Whitaker and James Mcgirt? | SELECT date FROM table_name_87 WHERE result = "ud 12/12" AND name = "pernell whitaker" AND opponent = "james mcgirt" |
CREATE TABLE table_3120 (
"Rank" text,
"Player" text,
"Nationality" text,
"Team" text,
"Opponent" text,
"Score" text,
"Competition" text,
"Vote percentage" text
) | What team was ranked in 7th? | SELECT "Team" FROM table_3120 WHERE "Rank" = '7th' |
CREATE TABLE table_train_66 (
"id" int,
"pregnancy_or_lactation" bool,
"white_blood_cell_count_wbc" int,
"acute_pyelonephritis" bool,
"intrabdominal_infection" bool,
"body_weight" float,
"oxygen_therapy_by_face_mask" bool,
"temperature" float,
"heart_rate" int,
"paco2" float,
... | 1 or more of the following infections: a ) primary or secondary bacteremia by gram negative bacteria, b ) acute pyelonephritis, or c ) intrabdominal infection. | SELECT * FROM table_train_66 WHERE (CASE WHEN bacteremia_by_gram_negative_bacteria = 1 THEN 1 ELSE 0 END + CASE WHEN acute_pyelonephritis = 1 THEN 1 ELSE 0 END + CASE WHEN intrabdominal_infection = 1 THEN 1 ELSE 0 END) >= 1 |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | indicate the daily minimum amount of urine output that patient 005-9883 had had until 02/07/2102. | SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-9883')) AND intakeoutput.celllabel = 'urine'... |
CREATE TABLE table_1342379_23 (
incumbent VARCHAR,
candidates VARCHAR
) | who is the the incumbent with candidates being percy e. quin (d) unopposed | SELECT incumbent FROM table_1342379_23 WHERE candidates = "Percy E. Quin (D) Unopposed" |
CREATE TABLE table_69010 (
"Year" real,
"Song title" text,
"Artist" text,
"Master recording?" text,
"Tier" text
) | What's the title of the song by Winger? | SELECT "Song title" FROM table_69010 WHERE "Artist" = 'winger' |
CREATE TABLE table_68583 (
"Frequency" real,
"Callsign" text,
"Brand" text,
"Format" text,
"City of License" text,
"Website" text,
"Webcast" text
) | Name the lowest frequency for brand of radio manantial | SELECT MIN("Frequency") FROM table_68583 WHERE "Brand" = 'radio manantial' |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | answers with code that aren't tagged that way - for specific user(s). | SELECT a.Id AS "post_link", q.Tags, a.Score, REPLACE(a.Body, CHAR(10), '') AS "body" FROM Posts AS a LEFT OUTER JOIN Posts AS q ON a.ParentId = q.Id WHERE a.OwnerUserId IN ('##UserID##') AND a.PostTypeId = 2 AND (a.Body LIKE '%Sub %' OR a.Body LIKE '%Function %') AND NOT q.Tags LIKE '%vba%' ORDER BY a.Score DESC |
CREATE TABLE table_30692 (
"Rank" real,
"Player" text,
"Year" real,
"Opponent" text,
"Passing yards" real,
"Rushing yards" real,
"Total offense" real
) | What is the number of total offense when the opponentis Penn State? | SELECT MAX("Total offense") FROM table_30692 WHERE "Opponent" = 'Penn State' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title 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... | how many patients are with admission location clinic referral/premature and discharged to snf? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.discharge_location = "SNF" |
CREATE TABLE assessment_notes (
notes_id number,
student_id number,
teacher_id number,
date_of_notes time,
text_of_notes text,
other_details text
)
CREATE TABLE student_addresses (
student_id number,
address_id number,
date_address_from time,
date_address_to time,
monthly_re... | Find the ids and first names of the 3 teachers that have the most number of assessment notes? | SELECT T1.teacher_id, T2.first_name FROM assessment_notes AS T1 JOIN teachers AS T2 ON T1.teacher_id = T2.teacher_id GROUP BY T1.teacher_id ORDER BY COUNT(*) DESC LIMIT 3 |
CREATE TABLE table_203_356 (
id number,
"type" text,
"diagonal (mm)" text,
"width (mm)" text,
"height (mm)" text,
"area (mm2)" text,
"stops (area)" number,
"crop factor" text
) | which sensor has the largest area ? | SELECT "type" FROM table_203_356 ORDER BY "area (mm2)" DESC LIMIT 1 |
CREATE TABLE table_name_75 (
sspec_number VARCHAR,
socket VARCHAR
) | what is the sspec number when the socket is standard power? | SELECT sspec_number FROM table_name_75 WHERE socket = "standard power" |
CREATE TABLE table_name_79 (
position VARCHAR,
player VARCHAR
) | What was the Position of the Player, Britton Johnsen? | SELECT position FROM table_name_79 WHERE player = "britton johnsen" |
CREATE TABLE table_71315 (
"Country" text,
"Film title used in nomination" text,
"Language" text,
"Original title" text,
"Director" text
) | What was the film title nominated from the Netherlands? | SELECT "Film title used in nomination" FROM table_71315 WHERE "Country" = 'netherlands' |
CREATE TABLE table_28059992_2 (
college VARCHAR,
position VARCHAR
) | Name the college for dl | SELECT college FROM table_28059992_2 WHERE position = "DL" |
CREATE TABLE table_2409041_5 (
production_code INTEGER,
no_in_series VARCHAR
) | What is the production code for episode number 86 in the series? | SELECT MIN(production_code) FROM table_2409041_5 WHERE no_in_series = 86 |
CREATE TABLE table_6836 (
"Season" text,
"League" text,
"Draw" real,
"Lost" real,
"Points" real,
"Position" text
) | Which Draw has a Season of 2001 02, and Points larger than 47? | SELECT SUM("Draw") FROM table_6836 WHERE "Season" = '2001–02' AND "Points" > '47' |
CREATE TABLE table_75588 (
"Name" text,
"Pennant number" text,
"Builder" text,
"Laid Down" text,
"Launched" text,
"Commissioned" text,
"Current status" text
) | what is the name of the builder who launched in danaide | SELECT "Launched" FROM table_75588 WHERE "Name" = 'danaide' |
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_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me a bar chart for total number of school id of each all home, and display in asc by the bars please. | SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home |
CREATE TABLE table_40974 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What competition has 17-1 as the result? | SELECT "Competition" FROM table_40974 WHERE "Result" = '17-1' |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, show by the the average of manager id in descending. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID) DESC |
CREATE TABLE table_name_23 (
constructor VARCHAR,
time_retired VARCHAR,
driver VARCHAR
) | What is the construction of Olivier Panis' car that retired due to a collision? | SELECT constructor FROM table_name_23 WHERE time_retired = "collision" AND driver = "olivier panis" |
CREATE TABLE table_name_67 (
area VARCHAR,
decile VARCHAR,
name VARCHAR
) | What was Spring Creek School's area when the decile was 4? | SELECT area FROM table_name_67 WHERE decile = 4 AND name = "spring creek school" |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate... | Number of questions asked on site before date. | SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND CreationDate < '##Date##' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | how many patients whose year of birth is less than 2103 and diagnoses short title is preterm nec 1250-1499g? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2103" AND diagnoses.short_title = "Preterm NEC 1250-1499g" |
CREATE TABLE table_62256 (
"Season" text,
"Date" text,
"Winner" text,
"Loser" text,
"Score" text,
"Venue" text,
"Attendance" text
) | For which venue did Leicester City lose? | SELECT "Venue" FROM table_62256 WHERE "Loser" = 'leicester city' |
CREATE TABLE table_63668 (
"School" text,
"City" text,
"Team Name" text,
"Enrollment 08-09" real,
"IHSAA Class" text,
"IHSAA Class Football" text,
"County" text,
"Year Joined (Or Joining)" real,
"Previous Conference" text
) | What year did the team from City of Aurora join? | SELECT AVG("Year Joined (Or Joining)") FROM table_63668 WHERE "City" = 'aurora' |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | What are the number one tags for low quality posts?. | SELECT t.TagName, (COUNT(*) * 1.0 / (SELECT COUNT(*) FROM PostTags AS ptt WHERE ptt.TagId = t.Id)) AS dvpercent FROM PostTags AS pt INNER JOIN Tags AS t ON pt.TagId = t.Id INNER JOIN (SELECT pv.Id, COUNT(*) AS downmod FROM Posts AS pv INNER JOIN Votes AS v ON v.PostId = pv.Id AND v.VoteTypeId = 3 WHERE CAST((JULIANDAY(... |
CREATE TABLE table_name_67 (
election INTEGER,
outcome_of_election VARCHAR,
seats VARCHAR
) | What is the earliest election with 2 seats and the outcome of the election of minority in parliament? | SELECT MIN(election) FROM table_name_67 WHERE outcome_of_election = "minority in parliament" AND seats = "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 did not have any job in the past, find hire_date and the amount of hire_date bin hire_date by time, and visualize them by a bar chart, and rank by the Y-axis in ascending please. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE) |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE patients (
row_id number,
subject_id num... | what were the five most frequently provided tests for patients who had previously been diagnosed with cerv spondyl w myelopath during the same hospital encounter, until 1 year ago? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W... |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | Unanswered questions by low-reputation users. | SELECT p.CreationDate, p.Id AS "post_link", p.Tags FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE u.Reputation < 15 AND p.PostTypeId = 1 AND COALESCE(p.AnswerCount, 0) = 0 AND p.ClosedDate IS NULL ORDER BY p.CreationDate DESC |
CREATE TABLE table_name_93 (
winning_score VARCHAR,
date VARCHAR
) | What is the Winning score on oct 22, 2000? | SELECT winning_score FROM table_name_93 WHERE date = "oct 22, 2000" |
CREATE TABLE book (
Book_ID int,
Title text,
Issues real,
Writer text
)
CREATE TABLE publication (
Publication_ID int,
Book_ID int,
Publisher text,
Publication_Date text,
Price real
) | Show different publishers together with the number of publications they have in a bar chart, and I want to order by the bars in asc. | SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher ORDER BY Publisher |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE i... | when did patient 031-3355 have a other microbiology test last on their current hospital encounter? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microla... |
CREATE TABLE table_15916 (
"School" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text
) | In what year was Lindenwood University founded? | SELECT MIN("Founded") FROM table_15916 WHERE "School" = 'Lindenwood University' |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
C... | how many FIRST class flights does UA have today | SELECT COUNT(DISTINCT flight.flight_id) FROM airport_service, city, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE_DAY_0.day_number = 29 AND DATE_DAY_0.month_number = 4 AND DATE_DAY_0.year = 1... |
CREATE TABLE table_name_72 (
report VARCHAR,
date VARCHAR
) | Which Report is Dated 9 March? | SELECT report FROM table_name_72 WHERE date = "9 march" |
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(19,4),
product_name VARCHAR(80),
product_color VARCHAR(20),
product_size VARCHAR(20)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
dat... | Return a histogram on what are the first names and ids for customers who have two or more accounts?, and display in descending by the names. | SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.customer_first_name DESC |
CREATE TABLE table_name_29 (
location VARCHAR,
date VARCHAR
) | What was the location on October 16? | SELECT location FROM table_name_29 WHERE date = "october 16" |
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
D... | Give me a histogram for what is the code of each role and the number of employees in each role?, and sort x axis in desc order please. | SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY Role_Code DESC |
CREATE TABLE table_75435 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
) | Series of oilers win 4 3 had what highest game? | SELECT MAX("Game") FROM table_75435 WHERE "Series" = 'oilers win 4–3' |
CREATE TABLE table_name_47 (
points INTEGER,
year VARCHAR,
chassis VARCHAR
) | Name the sumof points for year less than 1994 and chassis of lola lc89b | SELECT SUM(points) FROM table_name_47 WHERE year < 1994 AND chassis = "lola lc89b" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.