instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
... | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respiratory rate'... | mimic_iii |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE... | SELECT ROUND(Reputation / '##Width##', 0) * '##Width##' AS Rep, COUNT(*) AS number_of_users FROM (SELECT * FROM Users WHERE Reputation > 101) AS a GROUP BY ROUND(Reputation / '##Width##', 0) * '##Width##' ORDER BY ROUND(Reputation / '##Width##', 0) * '##Width##' | sede |
CREATE TABLE table_name_61 (
per_capita_income VARCHAR,
median_family_income VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the per capita income of the county with a median family income of $40,492?
| SELECT per_capita_income FROM table_name_61 WHERE median_family_income = "$40,492" | sql_create_context |
CREATE TABLE table_name_64 (
howard_baker VARCHAR,
george_h_w_bush VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the howard bake when bush had 66%
| SELECT howard_baker FROM table_name_64 WHERE george_h_w_bush = "66%" | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length in... | 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 (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 11 AND date_day.month_number = 11 A... | atis |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name t... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | sede |
CREATE TABLE table_name_12 (
host VARCHAR,
venue VARCHAR,
year VARCHAR,
state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the host in a year greater than 1989 and when the venue is the Staples Center located in California?
| SELECT host FROM table_name_12 WHERE year > 1989 AND state = "california" AND venue = "staples center" | sql_create_context |
CREATE TABLE table_44205 (
"Publication" text,
"Country" text,
"Accolade" text,
"Year" real,
"Rank" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Accolade, when Country is 'United States', and when Year is '1999'?
| SELECT "Accolade" FROM table_44205 WHERE "Country" = 'united states' AND "Year" = '1999' | wikisql |
CREATE TABLE table_58703 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Result has a Game of game 1?
| SELECT "Result" FROM table_58703 WHERE "Game" = 'game 1' | wikisql |
CREATE TABLE table_80044 (
"Units" text,
"Type" text,
"Period used" text,
"Formed from" text,
"Trailers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the typed for formed from 6-pul trailer third in res unit
| SELECT "Type" FROM table_80044 WHERE "Formed from" = '6-pul trailer third in res unit' | wikisql |
CREATE TABLE table_12205 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which To par has a Player of tom watson?
| SELECT "To par" FROM table_12205 WHERE "Player" = 'tom watson' | wikisql |
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... | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '32284795' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT <= 1441.3) | css |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE files (
f_id number(10),
artist_name varchar2(50),
file_size varchar2(20),
duration varchar2(20),
formats varchar2(20)
)
CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(10),
most_popular_in varchar2(50)
)
CREATE TABLE song (
song_name varchar2(50),
artist... | SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY formats | nvbench |
CREATE TABLE table_name_58 (
total_seasons INTEGER,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least total seasons of the Vancouver 86ers?
| SELECT MIN(total_seasons) FROM table_name_58 WHERE team = "vancouver 86ers" | sql_create_context |
CREATE TABLE table_52754 (
"Title" text,
"Author(s)" text,
"Recorded" text,
"Location(s)" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What title runs for 3:22?
| SELECT "Title" FROM table_52754 WHERE "Time" = '3:22' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
O... | SELECT CreationDate, SUM(CASE VoteTypeId WHEN 2 THEN 1 ELSE 0 END) AS "Upvotes", SUM(CASE VoteTypeId WHEN 3 THEN 1 ELSE 0 END) AS "Downvotes" FROM Votes WHERE CreationDate >= '2019-09-01' AND VoteTypeId IN (2, 3) GROUP BY CreationDate ORDER BY CreationDate | sede |
CREATE TABLE table_203_157 (
id number,
"year" number,
"film" text,
"role" text,
"language" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was neha 's last film ?
| SELECT "film" FROM table_203_157 ORDER BY id DESC LIMIT 1 | squall |
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... | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY Team_ID DESC | nvbench |
CREATE TABLE item (
i_id number,
title text
)
CREATE TABLE trust (
source_u_id number,
target_u_id number,
trust number
)
CREATE TABLE review (
a_id number,
u_id number,
i_id number,
rating number,
rank number
)
CREATE TABLE useracct (
u_id number,
name text
)
-- Usi... | SELECT MIN(rank) FROM review | spider |
CREATE TABLE Suppliers (
supplier_id INTEGER,
supplier_name VARCHAR(80),
supplier_phone VARCHAR(80)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Customers (
customer_id INTEGER,
payment_method_code ... | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY AVG(product_price) DESC | nvbench |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '55593756' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
CREATE TABLE table_63009 (
"Driver" text,
"Navigator" text,
"Vehicle" text,
"Class" text,
"Capacity" real,
"Total Time" text,
"Margin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Capacity has a Vehicle of 2003 holden commodore ut... | SELECT COUNT("Capacity") FROM table_63009 WHERE "Vehicle" = '2003 holden commodore ute' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '002-38474' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-5 year') | eicu |
CREATE TABLE table_1729366_2 (
championship VARCHAR,
opponents_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which championship had the final opponents of nathalie dechy andy ram?
| SELECT championship FROM table_1729366_2 WHERE opponents_in_the_final = "Nathalie Dechy Andy Ram" | sql_create_context |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId n... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, WebsiteUrl AS Wesbite, LastAccessDate AS Seen, CreationDate FROM Users WHERE Reputation >= '##MinimalReputation:int?1##' AND (UPPER(Location) LIKE UPPER('%Algeria%') OR UPPER(Location) LIKE UPPER('%Algerie%') OR UPPER(L... | sede |
CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(10),
most_popular_in varchar2(50)
)
CREATE TABLE files (
f_id number(10),
artist_name varchar2(50),
file_size varchar2(20),
duration varchar2(20),
formats varchar2(20)
)
CREATE TABLE artist (
artist_name varchar2(50),
co... | SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY COUNT(*) | nvbench |
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE club (
clubid number,
clubname text,
clubdes... | SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.major = "600" | spider |
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 course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'WRITING' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spr... | advising |
CREATE TABLE table_21312959_1 (
no_in_season VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes had the us viewers (millions) figure of 5.0?
| SELECT COUNT(no_in_season) FROM table_21312959_1 WHERE us_viewers__millions_ = "5.0" | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE... | 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 = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <... | atis |
CREATE TABLE table_41080 (
"Season" text,
"Division" text,
"Finish" text,
"Wins" text,
"Losses" text,
"Pct." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which season were there Wins of 29 and a Finished place of 3rd?
| SELECT "Season" FROM table_41080 WHERE "Wins" = '29' AND "Finish" = '3rd' | wikisql |
CREATE TABLE table_79254 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Theme Song(s)" text,
"Episodes" real,
"Average Ratings" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Theme Song of the show on Fuji TV Stati... | SELECT "Theme Song(s)" FROM table_79254 WHERE "TV Station" = 'fuji tv' AND "Average Ratings" = '16.65%' | wikisql |
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY Title | nvbench |
CREATE TABLE table_38184 (
"Rank" real,
"Matches as champion" real,
"Reigns as champion" real,
"Title matches won*" real,
"Title last held" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Matches is on 24 march 1963 with a Rank larger than 44?
| SELECT MAX("Matches as champion") FROM table_38184 WHERE "Title last held" = '24 march 1963' AND "Rank" > '44' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_18659 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the first election when Fritz G. Lanham was elected?
| SELECT MAX("First elected") FROM table_18659 WHERE "Incumbent" = 'Fritz G. Lanham' | wikisql |
CREATE TABLE table_48328 (
"Team #1" text,
"Points" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 2nd Leg, when Team #2 is 'San Lorenzo'?
| SELECT "2nd leg" FROM table_48328 WHERE "Team #2" = 'san lorenzo' | wikisql |
CREATE TABLE table_train_199 (
"id" int,
"t2dm" bool,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"diabetic" string,
"hypoglycemia" bool,
"diabetes" bool,
"seizure_disorder" bool,
"glaucoma" bool,
"hypertension" bool,
"age" float,
"NOUSE" float
)
-- Using valid ... | SELECT * FROM table_train_199 WHERE age >= 5 AND age <= 14 | criteria2sql |
CREATE TABLE table_11703336_1 (
cpu VARCHAR,
ram VARCHAR,
display_size VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the cpu for the calculator with 28 kb of ram and display size 128 64 pixels 21 8 characters?
| SELECT cpu FROM table_11703336_1 WHERE ram = "28 KB of ram" AND display_size = "128×64 pixels 21×8 characters" | sql_create_context |
CREATE TABLE table_35604 (
"Team" text,
"Copa Libertadores 1996" text,
"Supercopa Sudamericana 1996" text,
"Copa CONMEBOL 1996" text,
"Recopa Sudamericana 1996" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the recoupa sudaamericana 1996 re... | SELECT "Recopa Sudamericana 1996" FROM table_35604 WHERE "Copa CONMEBOL 1996" = 'did not qualify' AND "Team" = 'flamengo' | wikisql |
CREATE TABLE table_name_81 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 2004, when 2010 is 'Grand Slam Tournaments'?
| SELECT 2004 FROM table_name_81 WHERE 2010 = "grand slam tournaments" | sql_create_context |
CREATE TABLE table_49153 (
"Scorer" text,
"Club" text,
"League goals" text,
"FA Cup goals" real,
"League Cup goals" real,
"Euro competitions" text,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total for the Wolverhampt... | SELECT "League goals" FROM table_49153 WHERE "Club" = 'wolverhampton wanderers' | wikisql |
CREATE TABLE table_67174 (
"Games" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals For" real,
"Goals Against" real,
"Goal Differential" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- for a Goals Against smaller than 9, and a Goal Diff... | SELECT SUM("Goals For") FROM table_67174 WHERE "Goals Against" < '9' AND "Goal Differential" = '0' AND "Draws" < '2' AND "Wins" = '1' | wikisql |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT q.Id AS "post_link", q.CreationDate, q.ClosedDate FROM Posts AS q INNER JOIN PostHistory AS h ON q.Id = h.PostId WHERE h.PostHistoryTypeId = 10 AND NOT q.ClosedDate IS NULL ORDER BY q.ClosedDate DESC | sede |
CREATE TABLE Addresses (
address_id INTEGER,
line_1_number_building VARCHAR(80),
city VARCHAR(50),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50)
)
CREATE TABLE Lessons (
lesson_id INTEGER,
customer_id INTEGER,
lesson_status_code VARCHAR(15),
st... | SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY customer_status_code DESC | nvbench |
CREATE TABLE table_name_45 (
monday VARCHAR,
sunday VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the presenter on Monday of 'Big Brother 13' in which Alice Levine Jamie East presented on Sunday?
| SELECT monday FROM table_name_45 WHERE sunday = "alice levine jamie east" AND series = "big brother 13" | sql_create_context |
CREATE TABLE table_54923 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the game on 8 March 2008?
| SELECT SUM("Attendance") FROM table_54923 WHERE "Date" = '8 march 2008' | wikisql |
CREATE TABLE table_name_90 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team score of the game with Adelaide as the away team?
| SELECT home_team AS score FROM table_name_90 WHERE away_team = "adelaide" | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
require... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN program_... | advising |
CREATE TABLE table_name_37 (
position VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the position of pick #53?
| SELECT position FROM table_name_37 WHERE pick__number = 53 | 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... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "COPD EXACERBATION" | mimicsql_data |
CREATE TABLE table_30705 (
"Track no." real,
"Track" text,
"Original Artist" text,
"Soloist(s)" text,
"Vocal Percussionist" text,
"Arranger(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the vocal percussionist when stevie wonder was... | SELECT "Vocal Percussionist" FROM table_30705 WHERE "Original Artist" = 'Stevie Wonder' | wikisql |
CREATE TABLE table_name_28 (
points INTEGER,
goals_for VARCHAR,
draws VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest points of the club with less than 9 draws, 11 wins, and more than 40 goals?
| SELECT MAX(points) FROM table_name_28 WHERE draws < 9 AND wins = 11 AND goals_for > 40 | sql_create_context |
CREATE TABLE table_38351 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Attendance on october 2, 1977?
| SELECT "Attendance" FROM table_38351 WHERE "Date" = 'october 2, 1977' | wikisql |
CREATE TABLE table_name_91 (
elevated VARCHAR,
cardinalatial_order_and_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of elevation for the cardinal given the order and title of Cardinal-Priest of S. Pudenziana?
| SELECT elevated FROM table_name_91 WHERE cardinalatial_order_and_title = "cardinal-priest of s. pudenziana" | sql_create_context |
CREATE TABLE table_24431264_17 (
points VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the total defensive points for marion bartoli.
| SELECT points AS defending FROM table_24431264_17 WHERE player = "Marion Bartoli" | sql_create_context |
CREATE TABLE table_11716 (
"Version" text,
"Year" text,
"Bore x stroke" text,
"Displacement" text,
"Power" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Bore x stroke of 1929-32
| SELECT "Bore x stroke" FROM table_11716 WHERE "Year" = '1929-32' | wikisql |
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 event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY SUM(ID) DESC | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Vitamin B Complex" | mimicsql_data |
CREATE TABLE table_24420 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Lambert's song choice in the top 13?
| SELECT "Song choice" FROM table_24420 WHERE "Week #" = 'Top 13' | wikisql |
CREATE TABLE table_name_76 (
date_of_death VARCHAR,
date_of_inauguration VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of death entry in the row that has a date of inauguration entry of date of inauguration?
| SELECT date_of_death FROM table_name_76 WHERE date_of_inauguration = "date of inauguration" | sql_create_context |
CREATE TABLE table_57157 (
"Rank" real,
"Name" text,
"Nation" text,
"Points" real,
"Placings" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the sum of rank for placings of 58
| SELECT SUM("Rank") FROM table_57157 WHERE "Placings" = '58' | wikisql |
CREATE TABLE artist (
age VARCHAR,
year_join VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many artists are above age 46 and joined after 1990?
| SELECT COUNT(*) FROM artist WHERE age > 46 AND year_join > 1990 | sql_create_context |
CREATE TABLE table_204_282 (
id number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text,
"#" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times was andorra the opponent ?
| SELECT COUNT(*) FROM table_204_282 WHERE "opponent" = 'andorra' | squall |
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... | SELECT OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '2502709' GROUP BY OUT_DIAG_DIS_CD | css |
CREATE TABLE table_name_93 (
nickname VARCHAR,
institution VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team nickname of university of wisconsin-platteville?
| SELECT nickname FROM table_name_93 WHERE institution = "university of wisconsin-platteville" | sql_create_context |
CREATE TABLE player_college (
college_id VARCHAR
)
CREATE TABLE college (
name_full VARCHAR,
college_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the full name and id of the college with the largest number of baseball players?
| SELECT T1.name_full, T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.college_id ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_24386 (
"Title" text,
"Total copies sold" text,
"Sales breakdown" text,
"Genre" text,
"Release date" text,
"Developer" text,
"Publisher" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the sales breakdown of the Nint... | SELECT "Sales breakdown" FROM table_24386 WHERE "Publisher" = 'Nintendo' AND "Release date" = 'May 15, 2006' | wikisql |
CREATE TABLE table_5040 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record when Minnesota was the home team?
| SELECT "Record" FROM table_5040 WHERE "Home" = 'minnesota' | wikisql |
CREATE TABLE table_55938 (
"Rank" real,
"Name" text,
"Nation" text,
"Placings" text,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What rank goes to a total of 92.7?
| SELECT "Rank" FROM table_55938 WHERE "Total" = '92.7' | wikisql |
CREATE TABLE table_7447 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Against has a Position larger than 11?
| SELECT COUNT("Against") FROM table_7447 WHERE "Position" > '11' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_1 (
floors VARCHAR,
street_address VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many floors have 207 w. hastings st. as the address?
| SELECT COUNT(floors) FROM table_name_1 WHERE street_address = "207 w. hastings st." | sql_create_context |
CREATE TABLE table_name_7 (
studio VARCHAR,
worldwide_gross VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what studio was the film grossing $457,640,427 made?
| SELECT studio FROM table_name_7 WHERE worldwide_gross = "$457,640,427" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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 (
... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE STRFTIME('%y', labevents.charttime) = '2103' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 3) | mimic_iii |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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.... | css |
CREATE TABLE table_48978 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the attendance when the date is october 22, 2000?
| SELECT "Attendance" FROM table_48978 WHERE "Date" = 'october 22, 2000' | wikisql |
CREATE TABLE table_name_28 (
local_letter VARCHAR,
capital VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The capital of funadhoo has what local letter?
| SELECT local_letter FROM table_name_28 WHERE capital = "funadhoo" | sql_create_context |
CREATE TABLE appellations (
no number,
appelation text,
county text,
state text,
area text,
isava text
)
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,... | SELECT DISTINCT winery FROM wine WHERE price BETWEEN 50 AND 100 | spider |
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY COUNT(*) | nvbench |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | 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, food_service WHERE (((flight.arrival_time < 1200 AND food_service.meal_code = flight.meal_code) AND date_day.day_number = 21 AND date_day.month_number... | atis |
CREATE TABLE table_25017530_5 (
cfl_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the cfl team for steven turner
| SELECT cfl_team FROM table_25017530_5 WHERE player = "Steven Turner" | sql_create_context |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '秦鸿德' AND t_kc21.MED_SER_ORG_NO = '6682741' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%脑瘫%' | css |
CREATE TABLE staff (
staff_id number,
staff_details text
)
CREATE TABLE customers (
customer_id number,
customer_details text
)
CREATE TABLE claims_processing (
claim_processing_id number,
claim_id number,
claim_outcome_code text,
claim_stage_id number,
staff_id number
)
CREATE TA... | SELECT customer_details FROM customers WHERE customer_details LIKE "%Diana%" | spider |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
-- Using valid SQLite, answer the following questions fo... | SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Type, Nationality ORDER BY Nationality DESC | nvbench |
CREATE TABLE table_29789_1 (
international_tourist_arrivals__2012_ VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many international tourists visited Russia in 2012?
| SELECT international_tourist_arrivals__2012_ FROM table_29789_1 WHERE country = "Russia" | sql_create_context |
CREATE TABLE table_name_49 (
residence VARCHAR,
representative VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What residence has representative Quincy Murphy?
| SELECT residence FROM table_name_49 WHERE representative = "quincy murphy" | sql_create_context |
CREATE TABLE table_26603 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Final Score" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of record for week 11
| SELECT COUNT("Record") FROM table_26603 WHERE "Week" = '11' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9297) AND prescriptions.route = 'vg' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-6 month') ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_204_639 (
id number,
"poll company" text,
"source" text,
"publication date" text,
"psuv" number,
"opposition" number,
"undecided" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which source was used before may 2010 ?
| SELECT "source" FROM table_204_639 WHERE "publication date" < (SELECT "publication date" FROM table_204_639 WHERE "publication date" = 'may 2010') | squall |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
... | SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.ZZYSGH = '83321772' AND mzjzjlb.JZKSRQ BETWEEN '2001-10-05' AND '2003-01-20' | css |
CREATE TABLE table_name_9 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the game on November 7, 1999?
| SELECT result FROM table_name_9 WHERE date = "november 7, 1999" | sql_create_context |
CREATE TABLE table_43681 (
"Rank" real,
"Title" text,
"Studio" text,
"Director" text,
"Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the ranks for the film, eddie murphy raw?
| SELECT SUM("Rank") FROM table_43681 WHERE "Title" = 'eddie murphy raw' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_nam... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi... | mimic_iii |
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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.long_title = "Other disorders of the pituitary and other syndromes of diencephalohypophyseal origin" | mimicsql_data |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "44020" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_204_385 (
id number,
"round" number,
"pick" number,
"player" text,
"nationality" text,
"college/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which player was picked in the last round ?
| SELECT "player" FROM table_204_385 ORDER BY "round" DESC LIMIT 1 | squall |
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 person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ... | css |
CREATE TABLE Candidate_Assessments (
candidate_id INTEGER,
qualification CHAR(15),
assessment_date DATETIME,
asessment_outcome_code CHAR(15)
)
CREATE TABLE Student_Course_Attendance (
student_id INTEGER,
course_id INTEGER,
date_of_attendance DATETIME
)
CREATE TABLE People_Addresses (
p... | SELECT course_name, COUNT(course_name) FROM Courses GROUP BY course_name ORDER BY course_name DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.