context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_... | Of the courses I 've taken , are any among the hardest in the ARMENIAN department ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'ARMENIAN' AND program_course.workload = (SELECT ... | advising |
CREATE TABLE table_18116 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | what is the earliest first elected with the results re-elected in the district south carolina 3? | SELECT MAX("First elected") FROM table_18116 WHERE "Results" = 'Re-elected' AND "District" = 'South Carolina 3' | wikisql |
CREATE TABLE domain (
did int,
name varchar
)
CREATE TABLE writes (
aid int,
pid int
)
CREATE TABLE keyword (
keyword varchar,
kid int
)
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE conference (
cid int,
... | return me the journal, which have the most number of papers by ' H. V. Jagadish ' . | SELECT journal.name FROM author, journal, publication, writes WHERE author.name = 'H. V. Jagadish' AND publication.jid = journal.jid AND writes.aid = author.aid AND writes.pid = publication.pid GROUP BY journal.name ORDER BY COUNT(DISTINCT (publication.title)) DESC LIMIT 1 | academic |
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 procedures (
... | Get me the number of patients born before 2180 who had a phosphate urine lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2180" AND lab.label = "Phosphate, Urine" | mimicsql_data |
CREATE TABLE table_15621965_18 (
player VARCHAR,
school_club_team VARCHAR
) | WHO IS THE PLAYER(S) ON THE ROSTER FROM SCHOOL/CLUB TEAM ARIZONA? | SELECT player FROM table_15621965_18 WHERE school_club_team = "Arizona" | sql_create_context |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE month (
... | i need flight numbers for those flights departing on thursday before 800 from OAKLAND going to SALT LAKE CITY | SELECT DISTINCT flight_id FROM flight WHERE (((departure_time < 800 AND flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 24 AND DATE_DAYalias0.month_number = 5 AND DATE_DAYal... | atis |
CREATE TABLE table_16729076_1 (
attendance INTEGER,
game_site VARCHAR
) | what is the attendance where the game site is kingdome? | SELECT MIN(attendance) FROM table_16729076_1 WHERE game_site = "Kingdome" | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Can I take both HBEHED 600 and HBEHED 620 at the same time ? | SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_offering AS COURSE_OFFERING_0, course_offering AS COURSE_OFFERING_1, course_prerequisite WHERE COURSE_OFFERING_1.semester = COURSE_OFFERING_0.semester AND COURSE_0.course_id = COURSE_OFFERING_0.course_id AND COURSE_0.department = 'HBEHED' AND COURS... | advising |
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,... | how many patients are diagnosed with the history of tobacco use and tested under the lab category blood gas? | 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.short_title = "History of tobacco use" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
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,... | 检验报告单为编码38516022248的报告机构代码是什么?报告机构名称叫什么? | SELECT jybgb.BGJGDM, jybgb.BGJGMC FROM jybgb WHERE jybgb.BGDH = '38516022248' | css |
CREATE TABLE accelerator_compatible_browser (
accelerator_id int,
browser_id int,
compatible_since_year int
)
CREATE TABLE Web_client_accelerator (
id int,
name text,
Operating_system text,
Client text,
Connection text
)
CREATE TABLE browser (
id int,
name text,
market_shar... | A pie chart showing the proportion of the number of browsers for each accelerator. | SELECT T3.name, COUNT(T3.name) FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN Web_client_accelerator AS T3 ON T1.accelerator_id = T3.id GROUP BY T3.name | nvbench |
CREATE TABLE table_78660 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | Which venue has more than 19 against? | SELECT "Venue" FROM table_78660 WHERE "Against" > '19' | wikisql |
CREATE TABLE table_19166 (
"State" text,
"Highest point" text,
"Highest elevation" text,
"Lowest point" text,
"Lowest elevation" text,
"Mean elevation" text
) | what's the highest point with lowest point being belle fourche river at south dakota border | SELECT "Highest point" FROM table_19166 WHERE "Lowest point" = 'Belle Fourche River at South Dakota border' | wikisql |
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... | count the number of patients whose diagnoses icd9 code is 78659 and lab test category is blood gas? | 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 = "78659" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
... | Top SO users from China. | SELECT Users.Id, Users.DisplayName, COUNT(Posts.Id), Posts.PostTypeId FROM Users LEFT JOIN Posts ON Users.Id = Posts.OwnerUserId WHERE Posts.Id IS NULL OR Posts.PostTypeId = 1 GROUP BY Users.Id, Users.DisplayName, Posts.PostTypeId HAVING COUNT(Posts.Id) = 0 LIMIT 100 | sede |
CREATE TABLE table_22852 (
"Year" real,
"Worldwide" real,
"Africa" real,
"America" real,
"Asia" real,
"Australia" real,
"Europe" real
) | How many members did Europe have the year that America had 403892? | SELECT "Europe" FROM table_22852 WHERE "America" = '403892' | wikisql |
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
) | What are the titles of all movies that have rating star is between 3 and 5? | SELECT T2.title FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid WHERE T1.stars BETWEEN 3 AND 5 | spider |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | Python posts with minimum score of 15. | SELECT Title, Body, CreationDate, Id AS "post_link", Tags, Score FROM Posts WHERE PostTypeId IN (1) AND CreationDate > '2020-01-01' AND CreationDate < '2020-12-31' AND Tags LIKE ('%python%') AND Score >= 15 ORDER BY CreationDate DESC | sede |
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 were the three medicines most frequently prescribed until 3 years ago? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE table_16729071_1 (
result VARCHAR,
opponent VARCHAR
) | How did the game end against the New Orleans Saints? | SELECT result FROM table_16729071_1 WHERE opponent = "New Orleans Saints" | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | Final outcome of all questions posted. | SELECT SUM(CASE WHEN PostHistoryTypeId = 10 THEN 1 ELSE 0 END), SUM(CASE WHEN PostHistoryTypeId = 11 THEN 1 ELSE 0 END) FROM PostHistory | sede |
CREATE TABLE table_71126 (
"Year" real,
"Entrant" text,
"Class" text,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Rank" text,
"Points" real
) | What engine what in the vehicle when adt champion racing ranked in 1st place? | SELECT "Engine" FROM table_71126 WHERE "Rank" = '1st' AND "Entrant" = 'adt champion racing' | wikisql |
CREATE TABLE table_name_87 (
years_in_toronto VARCHAR,
nationality VARCHAR,
school_club_team VARCHAR
) | What year is United States school/club team from Arkansas play in Toronto | SELECT years_in_toronto FROM table_name_87 WHERE nationality = "united states" AND school_club_team = "arkansas" | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | what's the date of patient 61527's birth? | SELECT patients.dob FROM patients WHERE patients.subject_id = 61527 | mimic_iii |
CREATE TABLE table_204_445 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | after the championship in the hague , netherlands , where were the next championship held ? | SELECT "venue" FROM table_204_445 WHERE id = (SELECT id FROM table_204_445 WHERE "venue" = 'the hague, netherlands') + 1 | squall |
CREATE TABLE table_name_61 (
floors VARCHAR,
location VARCHAR,
name VARCHAR
) | Which Floors have a Location of ljubljana, and a Name of tr3? | SELECT floors FROM table_name_61 WHERE location = "ljubljana" AND name = "tr3" | sql_create_context |
CREATE TABLE table_204_27 (
id number,
"name" text,
"position" text,
"year" text,
"league\napps" number,
"league\ngoals" number,
"total\napps" number,
"total\ngoals" number,
"notes" text
) | how many total goals did kit lawlor score from 1950 to 1954 ? | SELECT "total\ngoals" FROM table_204_27 WHERE "name" = 'kit lawlor' AND "year" = '1950-1954' | squall |
CREATE TABLE table_name_6 (
tie_no VARCHAR,
away_team VARCHAR
) | What is the tie no when scunthorpe united was the away team? | SELECT tie_no FROM table_name_6 WHERE away_team = "scunthorpe united" | sql_create_context |
CREATE TABLE table_name_52 (
date VARCHAR,
opposing_team VARCHAR
) | What was the date of the match against western province? | SELECT date FROM table_name_52 WHERE opposing_team = "western province" | sql_create_context |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE... | does AA fly from PHILADELPHIA to SAN FRANCISCO | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.airline_code = 'AA') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to_airport = AIRP... | atis |
CREATE TABLE Locations (
Location_ID VARCHAR,
Address VARCHAR
)
CREATE TABLE Tourist_Attractions (
Name VARCHAR,
Location_ID VARCHAR,
How_to_Get_There VARCHAR
) | What are the names of tourist attractions that can be reached by walk or is at address 660 Shea Crescent? | SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = "660 Shea Crescent" OR T2.How_to_Get_There = "walk" | sql_create_context |
CREATE TABLE table_name_60 (
series_ep VARCHAR,
episode VARCHAR,
segment_a VARCHAR
) | What is the series episode number that is larger than 262 and has a Segment A entry of Aluminium s canoe? | SELECT series_ep FROM table_name_60 WHERE episode > 262 AND segment_a = "aluminium s canoe" | sql_create_context |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_descriptio... | what flights depart BALTIMORE on friday and arrive in SAN FRANCISCO by 2000 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <... | atis |
CREATE TABLE table_56419 (
"Season" text,
"Cup FinalDate" text,
"WinningTeam" text,
"Score" text,
"LosingTeam" text,
"Cup Final Attendance" text
) | What was the winning team with the 8,132 final attendance? | SELECT "WinningTeam" FROM table_56419 WHERE "Cup Final Attendance" = '8,132' | wikisql |
CREATE TABLE table_44278 (
"Year" real,
"Name" text,
"Field" text,
"State" text,
"Country" text
) | What was the average year when shri. shambu nath khajuria won the padma shri awards? | SELECT AVG("Year") FROM table_44278 WHERE "Name" = 'shri. shambu nath khajuria' | wikisql |
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
) | What is the reviewer name, film title, movie rating, and rating date for every movie ordered by reviewer name, movie title, then finally rating? | SELECT T3.name, T2.title, T1.stars, T1.ratingdate FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid JOIN reviewer AS T3 ON T1.rid = T3.rid ORDER BY T3.name, T2.title, T1.stars | spider |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,... | All comments by a given user. | SELECT Id, PostId AS "post_link", Text, Score, CreationDate, UserId AS "user_link" FROM Comments WHERE UserId = '##uid?2129##' ORDER BY CreationDate DESC | sede |
CREATE TABLE table_9337 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
) | Who was the home team with a score of 101-93? | SELECT "Home team" FROM table_9337 WHERE "Score" = '101-93' | wikisql |
CREATE TABLE table_17142 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | Which player had a height of 6-0? | SELECT "Player" FROM table_17142 WHERE "Height in Ft." = '6-0' | wikisql |
CREATE TABLE table_27700530_10 (
record VARCHAR,
high_points VARCHAR
) | What is the record when jameer nelson (19) had the high points? | SELECT record FROM table_27700530_10 WHERE high_points = "Jameer Nelson (19)" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 出院时诊断的疾病编号及名称,在医疗就诊78262122998中是什么? | SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '78262122998' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '78262122998' | css |
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... | 范清宁这位患者自18.9.12起,到19.7.1止,看病从医保的个人账户总共支付了多少金额 | SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '范清宁' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2018-09-12' AND '2019-07-01' | css |
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 was the first time that patient 90917 came into the hospital until 2 years ago? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 90917 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_36475 (
"Year" real,
"NFL Team" text,
"Position" text,
"Team Defense Rank" real,
"Team Performance" text
) | What was the position of the player whose team lost super bowl xxv before 1992, with a team defense rank larger than 3? | SELECT "Position" FROM table_36475 WHERE "Team Defense Rank" > '3' AND "Year" < '1992' AND "Team Performance" = 'lost super bowl xxv' | wikisql |
CREATE TABLE table_31195 (
"Skip (Club)" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real
) | When 39 is the amount of ends won who is the skip (club)? | SELECT "Skip (Club)" FROM table_31195 WHERE "Ends Won" = '39' | wikisql |
CREATE TABLE table_name_17 (
competition VARCHAR,
score VARCHAR,
result VARCHAR
) | What is the Competition with a Score of 1 0, and a Result with 3 0? | SELECT competition FROM table_name_17 WHERE score = "1–0" AND result = "3–0" | sql_create_context |
CREATE TABLE table_76834 (
"Name" text,
"Took Office" text,
"Left Office" text,
"President" text,
"Party" text
) | What is Left Office, when Took Office is 2006? | SELECT "Left Office" FROM table_76834 WHERE "Took Office" = '2006' | wikisql |
CREATE TABLE table_16286 (
"Rnd" text,
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
) | Which rounds were held on August 9? | SELECT "Rnd" FROM table_16286 WHERE "Date" = 'August 9' | wikisql |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ tim... | 列出患者30900247入院科室名称在医院7528776中不包含青光眼的住院有什么就诊记录? | SELECT * FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb... | css |
CREATE TABLE table_name_44 (
height_in_ft VARCHAR,
years_for_rockets VARCHAR
) | What is the Height for Years of Rockets of 2005-06? | SELECT height_in_ft FROM table_name_44 WHERE years_for_rockets = "2005-06" | sql_create_context |
CREATE TABLE table_49249 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
) | Who is the quarterback for Arkansas State? | SELECT "Player" FROM table_49249 WHERE "Position" = 'quarterback' AND "College" = 'arkansas state' | wikisql |
CREATE TABLE table_name_38 (
date VARCHAR,
opponent VARCHAR
) | When was Pablo And jar the opponent? | SELECT date FROM table_name_38 WHERE opponent = "pablo andújar" | sql_create_context |
CREATE TABLE airlines (
alid number,
name text,
iata text,
icao text,
callsign text,
country text,
active text
)
CREATE TABLE routes (
rid number,
dst_apid number,
dst_ap text,
src_apid number,
src_ap text,
alid number,
airline text,
codeshare text
)
CREATE ... | How many routes does American Airlines operate? | SELECT COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' | spider |
CREATE TABLE table_105344_2 (
seat_factor VARCHAR,
year VARCHAR
) | What percentage of seats were filled in 2006? | SELECT seat_factor FROM table_105344_2 WHERE year = 2006 | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me the comparison about School_ID over the ACC_Regular_Season by a bar chart. | SELECT ACC_Regular_Season, School_ID FROM basketball_match | nvbench |
CREATE TABLE table_name_90 (
score VARCHAR,
home VARCHAR
) | What is the score of the game where real espana was the home team? | SELECT score FROM table_name_90 WHERE home = "real espana" | sql_create_context |
CREATE TABLE table_204_433 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text
) | which nation was the only one with two top 3 finishers ? | SELECT "nationality" FROM table_204_433 WHERE id <= 3 GROUP BY "nationality" HAVING COUNT(*) = 2 | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | give me the number of patients whose year of death is less than or equal to 2165 and item id is 50967? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2165.0" AND lab.itemid = "50967" | mimicsql_data |
CREATE TABLE table_63328 (
"Restaurant Name" text,
"Original Name" text,
"Location" text,
"Chef" text,
"Designer" text,
"Still Open?" text
) | What designer has a restaurant named The Citizen? | SELECT "Designer" FROM table_63328 WHERE "Restaurant Name" = 'the citizen' | wikisql |
CREATE TABLE table_name_91 (
venue VARCHAR,
competition VARCHAR
) | Which venue has a Competition of 2008 myanmar grand royal challenge cup? | SELECT venue FROM table_name_91 WHERE competition = "2008 myanmar grand royal challenge cup" | sql_create_context |
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
)
... | calculate the average age of male patients who have stayed in hospital for 27 days. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay = "27" | mimicsql_data |
CREATE TABLE table_32040 (
"Round" text,
"Date(s)" text,
"Clubs from the previous round" text,
"Clubs involved" real,
"Fixtures" real
) | When 4 clubs are involved, what is the average number of fixtures? | SELECT AVG("Fixtures") FROM table_32040 WHERE "Clubs involved" = '4' | wikisql |
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,
... | In Adv Material Struct , which courses meet the PreMajor need ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Adv Material Struct%' OR course.description LIKE '%Adv Material Struct%' OR course.name LIKE '%A... | advising |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE ... | i would like to find a flight from CHARLOTTE NORTH CAROLINA to LAS VEGAS i would like a stopover in ST. LOUIS | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND ... | atis |
CREATE TABLE table_name_53 (
tournament VARCHAR,
outcome VARCHAR,
opponent VARCHAR
) | Which tournament has an Outcome of winner, and a Opponent of dia evtimova? | SELECT tournament FROM table_name_53 WHERE outcome = "winner" AND opponent = "dia evtimova" | sql_create_context |
CREATE TABLE table_name_89 (
year VARCHAR,
slogan VARCHAR
) | What year has the wild side of soccer! as the slogan? | SELECT year FROM table_name_89 WHERE slogan = "the wild side of soccer!" | sql_create_context |
CREATE TABLE school (
Denomination VARCHAR
) | Please show different denominations and the corresponding number of schools in descending order. | SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC | sql_create_context |
CREATE TABLE song (
artist_name VARCHAR,
f_id VARCHAR
)
CREATE TABLE files (
f_id VARCHAR,
duration VARCHAR
) | What is the name of the artist who produced the shortest song? | SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id = T2.f_id ORDER BY T2.duration LIMIT 1 | sql_create_context |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fl... | i'd like to fly from BOSTON to FORT WORTH | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'FORT WO... | atis |
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 locations (
LOCAT... | For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, and order from high to low by the x axis please. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_40793 (
"Tournament" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is 2007, when 2003 is 1R? | SELECT "2007" FROM table_40793 WHERE "2003" = '1r' | wikisql |
CREATE TABLE table_46395 (
"Rank" real,
"Player" text,
"Club(s)" text,
"Year(s)" text,
"U-17 Caps" real
) | What is the rank of Club Valencia with a U-17 Caps of 20? | SELECT COUNT("Rank") FROM table_46395 WHERE "Club(s)" = 'valencia' AND "U-17 Caps" = '20' | wikisql |
CREATE TABLE table_67251 (
"Institution" text,
"Location" text,
"Nickname" text,
"Current Conference" text,
"Classification" text
) | Post University has what nickname? | SELECT "Nickname" FROM table_67251 WHERE "Institution" = 'post university' | wikisql |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | 那个在2001年11月11日到15年3月7日这段时间里,16229426病患的全部检察结果指标记录的检测人为66553479的检查指标流水号是多少? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz... | css |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | did patient 006-181433 get a lab test during the current hospital visit. | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433' AND patient.hospitaldischargetime IS NULL)) | eicu |
CREATE TABLE table_name_25 (
date VARCHAR,
course VARCHAR
) | When did the course Vasto to Campitello Matese took place? | SELECT date FROM table_name_25 WHERE course = "vasto to campitello matese" | sql_create_context |
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
)
... | how many black/cape verdean ethnic background patients have diagnoses icd9 code 1536? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND diagnoses.icd9_code = "1536" | mimicsql_data |
CREATE TABLE table_name_72 (
score VARCHAR,
player VARCHAR
) | What was Jim Colbert's score? | SELECT score FROM table_name_72 WHERE player = "jim colbert" | sql_create_context |
CREATE TABLE table_17214 (
"Round" real,
"Overall" text,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
) | How many positions did player Ben Harpur play? | SELECT COUNT("Position") FROM table_17214 WHERE "Player" = 'Ben Harpur' | wikisql |
CREATE TABLE table_18763 (
"Season" text,
"Timeslot" text,
"Season Premiere" text,
"Season Finale" text,
"Episodes" real,
"TV Season" text,
"Ranking" text,
"Viewers (in millions)" text
) | How many times did the 2nd season have a finale? | SELECT COUNT("Season Finale") FROM table_18763 WHERE "Season" = '2nd' | wikisql |
CREATE TABLE table_73043 (
"Position" real,
"Gymnast" text,
"Floor" text,
"Pommel Horse" text,
"Rings" text,
"Vault" text,
"Parallel Bars" text,
"Horizontal Bar" text,
"Total" text
) | If the horizontal bar is n/a and the floor is 14.175, what is the number for the parallel bars? | SELECT "Parallel Bars" FROM table_73043 WHERE "Floor" = '14.175' AND "Horizontal Bar" = 'N/A' | wikisql |
CREATE TABLE all_documents (
document_id number,
date_stored time,
document_type_code text,
document_name text,
document_description text,
other_details text
)
CREATE TABLE ref_calendar (
calendar_date time,
day_number number
)
CREATE TABLE document_locations (
document_id number,
... | How many locations are listed in the database? | SELECT COUNT(*) FROM ref_locations | spider |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city v... | What ANTHRBIO 500 -level courses award 12 credits ? | SELECT DISTINCT department, name, number FROM course WHERE credits = 12 AND department = 'ANTHRBIO' AND number < 500 + 100 AND number >= 500 | advising |
CREATE TABLE Catalog_Contents (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
parent_entry_id INTEGER,
previous_entry_id INTEGER,
next_entry_id INTEGER,
catalog_entry_name VARCHAR(80),
product_stock_number VARCHAR(50),
price_in_dollars DOUBLE,
price_in_euros DOUBLE,
pri... | Find the number of the names of catalog entries with level number 8, order in ascending by the names. | SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name ORDER BY catalog_entry_name | nvbench |
CREATE TABLE table_name_53 (
laps VARCHAR,
make VARCHAR,
winnings VARCHAR
) | How many total laps did the Chevrolet that won $97,508 make? | SELECT COUNT(laps) FROM table_name_53 WHERE make = "chevrolet" AND winnings = "$97,508" | sql_create_context |
CREATE TABLE table_name_70 (
rank VARCHAR,
notes VARCHAR,
time VARCHAR
) | Which Rank has Notes of fb, and a Time of 5:57.31? | SELECT rank FROM table_name_70 WHERE notes = "fb" AND time = "5:57.31" | sql_create_context |
CREATE TABLE table_name_80 (
gswr_class VARCHAR,
year VARCHAR
) | Which GSWR Class is from 1893? | SELECT gswr_class FROM table_name_80 WHERE year = "1893" | sql_create_context |
CREATE TABLE musical (
musical_id number,
name text,
year number,
award text,
category text,
nominee text,
result text
)
CREATE TABLE actor (
actor_id number,
name text,
musical_id number,
character text,
duration text,
age number
) | Who is the nominee who has been nominated for the most musicals? | SELECT nominee FROM musical GROUP BY nominee ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_49 (
magnitude VARCHAR,
date VARCHAR
) | What is the Magnitude on the Date May 28, 2004? | SELECT magnitude FROM table_name_49 WHERE date = "may 28, 2004" | 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... | count the number of patients whose admission year is less than 2148 and diagnoses short title is obesity nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2148" AND diagnoses.short_title = "Obesity NOS" | mimicsql_data |
CREATE TABLE table_69356 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What is the Date, when the home team is the NY Rangers? | SELECT "Date" FROM table_69356 WHERE "Home" = 'ny rangers' | wikisql |
CREATE TABLE table_name_40 (
leading_scorer VARCHAR,
visitor VARCHAR,
date VARCHAR
) | Who is the leading scorer for the game on March 22, 2008 with a visitor of Magic? | SELECT leading_scorer FROM table_name_40 WHERE visitor = "magic" AND date = "march 22, 2008" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 列出77494849这个患者在医院2952772中就诊科室名称里包含不育的医疗就诊记录都有哪些? | SELECT * FROM t_kc21 WHERE PERSON_ID = '77494849' AND MED_SER_ORG_NO = '2952772' AND MED_ORG_DEPT_NM LIKE '%不育%' | css |
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, visualize a bar chart about the distribution of name and manufacturer , and group by attribute headquarter, order in ascending by the Y-axis please. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Manufacturer | nvbench |
CREATE TABLE table_name_17 (
week VARCHAR,
date VARCHAR
) | What is the Week number on October 10, 1976? | SELECT COUNT(week) FROM table_name_17 WHERE date = "october 10, 1976" | sql_create_context |
CREATE TABLE table_203_699 (
id number,
"name" text,
"parentage" text,
"size" text,
"flower colour" text,
"flower type" text
) | which plant is listed first on the table ? | SELECT "name" FROM table_203_699 WHERE id = 1 | squall |
CREATE TABLE table_name_96 (
points INTEGER,
wins VARCHAR,
team VARCHAR,
year VARCHAR
) | Before 1981, how many Points did Team Suzuki have with less than 0 Wins? | SELECT SUM(points) FROM table_name_96 WHERE team = "suzuki" AND year < 1981 AND wins < 0 | sql_create_context |
CREATE TABLE table_50178 (
"Radical (variants)" text,
"Stroke count" real,
"P\u012bny\u012bn" text,
"Hiragana - Romaji" text,
"Meaning" text,
"Frequency" real,
"Examples" text
) | WHAT IS THE STROKE COUNT WITH RADICAL OF , FRQUENCY SMALLER THAN 22? | SELECT COUNT("Stroke count") FROM table_50178 WHERE "Radical (variants)" = '生' AND "Frequency" < '22' | wikisql |
CREATE TABLE table_57490 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many points did the home team Essendon score? | SELECT "Home team score" FROM table_57490 WHERE "Home team" = 'essendon' | wikisql |
CREATE TABLE Financial_Transactions (
transaction_type VARCHAR
) | Show the number of transaction types. | SELECT COUNT(DISTINCT transaction_type) FROM Financial_Transactions | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.