context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE tr... | have patient 25523's been tested since 04/2102 for human chorionic gonadotropin? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'human chorionic gonadotropin') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25523) AND STRFTIME('%y-%m', labevents.charttime) >= '2102-04' | mimic_iii |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Find All_Neutral and Team_ID , and visualize them by a bar chart, and show in descending by the names. | SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral DESC | nvbench |
CREATE TABLE table_name_95 (
home_team VARCHAR
) | What did st kilda score at home? | SELECT home_team AS score FROM table_name_95 WHERE home_team = "st kilda" | sql_create_context |
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... | select * from Posts where Body like '%imageshack%' for a user. | SELECT p.Id AS "post_link", p.CreationDate, p.Score FROM Posts AS p WHERE p.OwnerUserId = '##User##' AND p.Body LIKE '%aioobe.se%' | sede |
CREATE TABLE table_8241 (
"Team" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Overall" real
) | How many silver when bronze is 25 and overall is less than 67? | SELECT SUM("Silver") FROM table_8241 WHERE "Bronze" = '25' AND "Overall" < '67' | wikisql |
CREATE TABLE table_name_9 (
color_quality VARCHAR,
relay VARCHAR
) | what is the color quality when the relay is ? | SELECT color_quality FROM table_name_9 WHERE relay = "✓" | sql_create_context |
CREATE TABLE table_19398910_4 (
bout_1 VARCHAR,
bout_5 VARCHAR
) | Which were the bout 1 when the bout 5 was andreev ( rus ) w 5-2? | SELECT bout_1 FROM table_19398910_4 WHERE bout_5 = "Andreev ( RUS ) W 5-2" | sql_create_context |
CREATE TABLE table_64721 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" real
) | Which Catalog has a Date of july 15, 2011? | SELECT AVG("Catalog") FROM table_64721 WHERE "Date" = 'july 15, 2011' | wikisql |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id... | i'd like to know the latest flight from ATLANTA to BOSTON | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTO... | atis |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | on the current hospital encounter how many hours have passed since the first hypertension nos diagnosis of patient 14154? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hypertension nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions... | mimic_iii |
CREATE TABLE table_32844 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the home team's score in the match at Victoria Park? | SELECT "Home team score" FROM table_32844 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | For Spring and Summer what courses meet the MDE requirement ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id... | advising |
CREATE TABLE flight (
velocity INTEGER,
pilot VARCHAR
) | What is the velocity of the pilot named 'Thompson'? | SELECT AVG(velocity) FROM flight WHERE pilot = 'Thompson' | sql_create_context |
CREATE TABLE table_20836 (
"Locale" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot %" text
) | What is the lowest number of losses for teams that lost 52 ends? | SELECT MIN("L") FROM table_20836 WHERE "Ends Lost" = '52' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Find All_Games and Team_ID , and visualize them by a bar chart, and could you display by the x-axis in desc? | SELECT All_Games, Team_ID FROM basketball_match ORDER BY All_Games DESC | nvbench |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE In... | Show the number of accounts opened in each year for all accounts and group by other account details in a group line chart, and sort from high to low by the X-axis. | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details ORDER BY date_account_opened DESC | nvbench |
CREATE TABLE table_59829 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | Which Opponent has a Result of 0-3? | SELECT "Opponent" FROM table_59829 WHERE "Result" = '0-3' | wikisql |
CREATE TABLE customers_cards (
card_id number,
customer_id number,
card_type_code text,
card_number text,
date_valid_from time,
date_valid_to time,
other_card_details text
)
CREATE TABLE accounts (
account_id number,
customer_id number,
account_name text,
other_account_detai... | Show the card type codes and the number of transactions. | SELECT T2.card_type_code, COUNT(*) FROM financial_transactions AS T1 JOIN customers_cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code | spider |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid numbe... | what is last weight of patient 28447 in this month. | SELECT chartevents.valuenum 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 = 28447)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'... | mimic_iii |
CREATE TABLE table_name_70 (
safari VARCHAR,
internet_explorer VARCHAR
) | What is the safari value with a 28.0% internet explorer? | SELECT safari FROM table_name_70 WHERE internet_explorer = "28.0%" | sql_create_context |
CREATE TABLE table_36576 (
"Season" real,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
) | What race was there in the formula one series when there was a test driver? | SELECT "Races" FROM table_36576 WHERE "Series" = 'formula one' AND "Poles" = 'test driver' | wikisql |
CREATE TABLE Patient (
SSN INTEGER,
Name VARCHAR(30),
Address VARCHAR(30),
Phone VARCHAR(30),
InsuranceID INTEGER,
PCP INTEGER
)
CREATE TABLE Affiliated_With (
Physician INTEGER,
Department INTEGER,
PrimaryAffiliation BOOLEAN
)
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFlo... | What are the number of names of patients who made an appointment?, I want to sort by the y axis from high to low. | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(Name) DESC | nvbench |
CREATE TABLE table_18971 (
"High School" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Nickname" text,
"Division" text
) | What year was Skyline High School founded? | SELECT COUNT("Founded") FROM table_18971 WHERE "High School" = 'Skyline' | wikisql |
CREATE TABLE candidate (
candidate_id number,
people_id number,
poll_source text,
date text,
support_rate number,
consider_rate number,
oppose_rate number,
unsure_rate number
)
CREATE TABLE people (
people_id number,
sex text,
name text,
date_of_birth text,
height nu... | What are the names of candidates who have a lower support rate than oppose rate? | SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate | spider |
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
) | What are the names of players who train between 500 and 1500 hours? | SELECT pname FROM player WHERE hs BETWEEN 500 AND 1500 | spider |
CREATE TABLE table_7696 (
"Rank" text,
"Runs" text,
"Player" text,
"Average" text,
"Season" text
) | How many runs were ranked 4? | SELECT "Runs" FROM table_7696 WHERE "Rank" = '4' | wikisql |
CREATE TABLE table_name_64 (
d_44 VARCHAR,
d_43 VARCHAR
) | What is the D44 when D43 is R 14? | SELECT d_44 FROM table_name_64 WHERE d_43 = "r 14" | sql_create_context |
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... | give the number of patients born before the year 2152 who had procedure titled left heart cardiac cath. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2152" AND procedures.short_title = "Left heart cardiac cath" | mimicsql_data |
CREATE TABLE table_203_98 (
id number,
"title" text,
"year" number,
"director" text,
"budget" text,
"gross (worldwide)" text,
"notes" text
) | which morgan creek film grossed the most worldwide ? | SELECT "title" FROM table_203_98 ORDER BY "gross (worldwide)" DESC LIMIT 1 | squall |
CREATE TABLE table_76313 (
"University" text,
"Location" text,
"Enrollment" real,
"Founded" real,
"Religious affiliation" text,
"Athletics nickname" text,
"School colors" text
) | What was the religious affiliation for the athletics nicknamed lords/ladies? | SELECT "Religious affiliation" FROM table_76313 WHERE "Athletics nickname" = 'lords/ladies' | wikisql |
CREATE TABLE table_name_3 (
qual VARCHAR,
laps INTEGER
) | What is the Qual with less than 68 laps? | SELECT qual FROM table_name_3 WHERE laps < 68 | sql_create_context |
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | what is admission type and days of hospital stay of subject id 7273? | SELECT demographic.admission_type, demographic.days_stay FROM demographic WHERE demographic.subject_id = "7273" | mimicsql_data |
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order_status text,
order_date time,
order_details text
)
CREATE TABLE order_items (
order_id number,
product_id number,
order_quantity text
)
CREATE TABLE customer_addresses (
customer_id number,
address_id num... | Find the names of customers who never placed an order. | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id | spider |
CREATE TABLE Video_Games (
GameID INTEGER,
GName VARCHAR(40),
GType VARCHAR(40)
)
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
Hours_Played INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Ma... | A bar chart for what are the number of the last names for all scholarship students?, and rank total number in desc order. | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName ORDER BY COUNT(LName) DESC | nvbench |
CREATE TABLE pilot (
pilot_id number,
name text,
age 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,
aircraft_movements ... | What are the total number of Domestic Passengers of airports that contain the word 'London'. | SELECT SUM(domestic_passengers) FROM airport WHERE airport_name LIKE "%London%" | spider |
CREATE TABLE table_20446 (
"Information" text,
"Akimel A-al The name is Tohono Oodham for children of the river" text,
"Altade\u00f1a" text,
"Aprende" text,
"Centennial" text,
"Kyrene MS" text,
"del Pueblo" text
) | Name the centennial for 1992 akimel | SELECT "Centennial" FROM table_20446 WHERE "Akimel A-al The name is Tohono Oodham for children of the river" = '1992' | wikisql |
CREATE TABLE table_20854943_2 (
loa__metres_ VARCHAR,
sail_number VARCHAR
) | What are the LOA (metres) of boat with sail number M10? | SELECT loa__metres_ FROM table_20854943_2 WHERE sail_number = "M10" | sql_create_context |
CREATE TABLE Teachers (
first_name VARCHAR,
last_name VARCHAR
) | Find the first names and last names of teachers in alphabetical order of last name. | SELECT first_name, last_name FROM Teachers ORDER BY last_name | sql_create_context |
CREATE TABLE table_name_22 (
year INTEGER,
result VARCHAR
) | What year was the game that ended with a score of 24-14? | SELECT AVG(year) FROM table_name_22 WHERE result = "24-14" | sql_create_context |
CREATE TABLE table_name_12 (
position VARCHAR,
pick__number VARCHAR,
player VARCHAR
) | Which Position has a Pick # smaller than 23, and a Player of garrett sutherland? | SELECT position FROM table_name_12 WHERE pick__number < 23 AND player = "garrett sutherland" | sql_create_context |
CREATE TABLE table_46191 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | what is the place when the score is 76-69-71-70=286? | SELECT "Place" FROM table_46191 WHERE "Score" = '76-69-71-70=286' | wikisql |
CREATE TABLE table_27603010_14 (
points VARCHAR,
team__number1 VARCHAR
) | What was Team 1 Junior's points? | SELECT points FROM table_27603010_14 WHERE team__number1 = "Junior" | sql_create_context |
CREATE TABLE table_24225238_1 (
supporting_actress VARCHAR,
film VARCHAR
) | Who was the supporting actress in 'For Whom the Bell Tolls'? | SELECT supporting_actress FROM table_24225238_1 WHERE film = "For Whom the Bell Tolls" | sql_create_context |
CREATE TABLE table_5316 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
) | On May 9 after Game 3, what was the Opponent? | SELECT "Opponent" FROM table_5316 WHERE "Game" > '3' AND "Date" = 'may 9' | wikisql |
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... | since 3 years ago, what are the three most frequently prescribed drugs to hypertension female patients aged 40s within the same hospital visit after they have been diagnosed with hypertension? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypertension' A... | eicu |
CREATE TABLE table_204_71 (
id number,
"rank" number,
"heat" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
) | who finished directly before akinremi ? | SELECT "name" FROM table_204_71 WHERE "rank" = (SELECT "rank" FROM table_204_71 WHERE "name" = 'christy akinremi') - 1 | squall |
CREATE TABLE diagnoses (
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
)
C... | what is the number of patients whose age is less than 55 and drug code is warf1? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "55" AND prescriptions.formulary_drug_cd = "WARF1" | mimicsql_data |
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_labitems (
row_id number,
itemid number,
label te... | show me the top five most frequent diagnoses? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE t1.c1 <= 5) | mimic_iii |
CREATE TABLE table_10574 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Replaced by" text,
"Date of appointment" text
) | I want the outgoing manager for craig brewster | SELECT "Outgoing manager" FROM table_10574 WHERE "Replaced by" = 'craig brewster' | wikisql |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Activity (
actid INTEGER,
... | Show the proportion of the number of ranks for each rank. | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank | nvbench |
CREATE TABLE table_49715 (
"Model number" text,
"Frequency" text,
"L2 cache" text,
"Mult." text,
"Voltage" text,
"Socket" text
) | What is Model Number, when Voltage is 2.0V, and when Frequency is 350 mhz? | SELECT "Model number" FROM table_49715 WHERE "Voltage" = '2.0v' AND "Frequency" = '350 mhz' | wikisql |
CREATE TABLE Maintenance_Contracts (
maintenance_contract_id INTEGER,
maintenance_contract_company_id INTEGER,
contract_start_date DATETIME,
contract_end_date DATETIME,
other_contract_details VARCHAR(255)
)
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_... | which parts have more than 2 faults? Show the part name and id. | SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id | nvbench |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | hmm.. what was patient 96937's first sodium since 109 months ago? | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96937) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-109 mon... | mimic_iii |
CREATE TABLE table_9192 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term of office" text
) | What party was the member peter howson part of? | SELECT "Party" FROM table_9192 WHERE "Member" = 'peter howson' | wikisql |
CREATE TABLE table_9999 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What Tournament had a Winning score of 6 (73-68-72-69=282)? | SELECT "Tournament" FROM table_9999 WHERE "Winning score" = '–6 (73-68-72-69=282)' | wikisql |
CREATE TABLE table_77149 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | Which country is Pete Cooper, who made $816, from? | SELECT "Country" FROM table_77149 WHERE "Money ( $ )" = '816' AND "Player" = 'pete cooper' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 在团伙中叫柏子萱的成员最常去的医院排序情况是什么样的? | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '柏子萱' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_66099 (
"Continent" text,
"Location" text,
"City" text,
"Date" text,
"Year" real
) | What year was the expansion in the city of San Juan? | SELECT COUNT("Year") FROM table_66099 WHERE "City" = 'san juan' | wikisql |
CREATE TABLE table_2849652_2 (
sport VARCHAR
) | How many first tournaments are associated with bowling? | SELECT COUNT(1 AS st_tournament) FROM table_2849652_2 WHERE sport = "Bowling" | sql_create_context |
CREATE TABLE table_35692 (
"Category" text,
"Type" text,
"Attribute" text,
"Bubbles" text,
"Cancelable" text
) | Which bubbles has an atribute of onlostpointercapture? | SELECT "Bubbles" FROM table_35692 WHERE "Attribute" = 'onlostpointercapture' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is the number of patients whose ethnicity is white and procedure short title is dx ultrasound-heart? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE" AND procedures.short_title = "Dx ultrasound-heart" | mimicsql_data |
CREATE TABLE table_name_51 (
year VARCHAR,
finish VARCHAR,
chassis VARCHAR,
team VARCHAR
) | What year did Team of Andretti Green Racing have a finish smaller than 8 with a Dallara chassis? | SELECT year FROM table_name_51 WHERE chassis = "dallara" AND team = "andretti green racing" AND finish < 8 | sql_create_context |
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE competition (
Competi... | Give me a histogram for what are the types of competition and number of competitions for that type? | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type | nvbench |
CREATE TABLE table_60495 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the to par for t10 and Colin Montgomerie? | SELECT "To par" FROM table_60495 WHERE "Place" = 't10' AND "Player" = 'colin montgomerie' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Which morning classes are for RCCORE 410 ? | SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'RCCORE' AND c... | advising |
CREATE TABLE table_29367 (
"Vertical" real,
"Horizontal" real,
"Aspect ratio" text,
"Pixel aspect ratio" text,
"Scanning" text,
"Frame rate ( Hz )" text
) | Name the aspect ratio for smpte 259m and interlaced scanning | SELECT "Aspect ratio" FROM table_29367 WHERE "Pixel aspect ratio" = 'SMPTE 259M' AND "Scanning" = 'interlaced' | wikisql |
CREATE TABLE torrents (
groupname text,
totalsnatched number,
artist text,
groupyear number,
releasetype text,
groupid number,
id number
)
CREATE TABLE tags (
index number,
id number,
tag text
) | Which artist/group has the highest average download of songs? | SELECT artist FROM torrents GROUP BY artist ORDER BY AVG(totalsnatched) DESC LIMIT 1 | whatcdhiphop |
CREATE TABLE member (
member_id number,
card_number text,
name text,
hometown text,
level number
)
CREATE TABLE branch (
branch_id number,
name text,
open_year text,
address_road text,
city text,
membership_amount text
)
CREATE TABLE membership_register_branch (
member_... | What are the minimum and maximum membership amounts for all branches that either opened in 2011 or are located in London? | SELECT MIN(membership_amount), MAX(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London' | spider |
CREATE TABLE table_204_696 (
id number,
"issue" number,
"volume" number,
"title" text,
"main feature story" text,
"first/early appearance story/stories" text,
"release date" text
) | which has the largest volume number ? | SELECT "title" FROM table_204_696 ORDER BY "volume" DESC LIMIT 1 | squall |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 根据不同的入院诊断疾病编码和科室编码,列出所有医疗就诊记录中患者在医院7880116中的平均年龄有多大? | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7880116' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD | css |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | What is the number of patients discharged to psychiatric facility-partial hospitalization who had a (aorto)coronary bypass of three coronary arteries procedure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.long_title = "(Aorto)coronary bypass of three coronary arteries" | mimicsql_data |
CREATE TABLE table_73286 (
"Season" real,
"Episode" real,
"Episode Summary" text,
"Premier date" text,
"External Link" text,
"Coach" text
) | Who was the coach for episode 15? | SELECT "Coach" FROM table_73286 WHERE "Episode" = '15' | wikisql |
CREATE TABLE table_71518 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which of the events only lasted no more than 0:55? | SELECT "Event" FROM table_71518 WHERE "Time" = '0:55' | wikisql |
CREATE TABLE table_79160 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
) | Which Position has Goals For of 52, and Goals Against larger than 70? | SELECT MAX("Position") FROM table_79160 WHERE "Goals For" = '52' AND "Goals Against" > '70' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
... | how many current patients aged 30s are there? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 30 AND 39 | eicu |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | Create a bar chart showing how many allergytype across allergytype, and show Y from low to high order. | SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(AllergyType) | nvbench |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | Between EECS 540 and EECS 628 ; which is the easiest ? | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 540 OR course.number = 628) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... | advising |
CREATE TABLE table_name_46 (
league_goals INTEGER,
fa_cup_apps VARCHAR,
total_apps VARCHAR
) | What is the lowest league goals that have 0 as the FA Cup Apps, with 1 (3) as totals apps? | SELECT MIN(league_goals) FROM table_name_46 WHERE fa_cup_apps = "0" AND total_apps = "1 (3)" | sql_create_context |
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 admitted before the year 2165 and diagnosed with hepatitis, unspecified. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2165" AND diagnoses.long_title = "Hepatitis, unspecified" | mimicsql_data |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | what is the name of the medicine that was prescribed to patient 005-77687 for the first time through the dialysis route in the last month? | 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 = '005-77687')) AND medication.routeadmin = 'dialysis' AND DATETIME(me... | eicu |
CREATE TABLE table_name_5 (
trainer VARCHAR,
winner VARCHAR
) | Who is the trainer of the winner skylighter? | SELECT trainer FROM table_name_5 WHERE winner = "skylighter" | sql_create_context |
CREATE TABLE table_name_37 (
game VARCHAR,
team VARCHAR
) | What is the game with the golden state warriors? | SELECT game FROM table_name_37 WHERE team = "golden state warriors" | sql_create_context |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEP... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_name_21 (
date VARCHAR,
race VARCHAR
) | On what date did Contac 12 Hours of Sebring take place? | SELECT date FROM table_name_21 WHERE race = "contac 12 hours of sebring" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 在医疗就诊13021515758中,哪些编号的检验报告单是由名称不包含手术的科室开出的 | SELECT jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '13021515758' AND NOT jybgb.KSMC LIKE '%手术%' | css |
CREATE TABLE table_7794 (
"Year" real,
"Track" text,
"50 cc" text,
"125 cc" text,
"Report" text
) | What's the track for 1978? | SELECT "Track" FROM table_7794 WHERE "Year" = '1978' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | 患者朱湛英曾经去过什么地方看病? | SELECT hz_info_mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YL... | css |
CREATE TABLE table_name_98 (
april VARCHAR,
record VARCHAR,
points VARCHAR
) | How many days in April has a record of 42 22 12 3, and less than 99 points? | SELECT COUNT(april) FROM table_name_98 WHERE record = "42–22–12–3" AND points < 99 | sql_create_context |
CREATE TABLE table_67299 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | What companyw as the constructor when the Time/Retired was collision, and a Grid of 11? | SELECT "Constructor" FROM table_67299 WHERE "Time/Retired" = 'collision' AND "Grid" = '11' | wikisql |
CREATE TABLE table_42113 (
"Source" text,
"Date" text,
"Clinton" text,
"Obama" text,
"Undecided" text
) | When has a Source of rasmussen reports? | SELECT "Date" FROM table_42113 WHERE "Source" = 'rasmussen reports' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 按照科室编码和入院诊断疾病编码不同的标准,在医院1153407就诊的患者们所有的医疗就诊记录中的平均年龄是多些? | SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '1153407' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '1153407' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.IN_... | css |
CREATE TABLE table_1940144_1 (
urban_area VARCHAR,
population_2011 VARCHAR
) | Which urban area has a 2011 population of 5010? | SELECT urban_area FROM table_1940144_1 WHERE population_2011 = 5010 | sql_create_context |
CREATE TABLE table_204_843 (
id number,
"volume" number,
"year" text,
"names" text,
"articles" number,
"pages" number,
"images" number,
"maps" number,
"number of copies" number
) | what is the difference in years between the first volume published and the 13th volume published ? | SELECT ABS((SELECT "year" FROM table_204_843 WHERE "volume" = 1) - (SELECT "year" FROM table_204_843 WHERE "volume" = 13)) | squall |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | Visualize the title and their total smallest ratings of the movie using a bar chart, show bar in desc order. | SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY T2.title DESC | nvbench |
CREATE TABLE diagnoses (
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
)
C... | what is the number of patients whose age is less than 68 and lab test fluid is joint fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "68" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_name_56 (
round VARCHAR,
position VARCHAR,
college VARCHAR
) | What round has a position of F/C from Iowa College? | SELECT round FROM table_name_56 WHERE position = "f/c" AND college = "iowa" | sql_create_context |
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, a bar chart shows the distribution of name and the sum of manufacturer , and group by attribute name, I want to show in desc by the x axis. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | Return a pie chart on what is the average base price of different bed type? List bed type and average base price. | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType | nvbench |
CREATE TABLE table_40505 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the smallest drawn with a position bigger than 10 and a played less than 20? | SELECT MIN("Drawn") FROM table_40505 WHERE "Position" > '10' AND "Played" < '20' | wikisql |
CREATE TABLE table_21795650_1 (
points VARCHAR,
series VARCHAR
) | What is the point total for the Formula Renault 2.0 Italy series? | SELECT COUNT(points) FROM table_21795650_1 WHERE series = "Formula Renault 2.0 Italy" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.