context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_56214 (
"Candidate" text,
"Money Raised, 3Q" text,
"Loans Received, 3Q" text,
"Money Spent, 3Q" text,
"Total Receipts" text,
"Cash On Hand" text,
"After Debt" text
) | What is the amount of cash on hand that has an after debt of $327,094 | SELECT "Cash On Hand" FROM table_56214 WHERE "After Debt" = '$327,094' | wikisql |
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID int,
Type text,
Market_ID int,
Year int
)
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE market (
Mar... | List the studios of each film and the number of films produced by that studio. Show bar chart. | SELECT Studio, COUNT(*) FROM film GROUP BY Studio | nvbench |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | 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, show me about the distribution of hire_date and the average of employee_id bin hire_date by weekday in a bar chart. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_name_3 (
points INTEGER,
played INTEGER
) | What is the average Points, when Played is greater than 126? | SELECT AVG(points) FROM table_name_3 WHERE played > 126 | sql_create_context |
CREATE TABLE table_name_20 (
attendance VARCHAR,
score VARCHAR
) | What is the total attendance at games with a score of 4-2? | SELECT COUNT(attendance) FROM table_name_20 WHERE score = "4-2" | sql_create_context |
CREATE TABLE table_58485 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was South Melbourne's away team opponents? | SELECT "Away team" FROM table_58485 WHERE "Home team" = 'south melbourne' | wikisql |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Documen... | How many documents for different location code? Plot a bar chart to show the proportion, and order y-axis in ascending order please. | SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(Location_Code) | nvbench |
CREATE TABLE table_44454 (
"Season" text,
"Races" real,
"Wins" real,
"Podiums" real,
"Poles" real
) | What is Poles, when Races is less than 16? | SELECT "Poles" FROM table_44454 WHERE "Races" < '16' | wikisql |
CREATE TABLE table_name_63 (
year INTEGER,
position VARCHAR
) | Which Year has a Position of 9th? | SELECT AVG(year) FROM table_name_63 WHERE position = "9th" | sql_create_context |
CREATE TABLE table_49143 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | The tko (doctor stoppage) method was used in a loss against which opponent? | SELECT "Opponent" FROM table_49143 WHERE "Method" = 'tko (doctor stoppage)' AND "Res." = 'loss' | wikisql |
CREATE TABLE table_30770 (
"Episode air date" text,
"Audition city" text,
"Date" text,
"Venue" text,
"Callback date" text,
"Callback venue" text,
"Golden tickets" real
) | Where is the audition city when the venue is upi convention center? | SELECT "Audition city" FROM table_30770 WHERE "Venue" = 'UPI Convention Center' | wikisql |
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Guests (
gues... | How many bookings does each booking status have? List the booking status code and the number of corresponding bookings with a bar chart, and show by the the total number in desc please. | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_11832 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the Score with a Team with @ houston? | SELECT "Score" FROM table_11832 WHERE "Team" = '@ houston' | wikisql |
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(... | Find the total credits of courses provided by different department. Plot them as bar chart. | SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name | nvbench |
CREATE TABLE table_69744 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Which Record has a Score of 0 2? | SELECT "Record" FROM table_69744 WHERE "Score" = '0–2' | wikisql |
CREATE TABLE table_57046 (
"Tournament" text,
"Winner" text,
"Runner-up" text,
"Score" text,
"Third Place" text
) | Who is the winner for the Tournament in Hong Kong with a third place winner named Mikael Pernfors? | SELECT "Winner" FROM table_57046 WHERE "Third Place" = 'mikael pernfors' AND "Tournament" = 'hong kong' | wikisql |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password... | Bar chart of how many date of enrolment from each date of enrolment, and could you rank by the y-axis in desc? | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) DESC | nvbench |
CREATE TABLE table_name_45 (
loses VARCHAR,
points_for VARCHAR,
points_against VARCHAR,
club VARCHAR
) | How many losses have points against greater than 592, with high park demons as the club, and points for greater than 631? | SELECT COUNT(loses) FROM table_name_45 WHERE points_against > 592 AND club = "high park demons" AND points_for > 631 | sql_create_context |
CREATE TABLE table_name_42 (
city_of_license VARCHAR,
erp_w VARCHAR,
call_sign VARCHAR
) | What is City of License, when ERP W is greater than 3, and when Call Sign is K218DZ? | SELECT city_of_license FROM table_name_42 WHERE erp_w > 3 AND call_sign = "k218dz" | sql_create_context |
CREATE TABLE table_name_78 (
crowd INTEGER,
home_team VARCHAR
) | What is the average crowd size of Fitzroy's home team? | SELECT AVG(crowd) FROM table_name_78 WHERE home_team = "fitzroy" | sql_create_context |
CREATE TABLE table_64835 (
"Japanese Title" text,
"English Title" text,
"Year" real,
"First publisher" text,
"ISBN" text
) | What is the ISBN of Japanese Title of (kiri no h monsha)? | SELECT "ISBN" FROM table_64835 WHERE "Japanese Title" = '霧の訪問者 (kiri no hōmonsha)' | wikisql |
CREATE TABLE table_34095 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | How many were in attendance at Griffith Stadium with Philadelphia Eagles as an opponent? | SELECT "Attendance" FROM table_34095 WHERE "Game site" = 'griffith stadium' AND "Opponent" = 'philadelphia eagles' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | New users than me with more reputation. | SELECT Them.Id AS "user_link", * FROM Users AS Them, Users AS Me WHERE Me.Id = '##userid##' AND Them.Reputation > Me.Reputation AND Them.CreationDate >= Me.CreationDate ORDER BY Them.Reputation | sede |
CREATE TABLE table_204_811 (
id number,
"year" number,
"ring name\n(birth name)" text,
"inducted by" text,
"inducted for" text,
"notes" text
) | who was the only person to be inducted for wrestling and managing ? | SELECT "ring name\n(birth name)" FROM table_204_811 WHERE "inducted for" = 'wrestling and managing' | squall |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is the number of patients whose ethnicity is black/african american and drug type is base? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_65268 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
) | What is the sum of the 2010 population with a latitude greater than 47.710905, a longitude of -101.79876, and less than 35.695 sq mi of land? | SELECT SUM("Pop. (2010)") FROM table_65268 WHERE "Latitude" > '47.710905' AND "Longitude" = '-101.79876' AND "Land ( sqmi )" < '35.695' | wikisql |
CREATE TABLE market (
Number_cities INTEGER
) | How many markets have number of cities smaller than 300? | SELECT COUNT(*) FROM market WHERE Number_cities < 300 | sql_create_context |
CREATE TABLE aircraft (
Aircraft_ID int,
Order_Year int,
Manufacturer text,
Model text,
Fleet_Series text,
Powertrain text,
Fuel_Propulsion text
)
CREATE TABLE pilot_record (
Record_ID int,
Pilot_ID int,
Aircraft_ID int,
Date text
)
CREATE TABLE pilot (
Pilot_ID int,
... | Bar chart of the number of position from each position, rank by the Y from high to low please. | SELECT Position, COUNT(Position) FROM pilot GROUP BY Position ORDER BY COUNT(Position) DESC | nvbench |
CREATE TABLE table_14067 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
) | Rank 6 has what notes? | SELECT "Notes" FROM table_14067 WHERE "Rank" = '6' | wikisql |
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 ... | 08年2月6日到18年10月8日期间,87902700这名患者全段甲状旁腺激素这个指标的所有记录 | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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.... | css |
CREATE TABLE table_52627 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the average crowd size when the home team score was 8.11 (59)? | SELECT AVG("Crowd") FROM table_52627 WHERE "Home team score" = '8.11 (59)' | wikisql |
CREATE TABLE table_27155678_2 (
genus_species VARCHAR,
accession_number VARCHAR
) | Name the genus/species of accession number bx897699.1 | SELECT genus_species FROM table_27155678_2 WHERE accession_number = "BX897699.1" | sql_create_context |
CREATE TABLE table_56689 (
"Route Name" text,
"Direction" text,
"Termini" text,
"Junctions" text,
"Length" text,
"Population Area" text
) | What termini does the route with a population Area of aguilares have? | SELECT "Termini" FROM table_56689 WHERE "Population Area" = 'aguilares' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | how much is the changing of patient 14154 in heart rate last measured on the last icu visit compared to the second to last value measured on the last icu visit? | SELECT (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 = 14154) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... | mimic_iii |
CREATE TABLE table_34191 (
"Name" text,
"Term" text,
"Games" real,
"Record (W\u2013L\u2013T / OTL)" text,
"Points" real,
"Win percentage" real
) | Which Name has Games of 105? | SELECT "Name" FROM table_34191 WHERE "Games" = '105' | wikisql |
CREATE TABLE table_1354805_6 (
average VARCHAR,
number_of_dances VARCHAR
) | tell the competitions where the mean is 1 | SELECT average FROM table_1354805_6 WHERE number_of_dances = 1 | sql_create_context |
CREATE TABLE table_519 (
"Series Ep #" real,
"Season 2 Ep #" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original Airdate" text,
"Production Code" real
) | What is the number of the original airdate with the production code 208. | SELECT COUNT("Original Airdate") FROM table_519 WHERE "Production Code" = '208' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number... | when did patient 16088 have the d5w intake since 931 days ago for the first time? | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16088)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label... | mimic_iii |
CREATE TABLE table_32460 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home team's score when the away team is south melbourne? | SELECT "Home team score" FROM table_32460 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE table_9333 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
) | who is the opponent after march 21 and the game is 75? | SELECT "Opponent" FROM table_9333 WHERE "March" > '21' AND "Game" = '75' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Posts by New users per day. This counts how many posts there have been by users on their first day. Broken down for easy graphing. | SELECT DATEADD(d, 0, DATEDIFF(d, 0, CreationDate)), COUNT(*) FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId INNER JOIN Votes AS v ON v.PostId = p.Id WHERE p.PostTypeId = 1 AND DATEADD(d, 0, DATEDIFF(d, 0, CreationDate)) > '2015-07-31 00:00:00' AND v.VoteTypeId = 3 GROUP BY DATEADD(d, 0, DATEDIFF(d, 0, Cr... | sede |
CREATE TABLE table_25064 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | How many reasons for change were listed when Edward Hempstead was the successor? | SELECT COUNT("Reason for change") FROM table_25064 WHERE "Successor" = 'Edward Hempstead' | wikisql |
CREATE TABLE table_name_21 (
points VARCHAR,
home VARCHAR
) | How many points were scored in the Detroit Home? | SELECT points FROM table_name_21 WHERE home = "detroit" | sql_create_context |
CREATE TABLE table_60664 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | Who has a finish of t66? | SELECT "Player" FROM table_60664 WHERE "Finish" = 't66' | wikisql |
CREATE TABLE table_18018214_3 (
points INTEGER,
goals_scored VARCHAR
) | HOw many points where there when the number of goals scored was 47? | SELECT MAX(points) FROM table_18018214_3 WHERE goals_scored = 47 | sql_create_context |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
... | Show id from each meter 500 | SELECT meter_500, ID FROM swimmer | nvbench |
CREATE TABLE table_name_2 (
driving_force_gt VARCHAR,
g27_racing_wheel VARCHAR,
gt_force VARCHAR,
driving_force_pro VARCHAR
) | GT Force of no, and a Driving Force Pro of no, and a G27 Racing Wheel of no has what driving force gt? | SELECT driving_force_gt FROM table_name_2 WHERE gt_force = "no" AND driving_force_pro = "no" AND g27_racing_wheel = "no" | sql_create_context |
CREATE TABLE table_name_8 (
date VARCHAR,
location VARCHAR
) | What date was the game played when it was located at bells beach? | SELECT date FROM table_name_8 WHERE location = "bells beach" | 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... | 按照出院时诊断的病名不同和科室差别算算看医院0738029所有的就诊记录里患者平均有多大,保留平均年龄里面比1岁大的记录 | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0738029' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM HAVING AVG(t_kc21.PERSON_AGE) > 1 | css |
CREATE TABLE table_62131 (
"Manager" text,
"Mexico career" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Win %" real
) | What is the highes win % that manager juan carlos ch vez's team had when they lost less than 4 times? | SELECT MAX("Win %") FROM table_62131 WHERE "Manager" = 'juan carlos chávez' AND "Lost" < '4' | wikisql |
CREATE TABLE table_3007 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | What was the reason for change when the successor was William Milnes, Jr. (C)? | SELECT "Reason for change" FROM table_3007 WHERE "Successor" = 'William Milnes, Jr. (C)' | wikisql |
CREATE TABLE table_44189 (
"Heat" real,
"Lane" real,
"Name" text,
"Country" text,
"Mark" text,
"React" real
) | what is the highest lane number for johan wissman when the react is less than 0.242? | SELECT MAX("Lane") FROM table_44189 WHERE "Name" = 'johan wissman' AND "React" < '0.242' | wikisql |
CREATE TABLE table_73645 (
"WEEK" real,
"Sydney" real,
"Melbourne" real,
"Brisbane" real,
"Adelaide" real,
"Perth" real,
"TOTAL" real,
"WEEKLY RANK" real
) | How many episodes aired in Sydney in Week 3? | SELECT COUNT("Sydney") FROM table_73645 WHERE "WEEK" = '3' | wikisql |
CREATE TABLE table_name_88 (
density INTEGER,
province VARCHAR,
area VARCHAR
) | What is the highest Density for the independencia province, with an area smaller than 2,007.4? | SELECT MAX(density) FROM table_name_88 WHERE province = "independencia" AND area < 2 OFFSET 007.4 | sql_create_context |
CREATE TABLE table_204_500 (
id number,
"year" number,
"title" text,
"peak chart positions\nus country" number,
"peak chart positions\nus" number,
"album" text
) | what is the number of top ten hits kitty wells had in 1953 alone ? | SELECT COUNT(*) FROM table_204_500 WHERE "peak chart positions\nus country" <= 10 AND "year" = 1953 | 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... | count the number of patients whose admission type is newborn and ethnicity is hispanic/latino - puerto rican? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" | mimicsql_data |
CREATE TABLE table_32218 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was South Melbourne's score as the home team? | SELECT "Home team score" FROM table_32218 WHERE "Home team" = 'south melbourne' | wikisql |
CREATE TABLE table_name_96 (
name VARCHAR,
spread VARCHAR
) | What name has a spread of 69? | SELECT name FROM table_name_96 WHERE spread = 69 | sql_create_context |
CREATE TABLE table_name_83 (
points INTEGER,
engine VARCHAR,
year VARCHAR
) | What are the highest points that have a Mugen V8 engine and happened in 1991? | SELECT MAX(points) FROM table_name_83 WHERE engine = "mugen v8" AND year = 1991 | sql_create_context |
CREATE TABLE table_6798 (
"Episode" text,
"VII Season" text,
"VIII Season" text,
"XII Season" text,
"XIII Season" text
) | What is XIII Season, when VIII Season is 4 780 743 (2 november 2008)? | SELECT "XIII Season" FROM table_6798 WHERE "VIII Season" = '4 780 743 (2 november 2008)' | wikisql |
CREATE TABLE table_34756 (
"Rank" real,
"Centre" text,
"Country" text,
"Rating" real,
"Change" real
) | Which Centre has a Rank of 42? | SELECT "Centre" FROM table_34756 WHERE "Rank" = '42' | wikisql |
CREATE TABLE table_name_16 (
away_team VARCHAR,
tie_no VARCHAR
) | What is Away Team, when Tie No is 4? | SELECT away_team FROM table_name_16 WHERE tie_no = "4" | sql_create_context |
CREATE TABLE table_16714 (
"Rnd" real,
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | what's the report with rnd being 4 | SELECT "Report" FROM table_16714 WHERE "Rnd" = '4' | wikisql |
CREATE TABLE table_10781 (
"Call sign" text,
"Frequency MHz" text,
"City of license" text,
"ERP W" text,
"FCC info" text
) | Name the frequency mhz for fcc and ERP W of 9 watts | SELECT "Frequency MHz" FROM table_10781 WHERE "FCC info" = 'fcc' AND "ERP W" = '9 watts' | wikisql |
CREATE TABLE table_name_71 (
decision VARCHAR,
visitor VARCHAR,
home VARCHAR
) | Who had the decision when the visitor was Detroit and the home team was Ottawa? | SELECT decision FROM table_name_71 WHERE visitor = "detroit" AND home = "ottawa" | sql_create_context |
CREATE TABLE table_name_63 (
record VARCHAR,
date VARCHAR
) | What was the record on April 7? | SELECT record FROM table_name_63 WHERE date = "april 7" | sql_create_context |
CREATE TABLE table_22877 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | what is the surface of the final which had score 6-2, 6-3 | SELECT "Surface" FROM table_22877 WHERE "Score in the final" = '6-2, 6-3' | wikisql |
CREATE TABLE table_61612 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | Who won the event against U.S.A.? | SELECT "Status" FROM table_61612 WHERE "Opposing Teams" = 'u.s.a.' | wikisql |
CREATE TABLE table_name_83 (
founded INTEGER,
type VARCHAR,
nickname VARCHAR
) | Which of the private colleges is the oldest, and whose nickname is the Mountaineers? | SELECT MIN(founded) FROM table_name_83 WHERE type = "private" AND nickname = "mountaineers" | 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
)
... | at what time was the patient with patient id 18480 discharged? | SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = "18480" | mimicsql_data |
CREATE TABLE table_62456 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Club" text
) | What is the Weight of the Spandau 04 Player with a Height of m (ft 5in)? | SELECT "Weight" FROM table_62456 WHERE "Club" = 'spandau 04' AND "Height" = 'm (ft 5in)' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
... | What are the Other classes for EECS majors ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%EECS%' AND program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id | advising |
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 maximum age of patients whose primary disease is gangrene and admission year is greater than or equal to 2103? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "GANGRENE" AND demographic.admityear >= "2103" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
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 num... | 在01年10月19日到16年8月22日这段时间,患者13818309一共有多少检验报告单,把这些检验报告单的审核日期列出来 | SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info 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 person_info_hz_info.KH = hz_info.KH AND pers... | css |
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... | How much does losing a duel cost?. | WITH two_answers AS (SELECT MIN(a.Id) AS first, MAX(a.Id) AS last FROM Posts AS q JOIN Posts AS a ON q.Id = a.ParentId WHERE q.AnswerCount = 2 GROUP BY q.Id HAVING CURRENT_TIMESTAMP() - MAX(a.CreationDate) > 30) SELECT AVG(CAST(COALESCE(f.Score, 0) AS FLOAT)), AVG(CAST(COALESCE(l.Score, 0) AS FLOAT)), ROUND(AVG(CAST(CO... | sede |
CREATE TABLE table_17516967_1 (
swimsuit VARCHAR,
state VARCHAR
) | Name the swuinsuit for oregon | SELECT swimsuit FROM table_17516967_1 WHERE state = "Oregon" | sql_create_context |
CREATE TABLE table_name_41 (
region VARCHAR,
format VARCHAR,
date VARCHAR
) | In what region was Degeneration released in digital format on 19 July 2008? | SELECT region FROM table_name_41 WHERE format = "digital" AND date = "19 july 2008" | 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 ... | 两千年十二月二十一日到一六年十二月二日,患者尤清润的二氧化碳情况是怎样的 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info.XM = '尤清润'... | css |
CREATE TABLE table_name_49 (
save VARCHAR,
opponent VARCHAR
) | What is the save of the game with rice as the opponent? | SELECT save FROM table_name_49 WHERE opponent = "rice" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | until 1 year ago, patient 003-39724 had any allergies? | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-39724')) AND DATETIME(allergy.allergytime) <= DATETIME(CURRENT_TIME(), '-1 y... | eicu |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperio... | tell me the top three drugs that are most frequently prescribed for patients in the 40s until 1 year ago? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-1 year') GR... | eicu |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Give me the comparison about Weight over the Date_of_Birth , list from high to low by the bar. | SELECT Date_of_Birth, Weight FROM people ORDER BY Date_of_Birth DESC | nvbench |
CREATE TABLE table_10643 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the largest Grid with a Driver of piers courage? | SELECT MAX("Grid") FROM table_10643 WHERE "Driver" = 'piers courage' | wikisql |
CREATE TABLE table_68913 (
"Round" text,
"Name" text,
"Song" text,
"Score" real,
"Status" text
) | What round has this song: - / - ? | SELECT "Round" FROM table_68913 WHERE "Song" = '陶喆、蔡依林 - 今天你要嫁给我/曹格 - 世界唯一的你' | wikisql |
CREATE TABLE table_12708 (
"Year" real,
"Championship" text,
"Partnering" text,
"Opponents in Final" text,
"Score in Final" text
) | What was the championship before 2012 that had Stephane Houdet Michael Jeremiasz as opponents? | SELECT "Championship" FROM table_12708 WHERE "Year" < '2012' AND "Opponents in Final" = 'stephane houdet michael jeremiasz' | wikisql |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_date DATETIME,
order_status_code VARCHAR(15)
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
order_quantity VARCHAR(80)
)
CREATE TABLE Addresses (
address_id INTEGE... | Show the number of addrens history for each customer in a bar chart. | SELECT T2.customer_name, COUNT(T2.customer_name) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY T2.customer_name | nvbench |
CREATE TABLE table_name_22 (
frequency_mhz VARCHAR,
erp_w VARCHAR,
call_sign VARCHAR
) | Name the total number of frequency Mhz for when it has ERP W of 1 and call sign of w215bj | SELECT COUNT(frequency_mhz) FROM table_name_22 WHERE erp_w = 1 AND call_sign = "w215bj" | sql_create_context |
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,... | Question count by the number of answers per question. | SELECT q.Cnt AS AnswerCount, COUNT(*) AS QuestionCount, COUNT(*) * 100.0 / MIN(TotalQuestions) AS "Percent" FROM (SELECT (SELECT COUNT(*) FROM Posts AS a WHERE a.PostTypeId = 1) AS TotalQuestions, (SELECT COUNT(*) FROM Posts AS a WHERE a.ParentId = q.Id AND a.PostTypeId = 2) AS Cnt FROM Posts AS q WHERE q.PostTypeId = ... | sede |
CREATE TABLE table_49365 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the Rider, when Grid is less than 16, when Manufacturer is Aprilia, and when Time is +28.288? | SELECT "Rider" FROM table_49365 WHERE "Grid" < '16' AND "Manufacturer" = 'aprilia' AND "Time" = '+28.288' | wikisql |
CREATE TABLE table_3002894_4 (
nupowr_167 VARCHAR,
model VARCHAR
) | When maker is the model what is the nupowr 167? | SELECT nupowr_167 FROM table_3002894_4 WHERE model = "Maker" | sql_create_context |
CREATE TABLE table_name_87 (
date VARCHAR,
partner VARCHAR
) | What Date had a Partner of urszula radwa ska? | SELECT date FROM table_name_87 WHERE partner = "urszula radwańska" | sql_create_context |
CREATE TABLE table_train_73 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"severe_sepsis" bool,
"in_another_study" bool,
"systolic_blood_pressure_sbp" int,
"skin_mottling_score" int,
"glasgow_come_score_gcs" int,
"mr_scanning" bool,
"age" float,
"NOUSE" float
) | age > 18 years either sex | SELECT * FROM table_train_73 WHERE (gender = 'male' OR gender = 'female') AND age > 18 | criteria2sql |
CREATE TABLE table_name_46 (
historical_photos VARCHAR,
location VARCHAR
) | Which Historical Photos were taken at prospect 43 prospect ave? | SELECT historical_photos FROM table_name_46 WHERE location = "prospect 43 prospect ave" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varch... | 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 sum of department_id , and group by attribute job_id, I want to list by the bars from low to high. | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_67616 (
"Classification" text,
"Fastest time (s)" real,
"Athlete" text,
"Country" text,
"Date" text,
"Location" text
) | Which athlete has the fastest time of 15.82? | SELECT "Athlete" FROM table_67616 WHERE "Fastest time (s)" = '15.82' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
... | when was the last time patient 76637 was discharged since 2102? | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 76637 AND STRFTIME('%y', admissions.dischtime) >= '2102' ORDER BY admissions.dischtime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_30 (
winners VARCHAR
) | Who came in 3rd when Matej agar won? | SELECT 3 AS rd_place FROM table_name_30 WHERE winners = "matej žagar" | sql_create_context |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
... | may i have a listing of flights from LONG BEACH to COLUMBUS OHIO on tuesday | 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, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'COLUMBUS' AND date_day.day_number = 22 AND date_day.month_number =... | atis |
CREATE TABLE table_name_10 (
catalog VARCHAR,
format VARCHAR
) | What catalog uses the stereo compact cassette format? | SELECT catalog FROM table_name_10 WHERE format = "stereo compact cassette" | sql_create_context |
CREATE TABLE table_70067 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which average bronze had a silver greater than 2 and a gold larger than 7? | SELECT AVG("Bronze") FROM table_70067 WHERE "Silver" > '2' AND "Gold" > '7' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.