instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.long_title = "Acute on chronic systolic heart failure" | mimicsql_data |
CREATE TABLE table_name_97 (
opponent VARCHAR,
week VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent of the game before week 11 on October 31, 1976?
| SELECT opponent FROM table_name_97 WHERE week < 11 AND date = "october 31, 1976" | sql_create_context |
CREATE TABLE table_25519358_1 (
vertical_0_b VARCHAR,
horizontal_0_a VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the vertical for ys
| SELECT vertical_0_b FROM table_25519358_1 WHERE horizontal_0_a = "明勾(YS月南)" | sql_create_context |
CREATE TABLE table_name_48 (
team_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2nd leg of the Internacional Team 1?
| SELECT 2 AS nd_leg FROM table_name_48 WHERE team_1 = "internacional" | sql_create_context |
CREATE TABLE table_14028 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Team of the Fullback Player?
| SELECT "Team" FROM table_14028 WHERE "Position" = 'fullback' | wikisql |
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Transactions (
transacti... | SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code ORDER BY transaction_type_code DESC | nvbench |
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
)
-- Using valid SQLite, answer the following questions for the... | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder | nvbench |
CREATE TABLE table_1682865_1 (
reverse VARCHAR,
£1_fraction VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the reverse when the 1 fraction is 1/480?
| SELECT reverse FROM table_1682865_1 WHERE £1_fraction = "1/480" | sql_create_context |
CREATE TABLE table_dev_34 (
"id" int,
"gender" string,
"heart_disease" bool,
"body_weight" float,
"hematocrit_hct" float,
"fasting_blood_glucose_fbg" float,
"hyperlipidemia" bool,
"systemic_illness" bool,
"angina" bool,
"serum_ldl" int,
"clinically_significant_atherosclerotic... | SELECT * FROM table_dev_34 WHERE impaired_glucose_tolerance = 1 OR cfrd = 1 OR (fasting_blood_glucose_fbg < 126 AND post_prandial_pp >= 151 AND post_prandial_pp <= 200) OR (fasting_blood_glucose_fbg < 126 AND post_prandial_pp > 200) OR (fbg > 126 AND post_prandial_pp > 200) | criteria2sql |
CREATE TABLE table_45495 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What w... | SELECT "Location Attendance" FROM table_45495 WHERE "Game" = '6' | wikisql |
CREATE TABLE table_1153898_1 (
hub_base_class VARCHAR,
comparisons VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Is wireless combo keyboard and mouse support part of the hub base class?
| SELECT hub_base_class FROM table_1153898_1 WHERE comparisons = "Wireless Combo keyboard and mouse support" | sql_create_context |
CREATE TABLE table_name_90 (
marriage VARCHAR,
death VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the marriage of the person who died on 17 December 1471?
| SELECT marriage FROM table_name_90 WHERE death = "17 december 1471" | 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 prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time... | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'dra... | mimic_iii |
CREATE TABLE table_name_66 (
points INTEGER,
against VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Points when the against is less than 24 and played is less than 20?
| SELECT SUM(points) FROM table_name_66 WHERE against < 24 AND played < 20 | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | 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 = 'SLAVIC' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spri... | advising |
CREATE TABLE table_74754 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date is associated with the Spunk label?
| SELECT "Date" FROM table_74754 WHERE "Label" = 'spunk' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code v... | 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 = 'INDIANAPOLIS' AND date_day.day_number = 22 AND date_day.month_number = 3... | atis |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Customers_Cards (
card_id INTEGER,
... | SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code | nvbench |
CREATE TABLE table_35322 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Opponent in the Auckland, New Zealand Tournament?
| SELECT "Opponent" FROM table_35322 WHERE "Tournament" = 'auckland, new zealand' | wikisql |
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number,
secretary_vote number,
treasurer_vote number,
class_president_vote number,
class_senator_vote number
)
CREATE TABLE student (
stuid number,
... | SELECT MAX(age), MIN(age) FROM student WHERE major = 600 | spider |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDa... | SELECT COUNT(*) FROM Users WHERE DATEDIFF(day, LastAccessDate, CURRENT_TIMESTAMP()) < 30 | sede |
CREATE TABLE table_11734041_11 (
position VARCHAR,
years_for_rockets VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position for the player that played in 2006?
| SELECT position FROM table_11734041_11 WHERE years_for_rockets = "2006" | sql_create_context |
CREATE TABLE customers (
customer_id number,
payment_method text,
customer_name text,
date_became_customer time,
other_customer_details text
)
CREATE TABLE products (
product_id number,
product_details text
)
CREATE TABLE customer_orders (
order_id number,
customer_id number,
o... | SELECT COUNT(*) FROM customers | spider |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDis... | SELECT Posts.Id AS "post_link", Posts.CreationDate, Users.Id AS "user_link", Users.Reputation FROM Posts, Users WHERE Posts.OwnerUserId = Users.Id AND Users.Reputation >= '##MinReputation##' ORDER BY CreationDate DESC | sede |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Retur... | SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director | nvbench |
CREATE TABLE table_name_89 (
one_way VARCHAR,
miles_ INTEGER,
fans_took VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for miles [One Way] when the fans took 340?
| SELECT AVG(miles_) AS "one_way" FROM table_name_89 WHERE fans_took = "340" | sql_create_context |
CREATE TABLE table_26508 (
"Team" text,
"Location" text,
"Stadium" text,
"Capacity" real,
"Manager" text,
"Captain" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum capacity for Sangre Grande Ground?
| SELECT MIN("Capacity") FROM table_26508 WHERE "Stadium" = 'Sangre Grande Ground' | wikisql |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY COUNT(*) | nvbench |
CREATE TABLE book_club (
book_club_id int,
Year int,
Author_or_Editor text,
Book_Title text,
Publisher text,
Category text,
Result text
)
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,... | SELECT Director, COUNT(Director) FROM movie WHERE Year = 1999 OR Year = 2000 GROUP BY Director ORDER BY Director DESC | nvbench |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '孙子怡' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3407.67) | css |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Birth_Date text,
Birth_Place text
)
CREATE TABLE body_builder (
Body_Builder_ID int,
People_ID int,
Snatch real,
Clean_Jerk real,
Total real
)
-- Using valid SQLite, answer the following questions fo... | SELECT Snatch, Clean_Jerk FROM body_builder | nvbench |
CREATE TABLE table_261931_2 (
institution VARCHAR,
nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which institution's nickname is the Bobcats?
| SELECT institution FROM table_261931_2 WHERE nickname = "Bobcats" | sql_create_context |
CREATE TABLE table_7647 (
"Week" real,
"Date" text,
"Opponent" text,
"Game Site" text,
"Final Score" text,
"Record" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Attendance with a Week that is 18?
| SELECT "Attendance" FROM table_7647 WHERE "Week" = '18' | wikisql |
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester va... | SELECT name, COUNT(name) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY name ORDER BY COUNT(name) | nvbench |
CREATE TABLE table_name_48 (
years VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the years for dannevirke south school
| SELECT years FROM table_name_48 WHERE name = "dannevirke south school" | sql_create_context |
CREATE TABLE office_locations (
building_id number,
company_id number,
move_in_year number
)
CREATE TABLE companies (
id number,
name text,
headquarters text,
industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value_billion text
)
CRE... | SELECT industry FROM companies WHERE headquarters = "USA" INTERSECT SELECT industry FROM companies WHERE headquarters = "China" | spider |
CREATE TABLE table_27631756_2 (
captain VARCHAR,
kitmaker VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many captains have the kitmaker as n/a?
| SELECT COUNT(captain) FROM table_27631756_2 WHERE kitmaker = "N/A" | sql_create_context |
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type... | SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city | nvbench |
CREATE TABLE table_name_94 (
lost VARCHAR,
drawn VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Lost, when Drawn is '2', and when Points is '36'?
| SELECT lost FROM table_name_94 WHERE drawn = "2" AND points = "36" | sql_create_context |
CREATE TABLE table_21164 (
"Position" real,
"Driver / Passenger" text,
"Equipment" text,
"Bike No" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the driver passenger for 394 points
| SELECT "Driver / Passenger" FROM table_21164 WHERE "Points" = '394' | wikisql |
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
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3911) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CU... | mimic_iii |
CREATE TABLE table_train_13 (
"id" int,
"active_infection" bool,
"procalcitonin" int,
"receiving_vasopressor" bool,
"sepsis" bool,
"septic_shock" bool,
"age" float,
"lactate" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT * FROM table_train_13 WHERE age < 18 OR age > 80 | criteria2sql |
CREATE TABLE table_40332 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Attendance with a Result that is w 24-21?
| SELECT MAX("Attendance") FROM table_40332 WHERE "Result" = 'w 24-21' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '褚朋兴' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 5670.35) | css |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Walter Armbrust%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o... | advising |
CREATE TABLE table_name_96 (
location VARCHAR,
opponenent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the opponent Germany?
| SELECT location FROM table_name_96 WHERE opponenent = "germany" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | SELECT demographic.gender, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "7578" | mimicsql_data |
CREATE TABLE status (
station_id number,
bikes_available number,
docks_available number,
time text
)
CREATE TABLE station (
id number,
name text,
lat number,
long number,
dock_count number,
city text,
installation_date text
)
CREATE TABLE trip (
id number,
duration ... | SELECT start_station_name, end_station_name FROM trip ORDER BY id LIMIT 3 | spider |
CREATE TABLE table_name_88 (
surplus_deficit_ VARCHAR,
_percentage_gdp VARCHAR,
expenditure VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Surplus(Deficit) has an Expenditure larger than 45.8, and a Year smaller than 2011, and a %... | SELECT surplus_deficit_ FROM table_name_88 WHERE expenditure > 45.8 AND year < 2011 AND _percentage_gdp = "(0.9%)" | sql_create_context |
CREATE TABLE table_79798 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average cuts for top-25 more than 13 and top-5 less tha... | SELECT AVG("Cuts made") FROM table_79798 WHERE "Top-25" > '13' AND "Top-5" < '11' | wikisql |
CREATE TABLE table_28770 (
"Season #" real,
"Series #" real,
"Episode title" text,
"Original air date" text,
"Nick prod. #" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the episode originally air with a nick production number of 945?
| SELECT "Original air date" FROM table_28770 WHERE "Nick prod. #" = '945' | wikisql |
CREATE TABLE table_11207040_6 (
date_of_vacancy VARCHAR,
replaced_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What days are vacant that were replaced by john brown?
| SELECT date_of_vacancy FROM table_11207040_6 WHERE replaced_by = "John Brown" | sql_create_context |
CREATE TABLE table_203_350 (
id number,
"team #1" text,
"agg." text,
"team #2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- did the team larissa or the team panathinaikos score more total points ?
| SELECT "team #1" FROM table_203_350 WHERE "team #1" IN ('larissa', 'panathinaikos') ORDER BY "agg." DESC LIMIT 1 | squall |
CREATE TABLE table_39184 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Game of 4?
| SELECT "Date" FROM table_39184 WHERE "Game" = '4' | wikisql |
CREATE TABLE table_59239 (
"Team" text,
"P desc" real,
"P 2007" real,
"P Ap 2008" real,
"P Cl 2008" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of P desc with a P 2007 of 0,00 and a P, Ap 2008 less than 30,00, and a P CL 2008 that... | SELECT SUM("P desc") FROM table_59239 WHERE "P 2007" = '0,00' AND "P Ap 2008" < '30,00' AND "P Cl 2008" > '10,56' | wikisql |
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.admityear < "2119" | mimicsql_data |
CREATE TABLE table_name_30 (
bronze INTEGER,
silver VARCHAR,
total VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a total of the Bronze less than 4, gold more than 0, and no silver?
| SELECT SUM(bronze) FROM table_name_30 WHERE total < 4 AND gold > 0 AND silver = 0 | sql_create_context |
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
-- Using valid SQLite, answer the following questions for the ... | SELECT Name, Age FROM editor | nvbench |
CREATE TABLE table_64485 (
"interval name" text,
"size (steps)" real,
"size (cents)" real,
"just ratio" text,
"just (cents)" real,
"error" text,
"audio" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average size (cents) with an ... | SELECT AVG("size (cents)") FROM table_64485 WHERE "interval name" = 'major third' AND "size (steps)" > '5' | wikisql |
CREATE TABLE table_name_50 (
party VARCHAR,
results VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party is the person who was first elected in 2000 and was re-elected?
| SELECT party FROM table_name_50 WHERE results = "re-elected" AND first_elected = 2000 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "6" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_name_89 (
score VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for Jock Hutchison?
| SELECT score FROM table_name_89 WHERE player = "jock hutchison" | sql_create_context |
CREATE TABLE table_204_735 (
id number,
"rank" number,
"team" text,
"names" text,
"time" text,
"qualification" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many teams had at least five players ?
| SELECT COUNT("team") FROM table_204_735 WHERE "names" >= 5 | squall |
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 flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fli... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare 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 ... | atis |
CREATE TABLE table_49112 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Crowd" real,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date when the venue is gold coast... | SELECT "Date" FROM table_49112 WHERE "Venue" = 'gold coast convention centre' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number ... | SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'INSTHUM' AND course.number = 611 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE table_57646 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what day did a home team score 8.18 (66)?
| SELECT "Date" FROM table_57646 WHERE "Home team score" = '8.18 (66)' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | SELECT (SELECT t_kc22.QTY * t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '38892343383') = (SELECT t_kc22.AMOUNT FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '38892343383') | 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... | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4694071' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) D... | css |
CREATE TABLE table_name_29 (
minor_seventh VARCHAR,
major_third VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- A major third of C has what listed for the Minor seventh?
| SELECT minor_seventh FROM table_name_29 WHERE major_third = "c" | sql_create_context |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE city (
city_code varchar,
... | 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 = 'SAN FRANCISCO' AND date_day.day_number = 22 AND date_day.month_number = 3... | atis |
CREATE TABLE table_55028 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years was Denis Lawson nominated for an award?
| SELECT COUNT("Year") FROM table_55028 WHERE "Nominee" = 'denis lawson' | wikisql |
CREATE TABLE table_name_28 (
silver VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the Silver the Year Katie Curtis Unknown won the Bronze?
| SELECT silver FROM table_name_28 WHERE bronze = "katie curtis unknown" | sql_create_context |
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.... | css |
CREATE TABLE table_name_12 (
record VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who holds the record time of 24.521 and where was it made?
| SELECT record FROM table_name_12 WHERE time = "24.521" | sql_create_context |
CREATE TABLE table_name_90 (
money___$__ VARCHAR,
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Money for the T1 Player with a Score of 66-69-70-75=280?
| SELECT money___$__ FROM table_name_90 WHERE place = "t1" AND score = 66 - 69 - 70 - 75 = 280 | sql_create_context |
CREATE TABLE table_9545 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team was the opponent for the game played on September 19, 1999?
| SELECT "Opponent" FROM table_9545 WHERE "Date" = 'september 19, 1999' | wikisql |
CREATE TABLE furniture (
furniture_id number,
name text,
num_of_component number,
market_rate number
)
CREATE TABLE furniture_manufacte (
manufacturer_id number,
furniture_id number,
price_in_dollar number
)
CREATE TABLE manufacturer (
manufacturer_id number,
open_year number,
... | SELECT SUM(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2 | spider |
CREATE TABLE table_62855 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Transfer fee has a Moving from of youth system, an... | SELECT "Transfer fee" FROM table_62855 WHERE "Moving from" = 'youth system' AND "Nat." = 'mar' | wikisql |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY SUM(meter_100) DESC | nvbench |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airport_service (
city_code varchar,
... | 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 = 'NEWARK' AND date_day.day_number = 22 AND date_day.month_number = 6 AND d... | atis |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Laryngoscopy and other tracheoscopy" | mimicsql_data |
CREATE TABLE table_203_129 (
id number,
"finalist" text,
"age" number,
"from" text,
"dress colour" text,
"status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many finalists are under the age of 25 ?
| SELECT COUNT("finalist") FROM table_203_129 WHERE "age" < 25 | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" | mimicsql_data |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Comments (
Id number,
PostId number,
... | SELECT t1.TagName AS Tag, t2.TagName AS "Related Tag", COUNT(t2.TagName) AS "Count" FROM PostTags AS pt1 INNER JOIN Tags AS t1 ON pt1.TagId = t1.Id INNER JOIN PostTags AS pt2 ON pt1.PostId = pt2.PostId AND pt1.TagId != pt2.TagId INNER JOIN Tags AS t2 ON pt2.TagId = t2.Id INNER JOIN Posts AS A ON pt2.PostId = A.Id WHERE... | sede |
CREATE TABLE tracks (
name VARCHAR,
genre_id VARCHAR
)
CREATE TABLE genres (
id VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the name of tracks belongs to genre Rock or genre Jazz.
| SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock" OR T1.name = "Jazz" | sql_create_context |
CREATE TABLE table_name_65 (
draw VARCHAR,
rank VARCHAR,
dance_styles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many draws has lower than rank 10 in rumba/cha-cha/jazz dance?
| SELECT COUNT(draw) FROM table_name_65 WHERE rank < 10 AND dance_styles = "rumba/cha-cha/jazz dance" | sql_create_context |
CREATE TABLE table_name_1 (
result VARCHAR,
week VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the Chiefs pre-Week 16 game that 69,362 people attended?
| SELECT result FROM table_name_1 WHERE week < 16 AND attendance = "69,362" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '彭清舒' AND t_kc21.IN_HOSP_DATE BETWEEN '2008-01-14' AND '2019-02-22' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_name_16 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the away team at the MCG?
| SELECT away_team AS score FROM table_name_16 WHERE venue = "mcg" | sql_create_context |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id ... | SELECT FLOOR(LENGTH(Body) / 500) * 500 AS "post_length", COUNT(Id) AS "amount_of_posts" FROM Posts WHERE PostTypeId = 2 GROUP BY FLOOR(LENGTH(Body) / 500) * 500 ORDER BY 'amount_of_posts' DESC | sede |
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 time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT wdmzjzjlb.JLSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '79366019227' UNION SELECT bdmzjzjlb.JLSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '79366019227' | css |
CREATE TABLE table_32653 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the crowd was larger than 20,915 what did t... | SELECT "Away team score" FROM table_32653 WHERE "Crowd" > '20,915' | wikisql |
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE volume (
Volume_ID int,
V... | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY COUNT(Category) DESC | nvbench |
CREATE TABLE table_204_783 (
id number,
"position" text,
"player" text,
"free agency\ntag" text,
"date signed" text,
"2013 team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- nick roach was signed the same day as what other player ?
| SELECT "player" FROM table_204_783 WHERE "player" <> 'nick roach' AND "date signed" = (SELECT "date signed" FROM table_204_783 WHERE "player" = 'nick roach') | squall |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | SELECT DISTINCT course.department, course.name, course.number 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.ins... | advising |
CREATE TABLE table_name_30 (
recipient VARCHAR,
award VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the 2010 Kids' Choice Awards?
| SELECT recipient FROM table_name_30 WHERE award = "2010 kids' choice awards" AND result = "won" | sql_create_context |
CREATE TABLE table_name_11 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the away team when the home team is luton town?
| SELECT away_team FROM table_name_11 WHERE home_team = "luton town" | sql_create_context |
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 WHERE (((flight.departure_time BETWEEN 2200 AND 1800) AND date_day.day_number = 8 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_n... | atis |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH ... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.