answer stringlengths 6 3.91k | question stringlengths 7 766 | context stringlengths 27 7.14k |
|---|---|---|
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 = '029-7028' AND NOT patient.hospitaldischargetime IS NULL ORDER BY pa... | tell me the drug that was prescribed to patient 029-7028 for the last time in their first hospital encounter? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... |
SELECT COUNT(1 AS st_leg) FROM table_17282875_3 WHERE team__number2 = "Universidad de Chile" | When they played Universidad de Chile, what was the score of the first leg? | CREATE TABLE table_17282875_3 (team__number2 VARCHAR) |
SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = "Rob Dinning" | What is the name of the marketing region that the store Rob Dinning belongs to? | CREATE TABLE Marketing_Regions (Marketing_Region_Name VARCHAR, Marketing_Region_Code VARCHAR); CREATE TABLE Stores (Marketing_Region_Code VARCHAR, Store_Name VARCHAR) |
SELECT MAX("Points") FROM table_28031 WHERE "Player" = 'Curtis' | How many maximum points did Curtis scored? | CREATE TABLE table_28031 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) |
SELECT team__number2 FROM table_17282875_3 WHERE team__number1 = "San Lorenzo" | Who played San Lorenzo? | CREATE TABLE table_17282875_3 (team__number2 VARCHAR, team__number1 VARCHAR) |
SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 | What are the descriptions of the service types with product price above 100? | CREATE TABLE Services (Service_Type_Code VARCHAR, Product_Price INTEGER); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR) |
SELECT "team" FROM table_204_772 WHERE id = (SELECT id FROM table_204_772 WHERE "team" = 'confey') - 1 | what team comes before confey | CREATE TABLE table_204_772 (
id number,
"team" text,
"county" text,
"wins" number,
"years won" number
) |
SELECT team__number2 FROM table_17282875_3 WHERE team__number1 = "River Plate" | Who played River Plate? | CREATE TABLE table_17282875_3 (team__number2 VARCHAR, team__number1 VARCHAR) |
SELECT T1.Service_Type_Description, T2.Service_Type_Code, 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 | What is the description, code and the corresponding count of each service type? | CREATE TABLE Services (Service_Type_Code VARCHAR); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR) |
SELECT MAX(year) FROM table_name_29 WHERE partner = "gardnar mulloy" AND score = "12–10, 8–10, 12–10, 6–2" | what is the most recent year gardnar mulloy played as a partner and score was 12 10, 8 10, 12 10, 6 2? | CREATE TABLE table_name_29 (
year INTEGER,
partner VARCHAR,
score VARCHAR
) |
SELECT COUNT(1 AS st_leg) FROM table_17282875_2 WHERE team__number2 = "Botafogo" | What was the score on the 1st leg if the team 2 is botafogo? | CREATE TABLE table_17282875_2 (team__number2 VARCHAR) |
SELECT T1.Service_Type_Description, T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1 | What is the description and code of the type of service that is performed the most often? | CREATE TABLE Services (Service_Type_Code VARCHAR); CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR) |
SELECT "Stadium" FROM table_71510 WHERE "Final Score" = '31-28' | At what stadium was the final score 31-28? | CREATE TABLE table_71510 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) |
SELECT team__number2 FROM table_17282875_2 WHERE team__number1 = "Vitória" | Who played against team 1 Vitória? | CREATE TABLE table_17282875_2 (team__number2 VARCHAR, team__number1 VARCHAR) |
SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID | What are the phones and emails of workshop groups in which services are performed? | CREATE TABLE Services (Workshop_Group_ID VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Phone VARCHAR, Store_Email_Address VARCHAR, Workshop_Group_ID VARCHAR) |
SELECT a.Id AS "post_link" FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id WHERE q.CreationDate > a.CreationDate ORDER BY a.CreationDate DESC | Questions answered before they were asked. | CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNot... |
SELECT team__number2 FROM table_17282875_2 WHERE team__number1 = "Liverpool" | Who played against team 1 Liverpool? | CREATE TABLE table_17282875_2 (team__number2 VARCHAR, team__number1 VARCHAR) |
SELECT T1.Store_Phone, T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = "film" | What are the names of workshop groups in which services with product name "film" are performed? | CREATE TABLE Services (Workshop_Group_ID VARCHAR, Product_Name VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Phone VARCHAR, Store_Email_Address VARCHAR, Workshop_Group_ID VARCHAR) |
SELECT "tribunal" FROM table_203_303 WHERE "total" = 0 | what was the only tribunal to pronounce zero sentences ? | 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
) |
SELECT points FROM table_17282875_2 WHERE team__number2 = "Deportivo Anzoátegui" | What was the game's points against Team 2 Deportivo Anzoátegui? | CREATE TABLE table_17282875_2 (points VARCHAR, team__number2 VARCHAR) |
SELECT Product_Name, AVG(Product_Price) FROM PRODUCTS GROUP BY Product_Name | What are the different product names? What is the average product price for each of them? | CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER) |
SELECT COUNT("Introductory phrase") FROM table_28001 WHERE "The W\u00f8rd" = 'Unrequited Gov' | How many introductory phrases are there with 'the w rd' is 'unrequited gov'? | CREATE TABLE table_28001 (
"Episode #" real,
"The W\u00f8rd" text,
"Guest" text,
"Introductory phrase" text,
"Original airdate" text,
"Production code" real
) |
SELECT COUNT(high_points) FROM table_17288825_10 WHERE location_attendance = "US Airways Center 18,422" | How many different items appear in the high points column when the location attendance was US Airways Center 18,422? | CREATE TABLE table_17288825_10 (high_points VARCHAR, location_attendance VARCHAR) |
SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING AVG(Product_Price) < 1000000 | What are the product names with average product price smaller than 1000000? | CREATE TABLE PRODUCTS (Product_Name VARCHAR, Product_Price INTEGER) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "1" AND diagnoses.icd9_code = "3970" | what is the number of patients whose days of hospital stay is greater than 1 and diagnoses icd9 code is 3970? | 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 lab (
subject_id text,
hadm_id text,
... |
SELECT high_assists FROM table_17288825_10 WHERE date = "April 7" | What was the high assists on April 7? | CREATE TABLE table_17288825_10 (high_assists VARCHAR, date VARCHAR) |
SELECT SUM(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = "photo" | What are the total order quantities of photo products? | CREATE TABLE ORDER_ITEMS (Order_Quantity INTEGER, Product_ID VARCHAR); CREATE TABLE Products (Product_ID VARCHAR, Product_Name VARCHAR) |
SELECT SUM(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 = '028-34632') AND NOT patient.unitdischargetime IS... | what was the total of the suprapubic urine output that patient 028-34632 had on the first icu visit? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... |
SELECT score FROM table_17288825_7 WHERE date = "January 25" | What is the score for the game played on January 25? | CREATE TABLE table_17288825_7 (score VARCHAR, date VARCHAR) |
SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000 | What are the order details of the products with price higher than 2000? | CREATE TABLE Products (Product_ID VARCHAR, Product_price INTEGER); CREATE TABLE ORDER_ITEMS (Other_Item_Details VARCHAR, Product_ID VARCHAR) |
SELECT "Away team" FROM table_40750 WHERE "Home team" = 'blackpool' | What was the Away Team of Blackpool's Home game? | CREATE TABLE table_40750 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text,
"Attendance" real
) |
SELECT record FROM table_17288825_7 WHERE date = "January 19" | What is the record for the team on January 19? | CREATE TABLE table_17288825_7 (record VARCHAR, date VARCHAR) |
SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1 | What are the actual delivery dates of orders with quantity 1? | CREATE TABLE Customer_Orders (Actual_Delivery_Date VARCHAR, Order_ID VARCHAR); CREATE TABLE ORDER_ITEMS (Order_ID VARCHAR, Order_Quantity VARCHAR) |
SELECT "Written by" FROM table_24864 WHERE "Original air date" = 'April 5, 1987' | Who wrote when the original airdate is April 5, 1987? | CREATE TABLE table_24864 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) |
SELECT COUNT(record) FROM table_17288825_7 WHERE high_points = "Ron Artest (24)" | How many times did Ron Artest (24) receive the record for high points? | CREATE TABLE table_17288825_7 (record VARCHAR, high_points VARCHAR) |
SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000 | What are the order dates of orders with price higher than 1000? | CREATE TABLE Products (Product_ID VARCHAR, Product_price INTEGER); CREATE TABLE ORDER_ITEMS (Order_ID VARCHAR, Product_ID VARCHAR); CREATE TABLE Customer_Orders (Order_Date VARCHAR, Order_ID VARCHAR) |
SELECT "Venue" FROM table_33293 WHERE "Home team score" = '8.6 (54)' | At what venue did the match where the home team scored 8.6 (54) take place? | CREATE TABLE table_33293 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) |
SELECT location_attendance FROM table_17288825_7 WHERE high_assists = "Rafer Alston (10)" | At what location and what was the attendance when Rafer Alston (10) achieved high assists? | CREATE TABLE table_17288825_7 (location_attendance VARCHAR, high_assists VARCHAR) |
SELECT COUNT(DISTINCT Currency_Code) FROM Drama_Workshop_Groups | How many distinct currency codes are there for all drama workshop groups? | CREATE TABLE Drama_Workshop_Groups (Currency_Code VARCHAR) |
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61751) AND microbiologyevents.spec_type_desc = 'bile' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 mon... | is there any history of microbiology test results for patient 61751's bile during the last month? | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
a... |
SELECT MAX(game) FROM table_17288825_7 WHERE location_attendance = "Conseco Fieldhouse 14,486" | At what game number was the attendance at Conseco Fieldhouse 14,486? | CREATE TABLE table_17288825_7 (game INTEGER, location_attendance VARCHAR) |
SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = "Feliciaberg" | What are the names of the drama workshop groups with address in Feliciaberg city? | CREATE TABLE Addresses (Address_ID VARCHAR, City_Town VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR, Address_ID VARCHAR) |
SELECT "Method" FROM table_58771 WHERE "Time" = '3:20' | What is Method, when Time is '3:20'? | CREATE TABLE table_58771 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" real,
"Time" text,
"Location" text
) |
SELECT MAX(game) FROM table_17288845_7 WHERE date = "January 19" | What is the number of the game that was played on January 19? | CREATE TABLE table_17288845_7 (game INTEGER, date VARCHAR) |
SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = "Alaska" | What are the email addresses of the drama workshop groups with address in Alaska state? | CREATE TABLE Drama_Workshop_Groups (Store_Email_Address VARCHAR, Address_ID VARCHAR); CREATE TABLE Addresses (Address_ID VARCHAR, State_County VARCHAR) |
SELECT COUNT("Contestant") FROM table_27692 WHERE "Height (ft)" = '5''7' AND "Age" = '26' | What is the number of contestants who are 5'7' and exactly 26 years of age? | CREATE TABLE table_27692 (
"Country" text,
"Contestant" text,
"Age" real,
"Height (cm)" real,
"Height (ft)" text,
"Hometown" text
) |
SELECT record FROM table_17288845_8 WHERE location_attendance = "Verizon Center 20,173" | Name the record for verizon center 20,173 | CREATE TABLE table_17288845_8 (record VARCHAR, location_attendance VARCHAR) |
SELECT T1.City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town | Show all cities along with the number of drama workshop groups in each city. | CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Drama_Workshop_Groups (Address_ID VARCHAR) |
SELECT "Rider" FROM table_50881 WHERE "Grid" = '21' | What Rider has a Grid of 21? | CREATE TABLE table_50881 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
) |
SELECT date FROM table_17288845_8 WHERE score = "L 89–91 (OT)" | Name the date for score l 89–91 (ot) | CREATE TABLE table_17288845_8 (date VARCHAR, score VARCHAR) |
SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY COUNT(*) DESC LIMIT 1 | What is the marketing region code that has the most drama workshop groups? | CREATE TABLE Drama_Workshop_Groups (Marketing_Region_Code VARCHAR) |
SELECT "Non- stop" FROM table_9325 WHERE "Plain stop" = 'ㄷ' | If the Plain stop is , what is the Non- stop? | CREATE TABLE table_9325 (
"Articulatory class" text,
"Non- stop" text,
"Plain stop" text,
"Aspirated stop" text,
"\"Muddy\" voice" text
) |
SELECT record FROM table_17288861_5 WHERE team = "Cleveland" | What was the team record when the team was Cleveland? | CREATE TABLE table_17288861_5 (record VARCHAR, team VARCHAR) |
SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID | Show all cities where at least one customer lives in but no performer lives in. | CREATE TABLE Customers (Address_ID VARCHAR); CREATE TABLE Addresses (City_Town VARCHAR, Address_ID VARCHAR); CREATE TABLE Performers (Address_ID VARCHAR) |
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.icd9_code = "78791" AND prescriptions.drug_type = "ADDITIVE" | find the number of patients on additive type drug prescription who have diagnoses icd9 code 78791. | 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... |
SELECT high_assists FROM table_17288861_9 WHERE score = "L 93–103 (OT)" | Name the high assists for l 93–103 (ot) | CREATE TABLE table_17288861_9 (high_assists VARCHAR, score VARCHAR) |
SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY COUNT(*) DESC LIMIT 1 | What is the most frequent status of bookings? | CREATE TABLE BOOKINGS (Status_Code VARCHAR) |
SELECT position FROM table_name_26 WHERE overall = 273 | WHAT POSITION IS 273? | CREATE TABLE table_name_26 (
position VARCHAR,
overall VARCHAR
) |
SELECT date FROM table_17288869_6 WHERE game = 21 | What was the date of game 21? | CREATE TABLE table_17288869_6 (date VARCHAR, game VARCHAR) |
SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" | What are the names of the workshop groups that have bookings with status code "stop"? | CREATE TABLE Bookings (Workshop_Group_ID VARCHAR, Status_Code VARCHAR); CREATE TABLE Drama_Workshop_Groups (Store_Name VARCHAR, Workshop_Group_ID VARCHAR) |
SELECT secretary FROM table_name_12 WHERE social_ao = "lieke de boer" | What Secretary has a Social AO of lieke de boer? | CREATE TABLE table_name_12 (
secretary VARCHAR,
social_ao VARCHAR
) |
SELECT round_of_32 FROM table_17289604_38 WHERE athlete = "Nicole Vaidišová" | What were the results for round of 32 for Nicole Vaidišová? | CREATE TABLE table_17289604_38 (round_of_32 VARCHAR, athlete VARCHAR) |
SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID | Show the names of all the clients with no booking. | CREATE TABLE Clients (Customer_Name VARCHAR, Client_ID VARCHAR); CREATE TABLE Bookings (Customer_ID VARCHAR); CREATE TABLE Clients (Customer_Name VARCHAR) |
SELECT COUNT(year) FROM table_name_84 WHERE points > 20 | What is the year that has points larger than 20? | CREATE TABLE table_name_84 (
year VARCHAR,
points INTEGER
) |
SELECT COUNT(athlete) FROM table_17289604_38 WHERE round_of_64 = "Llagostera Vives ( ESP ) L 6–2, 3–6, 5–7" | How many number of athletes were in round of 64 was llagostera Vives ( esp ) l 6–2, 3–6, 5–7? | CREATE TABLE table_17289604_38 (athlete VARCHAR, round_of_64 VARCHAR) |
SELECT AVG(Order_Quantity) FROM Invoices WHERE payment_method_code = "MasterCard" | What is the average quantities ordered with payment method code "MasterCard" on invoices? | CREATE TABLE Invoices (Order_Quantity INTEGER, payment_method_code VARCHAR) |
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20441 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.itemid IN (... | has patient 20441 ever had a arterial bp [diastolic] of greater than 73.0 when they came to the hospital first time? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
chartt... |
SELECT round_of_16 FROM table_17289604_38 WHERE round_of_32 = "Koryttseva ( UKR ) W 2–6, 6–1, 7–5" | What was round of 16 when in round 32 it was koryttseva ( ukr ) w 2–6, 6–1, 7–5? | CREATE TABLE table_17289604_38 (round_of_16 VARCHAR, round_of_32 VARCHAR) |
SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1 | What is the product ID of the most frequently ordered item on invoices? | CREATE TABLE INVOICES (Product_ID VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "Potassium, Urine" | provide the number of patients whose lab test name is potassium, urine and lab test result is abnormal. | 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,
... |
SELECT round_of_64 FROM table_17289604_38 WHERE event = "Singles" AND round_of_16 = "Did not advance" AND athlete = "Iveta Benešová" | What was round of 64 of the singles event when the result of round 16 was did not advance and the athlete was Iveta Benešová? | CREATE TABLE table_17289604_38 (round_of_64 VARCHAR, athlete VARCHAR, event VARCHAR, round_of_16 VARCHAR) |
SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product... | What is the description of the service type which offers both the photo product and the film product? | CREATE TABLE Ref_Service_Types (Service_Type_Description VARCHAR, Service_Type_Code VARCHAR); CREATE TABLE Services (Service_Type_Code VARCHAR, Product_Name VARCHAR) |
SELECT Address, Num_of_staff FROM shop WHERE NOT Shop_ID IN (SELECT Shop_ID FROM happy_hour) | Find the address and staff number of the shops that do not have any happy hour. Visualize by bar chart. | CREATE TABLE shop (
Shop_ID int,
Address text,
Num_of_staff text,
Score real,
Open_Year text
)
CREATE TABLE member (
Member_ID int,
Name text,
Membership_card text,
Age int,
Time_of_purchase int,
Level_of_membership int,
Address text
)
CREATE TABLE happy_hour (
HH_I... |
SELECT quarterfinals FROM table_17289604_38 WHERE round_of_32 = "S Williams / V Williams ( USA ) L 6–4, 5–7, 1–6" | What were the quarterfinals in the round of 32 was S williams / V williams ( usa ) l 6–4, 5–7, 1–6? | CREATE TABLE table_17289604_38 (quarterfinals VARCHAR, round_of_32 VARCHAR) |
SELECT COUNT(*) FROM Band | How many bands are there? | CREATE TABLE Band (Id VARCHAR) |
SELECT MAX(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-4486') AND NOT patient.unitdischargetime IS NULL... | indicate the daily maximum amount of heartrate for patient 002-4486 on the first icu visit. | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
... |
SELECT date FROM table_17288869_7 WHERE high_rebounds = "Dirk Nowitzki (14)" | On what day did Dirk Nowitzki (14) have a high rebound? | CREATE TABLE table_17288869_7 (date VARCHAR, high_rebounds VARCHAR) |
SELECT DISTINCT label FROM Albums | What are all the labels? | CREATE TABLE Albums (label VARCHAR) |
SELECT "Release price ( USD )" FROM table_63644 WHERE "Frequency" = '3.2 ghz' AND "I/O bus" = '1 × 6.4 gt/s qpi' | What's the release price of a processor that has a frequency of 3.2 ghz and 1 6.4 gt/s qpi I/O? | CREATE TABLE table_63644 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"Turbo" text,
"Cores" real,
"L2 cache" text,
"L3 cache" text,
"I/O bus" text,
"Mult." text,
"Memory" text,
"Voltage" text,
"Socket" text,
"Release date" text,
"Part number(s)" t... |
SELECT COUNT(high_rebounds) FROM table_17288869_7 WHERE high_points = "Josh Howard (19)" | High points earned by Josh Howard (19) resulted in how many high rebounds? | CREATE TABLE table_17288869_7 (high_rebounds VARCHAR, high_points VARCHAR) |
SELECT * FROM Albums WHERE YEAR = 2012 | Find all the albums in 2012. | CREATE TABLE Albums (YEAR VARCHAR) |
SELECT "Website" FROM table_49047 WHERE "License" = 'apache license 2.0' | What is Website, when License is Apache License 2.0? | CREATE TABLE table_49047 (
"Source Version" text,
"Target Version" text,
"Last Release" text,
"License" text,
"Website" text
) |
SELECT high_assists FROM table_17288869_7 WHERE high_rebounds = "Erick Dampier (8)" | Who had the high assists while Erick Dampier (8) had the high rebounds? | CREATE TABLE table_17288869_7 (high_assists VARCHAR, high_rebounds VARCHAR) |
SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = "Solveig" | Find all the stage positions of the musicians with first name "Solveig" | CREATE TABLE Band (id VARCHAR); CREATE TABLE Performance (stageposition VARCHAR, bandmate VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" | Count the number of inpatient hospital admission patients who have neoplasm of uncertain behavior of other lymphatic and hematopoietic tissues/bone marrow transplant as their primary disease. | 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... |
SELECT high_points FROM table_17288869_7 WHERE high_rebounds = "Dirk Nowitzki (13)" | Who had the high points while Dirk Nowitzki (13) had the high rebounds? | CREATE TABLE table_17288869_7 (high_points VARCHAR, high_rebounds VARCHAR) |
SELECT COUNT(*) FROM Songs | How many songs are there? | CREATE TABLE Songs (Id VARCHAR) |
SELECT COUNT("name") FROM table_204_547 | how many competitors competed in the semifinal 2 ? | CREATE TABLE table_204_547 (
id number,
"rank" number,
"lane" number,
"name" text,
"nationality" text,
"time" number,
"notes" text
) |
SELECT record FROM table_17288869_7 WHERE high_points = "Dirk Nowitzki (19)" | What was the final record for the game in which Dirk Nowitzki (19) had the high points? | CREATE TABLE table_17288869_7 (record VARCHAR, high_points VARCHAR) |
SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = "Heilo" | Find all the songs performed by artist with last name "Heilo" | CREATE TABLE Songs (Title VARCHAR, SongId VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, Lastname VARCHAR) |
SELECT AVG("Draws") FROM table_64313 WHERE "Club" = 'mortlake' AND "Wins" < '0' | What is the average number of draws for Mortlake club when they have less than 0 wins? | CREATE TABLE table_64313 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
) |
SELECT championship FROM table_1729366_2 WHERE opponents_in_the_final = "Nathalie Dechy Andy Ram" | Which championship had the final opponents of nathalie dechy andy ram? | CREATE TABLE table_1729366_2 (championship VARCHAR, opponents_in_the_final VARCHAR) |
SELECT COUNT(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.Title = "Flash" | Hom many musicians performed in the song "Flash"? | CREATE TABLE performance (bandmate VARCHAR, songid VARCHAR); CREATE TABLE songs (songid VARCHAR, Title VARCHAR); CREATE TABLE band (id VARCHAR) |
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester... | Which teacher will teach Lyric , Elegy , and Iambus this semester ? | CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... |
SELECT upstream FROM table_17304621_14 WHERE price_tl = "39 TL" | What is the upstream speed of the network that costs 39 tl? | CREATE TABLE table_17304621_14 (upstream VARCHAR, price_tl VARCHAR) |
SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = "Marianne" | Find all the songs produced by artists with first name "Marianne". | CREATE TABLE Songs (Title VARCHAR, SongId VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Band (id VARCHAR, firstname VARCHAR) |
SELECT hp_model FROM table_name_68 WHERE _number_hdd = 1 AND sides = "ds" | I want to know the HP model with a #HDD of 1 of sides of ds | CREATE TABLE table_name_68 (
hp_model VARCHAR,
_number_hdd VARCHAR,
sides VARCHAR
) |
SELECT COUNT(upstream) FROM table_17304621_14 WHERE downstream = "20 Mbit/s" AND bandwidth = "40 GB" | How many upstream speeds are there for downstream of 20 mbit/s and bandwidth of 40 gb? | CREATE TABLE table_17304621_14 (upstream VARCHAR, downstream VARCHAR, bandwidth VARCHAR) |
SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" | Who performed the song named "Badlands"? Show the first name and the last name. | CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "Metamyelocytes" | provide the number of patients whose marital status is widowed and lab test name is metamyelocytes? | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.