table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | posts of a user that are tagged as apex. | SELECT DISTINCT u.DisplayName, CONCAT('https://stackoverflow.com/users/', u.Id) AS "profile_link", u.Location, u.AboutMe, u.Reputation FROM Users AS u, Posts AS q, Posts AS a WHERE u.Id = a.OwnerUserId AND a.ParentId = q.Id AND a.PostTypeId = 2 AND q.Tags LIKE '%apex%' AND q.PostTypeId = 1 ORDER BY u.Reputation DESC |
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... | Show me about the distribution of All_Home and the sum of School_ID , and group by attribute All_Home in a bar chart. | SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home |
CREATE TABLE table_name_87 (
date VARCHAR,
away_team VARCHAR
) | What date did Hawthorn play as the away team? | SELECT date FROM table_name_87 WHERE away_team = "hawthorn" |
CREATE TABLE table_27723526_10 (
score VARCHAR,
team VARCHAR
) | What was the score of the game against portland? | SELECT score FROM table_27723526_10 WHERE team = "Portland" |
CREATE TABLE table_5835 (
"Round" real,
"Selection" text,
"Name" text,
"Position" text,
"College" text,
"Contract" text
) | What position does the College of Louisiana State have? | SELECT "Position" FROM table_5835 WHERE "College" = 'louisiana state' |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int... | What Spring classes are offered ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
CREATE TABLE table_63544 (
"Children of Earth" text,
"Run time" text,
"Writer" text,
"Director" text,
"Original airdate" text,
"Viewers (including HD) in millions" text
) | How many viewers were there for Children of Earth of 'day one'? | SELECT "Viewers (including HD) in millions" FROM table_63544 WHERE "Children of Earth" = 'day one' |
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
)
... | provide the number of patients whose drug name is gemfibrozil? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Gemfibrozil" |
CREATE TABLE table_name_92 (
tourist_arrivals__2011___millions_ INTEGER,
tourism_competitiveness__2011___ttci_ VARCHAR,
tourism_receipts__2011___us$_per_arrival_ VARCHAR
) | What is the highest tourism arrivals in 2011 in millions with a 3.82 tourism competitiveness in 2011 and more than 1,102 US$ per arrival in 2011 tourism receipts? | SELECT MAX(tourist_arrivals__2011___millions_) FROM table_name_92 WHERE tourism_competitiveness__2011___ttci_ = "3.82" AND tourism_receipts__2011___us$_per_arrival_ > 1 OFFSET 102 |
CREATE TABLE table_name_92 (
rank INTEGER,
matches VARCHAR,
goals VARCHAR
) | What is the average rank for players with under 205 matches and under 100 goals? | SELECT AVG(rank) FROM table_name_92 WHERE matches < 205 AND goals < 100 |
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 was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, show by the X in descending please. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC |
CREATE TABLE table_52617 (
"Club" text,
"Premier League" text,
"Championship/First Division" text,
"League One/Second Division" text,
"League Two/Third Division" text
) | I want the league one/second division for club of millwall | SELECT "League One/Second Division" FROM table_52617 WHERE "Club" = 'millwall' |
CREATE TABLE table_name_91 (
required_os VARCHAR,
developer_s_ VARCHAR
) | What was the minimum operating system required by Stunlock Studios' game? | SELECT required_os FROM table_name_91 WHERE developer_s_ = "stunlock studios" |
CREATE TABLE table_70311 (
"Classification" text,
"Fastest time (s)" real,
"Athlete" text,
"Country" text,
"Date" text,
"Location" text
) | What is the location of Classification of T12? | SELECT "Location" FROM table_70311 WHERE "Classification" = 't12' |
CREATE TABLE table_name_66 (
females VARCHAR,
language VARCHAR
) | What is the number of females that has the Polish language? | SELECT females FROM table_name_66 WHERE language = "polish" |
CREATE TABLE table_51996 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the home team at VFL Park? | SELECT "Home team" FROM table_51996 WHERE "Venue" = 'vfl park' |
CREATE TABLE table_52718 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | Name the total number in attendance for when the bulls visited | SELECT COUNT("Attendance") FROM table_52718 WHERE "Visitor" = 'bulls' |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | Visualize a bar chart about the distribution of Name and Weight . | SELECT Name, Weight FROM people |
CREATE TABLE table_4549 (
"Team" text,
"Chassis" text,
"Engine" text,
"Tyre" text,
"Drivers" text,
"Races" text
) | What engine did Casey Mears use on the Reynard 01i Chassis? | SELECT "Engine" FROM table_4549 WHERE "Chassis" = 'reynard 01i' AND "Drivers" = 'casey mears' |
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,
... | give the number of patients whose admission location is clinic referral/premature and procedure long title is central venous catheter placement with guidance. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.long_title = "Central venous catheter placement with guidance" |
CREATE TABLE table_name_28 (
location_attendance VARCHAR,
score VARCHAR
) | What location has an attendance and a score of l 90 91 (ot)? | SELECT location_attendance FROM table_name_28 WHERE score = "l 90–91 (ot)" |
CREATE TABLE table_43460 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What is the attendance when the opponent is the San Francisco 49ers? | SELECT "Attendance" FROM table_43460 WHERE "Opponent" = 'san francisco 49ers' |
CREATE TABLE table_name_8 (
team VARCHAR,
chassis VARCHAR,
champion VARCHAR
) | Which team, with champion Bastian Kolmsee, used a Dallara f302 for the chassis? | SELECT team FROM table_name_8 WHERE chassis = "dallara f302" AND champion = "bastian kolmsee" |
CREATE TABLE shop (
shop_id VARCHAR,
address VARCHAR,
score INTEGER
) | Find the id and address of the shops whose score is below the average score. | SELECT shop_id, address FROM shop WHERE score < (SELECT AVG(score) FROM shop) |
CREATE TABLE table_39549 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many total gold medals did India receive? | SELECT "Gold" FROM table_39549 WHERE "Nation" = 'india' |
CREATE TABLE table_name_18 (
long INTEGER,
player VARCHAR,
avg VARCHAR
) | What is the average long that Ramon Richardson played and an average greater than 5.5? | SELECT AVG(long) FROM table_name_18 WHERE player = "ramon richardson" AND avg > 5.5 |
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
... | Show me how many home team by home team in a histogram, and I want to order how many home team in ascending order. | SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY COUNT(Home_team) |
CREATE TABLE table_name_83 (
country VARCHAR,
team VARCHAR
) | What country is Relax-Gam from? | SELECT country FROM table_name_83 WHERE team = "relax-gam" |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | how many hours have been elapsed since patient 95057 was admitted to the icu? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95057) AND icustays.outtime IS NULL |
CREATE TABLE table_name_99 (
position VARCHAR,
pick__number VARCHAR
) | Which Position has a Pick # of 18? | SELECT position FROM table_name_99 WHERE pick__number = 18 |
CREATE TABLE table_15122 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | When has a Venue of Adelaide Oval? | SELECT "Date" FROM table_15122 WHERE "Venue" = 'adelaide oval' |
CREATE TABLE table_52496 (
"Block A" text,
"BLACK BUSHI" text,
"BUSHI" text,
"Kaz Hayashi" text,
"Kenny Omega" text,
"Minoru" text
) | Name the BUSHI when it has kenny omega of yang (7:27) | SELECT "BUSHI" FROM table_52496 WHERE "Kenny Omega" = 'yang (7:27)' |
CREATE TABLE table_3465 (
"Player" text,
"Number Of Selections" real,
"First Team" real,
"Second Team" real,
"Season MVP" real,
"Final Four MVP" real
) | when number of selection is 2 and first team is 1 who are all the player | SELECT "Player" FROM table_3465 WHERE "First Team" = '1' AND "Number Of Selections" = '2' |
CREATE TABLE table_name_11 (
females VARCHAR,
language VARCHAR
) | How many females speak Ukrainian? | SELECT females FROM table_name_11 WHERE language = "ukrainian" |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_N... | For each headquarter, what are the headquarter and how many companies are centered there. Visualize by bar chart. | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters |
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 with delta abnormal lab test status have been diagnosed with pure hypercholesterolemia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Pure hypercholesterolemia" AND lab.flag = "delta" |
CREATE TABLE table_name_60 (
percent_of_slovenes_1951 VARCHAR,
number_of_people_1991 VARCHAR,
village__german_ VARCHAR
) | Which Percent of Slovenes 1951 has a Number of people 1991 larger than 8, and a Village (German) of pl schenberg? | SELECT percent_of_slovenes_1951 FROM table_name_60 WHERE number_of_people_1991 > 8 AND village__german_ = "plöschenberg" |
CREATE TABLE table_name_34 (
year INTEGER,
pts VARCHAR,
entrant VARCHAR
) | What year did Ecurie Bleue score more than 0 points? | SELECT AVG(year) FROM table_name_34 WHERE pts > 0 AND entrant = "ecurie bleue" |
CREATE TABLE table_9235 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text,
"Points" real
) | What is the date of the game with 62 points? | SELECT "Date" FROM table_9235 WHERE "Points" = '62' |
CREATE TABLE table_46319 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Bonus Points" text,
"Points" text
) | What is Points For, when Points Against is 571? | SELECT "Points for" FROM table_46319 WHERE "Points against" = '571' |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | how many hours has passed since patient 006-133605 recieved his last prescription for morphine sulfate (pf) 2 mg/ml iv soln in this hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-13... |
CREATE TABLE Organisations (
organisation_id VARCHAR,
organisation_type VARCHAR
)
CREATE TABLE organisation_Types (
organisation_type VARCHAR,
organisation_type_description VARCHAR
)
CREATE TABLE Grants (
organisation_id VARCHAR
) | What is the total grant amount of the organisations described as research? | SELECT SUM(grant_amount) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id JOIN organisation_Types AS T3 ON T2.organisation_type = T3.organisation_type WHERE T3.organisation_type_description = 'Research' |
CREATE TABLE table_71325 (
"Club" text,
"League" text,
"Sport" text,
"Venue" text,
"Established" real
) | What League of VSL Sport was Established in 1935? | SELECT "Sport" FROM table_71325 WHERE "Established" = '1935' AND "League" = 'vsl' |
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... | give me the number of patients whose diagnoses icd9 code is e9530 and lab test category is hematology? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "E9530" AND lab."CATEGORY" = "Hematology" |
CREATE TABLE table_name_34 (
version VARCHAR,
developer VARCHAR,
title VARCHAR
) | What Version has a Developer of dino games, and a Title of metronome? | SELECT version FROM table_name_34 WHERE developer = "dino games" AND title = "metronome" |
CREATE TABLE table_34004 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
) | Which Surface has a Date of 16 november 2007? | SELECT "Surface" FROM table_34004 WHERE "Date" = '16 november 2007' |
CREATE TABLE table_name_29 (
Id VARCHAR
) | What in 2013 has a 2009 of 3r? | SELECT 2013 FROM table_name_29 WHERE 2009 = "3r" |
CREATE TABLE table_18600760_10 (
geo_id INTEGER,
county VARCHAR
) | What is the geo id for Logan county? | SELECT MAX(geo_id) FROM table_18600760_10 WHERE county = "Logan" |
CREATE TABLE table_name_85 (
Id VARCHAR
) | What shows for 2002 when 2010 shows 69? | SELECT 2002 FROM table_name_85 WHERE 2010 = "69" |
CREATE TABLE Problem_Status_Codes (
problem_status_code VARCHAR(20),
problem_status_description VARCHAR(80)
)
CREATE TABLE Problems (
problem_id INTEGER,
product_id INTEGER,
closure_authorised_by_staff_id INTEGER,
reported_by_staff_id INTEGER,
date_problem_reported DATETIME,
date_proble... | List all the log entry descriptions and count them using a bar chart, order by the Y in ascending. | SELECT log_entry_description, COUNT(log_entry_description) FROM Problem_Log GROUP BY log_entry_description ORDER BY COUNT(log_entry_description) |
CREATE TABLE table_23119 (
"Fleet #" text,
"Year" real,
"Manufacture" text,
"Model" text,
"Length (ft)" real,
"Engine" text,
"Transmission" text
) | What is the fleet number when the transmission is Voith D863.4 and the engine is Cummins ISL? | SELECT "Fleet #" FROM table_23119 WHERE "Transmission" = 'Voith D863.4' AND "Engine" = 'Cummins ISL' |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Tag associated with other tags. | SELECT MAX(t2.TagName) AS LeftTag, MAX(t.TagName) AS RightTag, COUNT(pt2.TagId) AS LeftCount, MAX(t.Count) AS RightCount, (CAST(COUNT(pt2.TagId) AS FLOAT) / CAST(MAX(t.Count) AS FLOAT)) AS Per FROM PostTags AS pt JOIN PostTags AS pt2 ON pt.PostId = pt2.PostId JOIN Tags AS t ON pt.TagId = t.Id JOIN Tags AS t2 ON pt2.Tag... |
CREATE TABLE table_55193 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which team plays at Punt Road Oval? | SELECT "Home team" FROM table_55193 WHERE "Venue" = 'punt road oval' |
CREATE TABLE table_2252 (
"Date" text,
"Location" text,
"Discipline" text,
"Winner" text,
"2nd place" text,
"3rd place" text
) | Who won the cup on 30.11.2008? | SELECT "Winner" FROM table_2252 WHERE "Date" = '30.11.2008' |
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 of the clinic referral/premature patients were born before the year 2120? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.dob_year < "2120" |
CREATE TABLE table_68776 (
"Name" text,
"Street Address" text,
"Years as tallest" text,
"Height ft / m" text,
"Floors" real
) | During what years did the tallest building, located at 211 Union Street, have less than 31 floors? | SELECT "Years as tallest" FROM table_68776 WHERE "Floors" < '31' AND "Street Address" = '211 union street' |
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,
... | give me the number of patients whose diagnoses icd9 code is 5180 and lab test abnormal status is abnormal? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "5180" AND lab.flag = "abnormal" |
CREATE TABLE table_203_523 (
id number,
"state" text,
"swimsuit" number,
"interview" number,
"evening gown" number,
"average" number,
"finalists" number
) | who scored the highest in the swimsuit round ? | SELECT "state" FROM table_203_523 ORDER BY "swimsuit" DESC LIMIT 1 |
CREATE TABLE affected_region (
region_id number,
storm_id number,
number_city_affected number
)
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions_usd number,
number_deaths number
)
CREATE TABLE region (
region_id number,
r... | What are the names of the storms that affected both the regions of Afghanistan and Albania? | SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Afghanistan' INTERSECT SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id... |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | what's the name of the procedure that patient 42757 was given two or more times in 11/2102? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 427... |
CREATE TABLE table_name_8 (
change__12_11_ VARCHAR,
city VARCHAR
) | When the city is agadir what is the change (12/11)? | SELECT change__12_11_ FROM table_name_8 WHERE city = "agadir" |
CREATE TABLE table_name_66 (
result VARCHAR,
date VARCHAR
) | What was the Result on October 27, 2002? | SELECT result FROM table_name_66 WHERE date = "october 27, 2002" |
CREATE TABLE table_13026799_3 (
scoring_average VARCHAR,
money_list_rank VARCHAR
) | Name the total number of scoring average for money list rank of 174 | SELECT COUNT(scoring_average) FROM table_13026799_3 WHERE money_list_rank = "174" |
CREATE TABLE table_name_26 (
home_team VARCHAR,
road_team VARCHAR,
game VARCHAR
) | Which home team played against Los Angeles in game 1? | SELECT home_team FROM table_name_26 WHERE road_team = "los angeles" AND game = "game 1" |
CREATE TABLE table_3005999_1 (
provider VARCHAR,
destination VARCHAR
) | Who are all providers with destination of Liverpool? | SELECT provider FROM table_3005999_1 WHERE destination = "Liverpool" |
CREATE TABLE table_name_46 (
Id VARCHAR
) | What shows for 2002 when the 1991 is w? | SELECT 2002 FROM table_name_46 WHERE 1991 = "w" |
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 code over the name , and group by attribute founder by a bar chart, sort by the y-axis in desc. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code DESC |
CREATE TABLE table_name_58 (
overall INTEGER,
school_club_team VARCHAR
) | What is arizona state overall lowest? | SELECT MIN(overall) FROM table_name_58 WHERE school_club_team = "arizona state" |
CREATE TABLE table_name_13 (
name VARCHAR,
number VARCHAR,
season VARCHAR,
acquisition_via VARCHAR
) | What is the name of the player for the 2010-2011 season, from a Free Agency and is Number 14? | SELECT name FROM table_name_13 WHERE season = "2010-2011" AND acquisition_via = "free agency" AND number = "14" |
CREATE TABLE table_16446652_1 (
season VARCHAR,
president VARCHAR
) | When was Jonny Leadbeater President? | SELECT season FROM table_16446652_1 WHERE president = "Jonny Leadbeater" |
CREATE TABLE table_31443 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Viewers (million)" text
) | Who directed the episdoe veiwed by 3.24 million viewers? | SELECT "Directed by" FROM table_31443 WHERE "Viewers (million)" = '3.24' |
CREATE TABLE table_name_30 (
not_usable INTEGER,
block VARCHAR,
launch_failures VARCHAR,
retired VARCHAR
) | What is the highest number of not usable satellites when there are more than 0 launch failures, less than 30 retired, and the block is I? | SELECT MAX(not_usable) FROM table_name_30 WHERE launch_failures > 0 AND retired < 30 AND block = "block i" |
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year int
)
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of t... | Show all countries and the number of people from each country with a bar chart, and show Y in descending order please. | SELECT Country, COUNT(*) FROM people GROUP BY Country ORDER BY COUNT(*) DESC |
CREATE TABLE table_25939 (
"SF Round" real,
"Country" text,
"Location" text,
"Date" text,
"Driver" text,
"Race 1(pts)" real,
"Race 2(pts)" real,
"Race Total(pts)" real
) | How many dates have a total points for race of 180? | SELECT COUNT("Date") FROM table_25939 WHERE "Race Total(pts)" = '180' |
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
)
... | count the number of patients whose gender is f and drug code is amio150i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "AMIO150I" |
CREATE TABLE table_204_790 (
id number,
"year" number,
"nw rank" number,
"venue" text,
"opp rank" number,
"opponent" text,
"score" text,
"w/l" text,
"round" text,
"notes" text
) | what was the difference in points scored between the two teams in 1996 ? | SELECT ABS("score" - "score") FROM table_204_790 WHERE "year" = 1996 |
CREATE TABLE product_suppliers (
product_id number,
supplier_id number,
date_supplied_from time,
date_supplied_to time,
total_amount_purchased text,
total_value_purchased number
)
CREATE TABLE supplier_addresses (
supplier_id number,
address_id number,
date_from time,
date_to ti... | Find the average price of all product clothes. | SELECT AVG(product_price) FROM products WHERE product_type_code = 'Clothes' |
CREATE TABLE table_68288 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Which score has t3 as the place? | SELECT "Score" FROM table_68288 WHERE "Place" = 't3' |
CREATE TABLE table_52685 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the average grid for piers courage? | SELECT AVG("Grid") FROM table_52685 WHERE "Driver" = 'piers courage' |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | give me the number of patients whose diagnoses long title is other shock without mention of trauma and lab test abnormal status is abnormal? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Other shock without mention of trauma" AND lab.flag = "abnormal" |
CREATE TABLE table_dev_36 (
"id" int,
"gender" string,
"prediabetes" bool,
"leukopenia" int,
"hemoglobin_a1c_hba1c" float,
"cd4_count" int,
"platelets" int,
"hematocrit_hct" float,
"fasting_triglycerides" int,
"hyperlipidemia" bool,
"lymphopenia" int,
"fasting_ldl_cholest... | a fasting glucose 100 _ 125 mg / dl, or a hba1c measurement of 5.7 _ 6.4 % , or a diagnosis of prediabetes or impaired fasting glucose in the past 6 months | SELECT * FROM table_dev_36 WHERE (fasting_glucose >= 100 AND fasting_glucose <= 125) OR (hemoglobin_a1c_hba1c >= 5.7 AND hemoglobin_a1c_hba1c <= 6.4) OR (prediabetes = 1 OR impaired_fasting_glucose = 1) |
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 marital status is single and item id is 51250? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.itemid = "51250" |
CREATE TABLE table_name_73 (
player VARCHAR,
total VARCHAR
) | What is Player, when Total is '154'? | SELECT player FROM table_name_73 WHERE total = "154" |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varc... | 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 phone_number and salary , and display X in ascending order please. | SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER |
CREATE TABLE table_39143 (
"FOURCC" text,
"DX 10 Name" text,
"Description" text,
"Alpha premultiplied?" text,
"Compression ratio" text,
"Texture Type" text
) | Which DX 10 Name that has a No Alpha premultiplied and a Description of explicit alpha? | SELECT "DX 10 Name" FROM table_39143 WHERE "Alpha premultiplied?" = 'no' AND "Description" = 'explicit alpha' |
CREATE TABLE table_name_8 (
Id VARCHAR
) | What is the sum of 1938 values where 1933 values are under 68.3 and 1940 valures are under 4.02? | SELECT SUM(1938) FROM table_name_8 WHERE 1933 < 68.3 AND 1940 < 4.02 |
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 (
... | What number of american indian/alaska natives were given the drug named syringe (neonatal) *d5w*? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug = "Syringe (Neonatal) *D5W*" |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
... | Usually , are there 2 or 3 lectures for 312 every week ? | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday, semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND c... |
CREATE TABLE table_203_405 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
) | what was the difference between the attendance in week two and the attendance in week one ? | SELECT (SELECT "attendance" FROM table_203_405 WHERE "week" = 2) - (SELECT "attendance" FROM table_203_405 WHERE "week" = 1) |
CREATE TABLE table_5242 (
"Years" text,
"Building" text,
"City" text,
"Height" text,
"Storeys" real
) | Which building has 26 storeys? | SELECT "Building" FROM table_5242 WHERE "Storeys" = '26' |
CREATE TABLE Roles (
role_code CHAR(15),
role_description VARCHAR(255)
)
CREATE TABLE Addresses (
address_id INTEGER,
address_details VARCHAR(255)
)
CREATE TABLE Documents_Mailed (
document_id INTEGER,
mailed_to_address_id INTEGER,
mailing_date DATETIME
)
CREATE TABLE Circulation_History ... | How many employees does each role have? Plot a bar chart listing role id and number of employees, and sort by the y-axis from low to high. | SELECT T1.role_code, COUNT(*) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code ORDER BY COUNT(*) |
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 demographic (
subject_id text,
hadm_id t... | What is the number of patients on main type drug prescriptions who have the diagnoses of unspecified neutropenia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Neutropenia NOS" AND prescriptions.drug_type = "MAIN" |
CREATE TABLE table_57196 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | What was the date with a hilly stage? | SELECT "Date" FROM table_57196 WHERE "Type" = 'hilly stage' |
CREATE TABLE table_17855 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | How many clubs have a tries against count of 41? | SELECT COUNT("Try bonus") FROM table_17855 WHERE "Tries against" = '41' |
CREATE TABLE table_21775 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Bonus Points" text,
"Points" text
) | How many won when points against is 410? | SELECT COUNT("Won") FROM table_21775 WHERE "Points against" = '410' |
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... | Stack bar chart of school_id vs ACC_Home based on all home, and list from high to low by the bars. | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home DESC |
CREATE TABLE table_64723 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What was the date of the tournament with a clay surface and an opponent of Irina Falconi? | SELECT "Date" FROM table_64723 WHERE "Surface" = 'clay' AND "Opponent" = 'irina falconi' |
CREATE TABLE table_47369 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the high rebounds when the score was l 85 102 (ot)? | SELECT "High rebounds" FROM table_47369 WHERE "Score" = 'l 85–102 (ot)' |
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
... | Show white percentages of cities and the crime rates of counties they are in with a scatter chart. | SELECT White, Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID |
CREATE TABLE table_52452 (
"Round" real,
"Grand Prix" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
) | Who had the fastest lap at the Australian Grand Prix? | SELECT "Fastest Lap" FROM table_52452 WHERE "Grand Prix" = 'australian grand prix' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.