instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_76841 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the away team geelong?
| SELECT "Date" FROM table_76841 WHERE "Away team" = 'geelong' | wikisql |
CREATE TABLE table_18018214_2 (
loses VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List total loses forh the tauras taurag team.
| SELECT COUNT(loses) FROM table_18018214_2 WHERE club = "Tauras Tauragė" | sql_create_context |
CREATE TABLE table_name_18 (
round VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which round has the record of 5-0?
| SELECT round FROM table_name_18 WHERE record = "5-0" | sql_create_context |
CREATE TABLE table_12165999_1 (
position VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position does Syracuse's player have?
| SELECT position FROM table_12165999_1 WHERE college = "Syracuse" | sql_create_context |
CREATE TABLE table_name_54 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home team has an Away team of melbourne?
| SELECT home_team FROM table_name_54 WHERE away_team = "melbourne" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-3407')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.cel... | eicu |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Delet... | SELECT Users.DisplayName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Tags.Id = 34113 AND Posts.CreationDate > '201... | sede |
CREATE TABLE table_17531 (
"Number" real,
"Name" text,
"Titles" text,
"Date" text,
"Opponent" text,
"Result" text,
"Defenses" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent when the result was ud 12/12 and date was 1993-... | SELECT "Opponent" FROM table_17531 WHERE "Result" = 'UD 12/12' AND "Date" = '1993-05-22' | wikisql |
CREATE TABLE table_name_27 (
season VARCHAR,
poles INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Season was the Poles greater than 14?
| SELECT season FROM table_name_27 WHERE poles > 14 | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE diagnoses_icd (
... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') AND STRFTIME('%y-%m', labevents.charttime) >= '2105-03' ORDER B... | mimic_iii |
CREATE TABLE table_4029 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Area" real,
"Population" real,
"Density" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pinyin name for the english name xin co... | SELECT "Pinyin" FROM table_4029 WHERE "English Name" = 'Xin County' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
ni... | 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 AS DATE_DAY_0, date_day AS DATE_DAY_1, date_day AS DATE_DAY_2, date_day AS DATE_DAY_3, date_day AS DATE_DAY_4, days AS DAYS_0, days AS DAYS_1, days AS DAYS_2, days A... | atis |
CREATE TABLE table_name_35 (
year INTEGER,
points VARCHAR,
chassis VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the latest year that a Bardahl entrant had a Kurtis Kraft 500c chassis with no more than 0 points?
| SELECT MAX(year) FROM table_name_35 WHERE chassis = "kurtis kraft 500c" AND entrant = "bardahl" AND points < 0 | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient... | eicu |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "2" AND procedures.icd9_code = "9744" | mimicsql_data |
CREATE TABLE table_75931 (
"Rank" real,
"Name" text,
"Years" text,
"Matches" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Rank of the player with 158 Goals in more than 362 Matches?
| SELECT COUNT("Rank") FROM table_75931 WHERE "Goals" = '158' AND "Matches" > '362' | wikisql |
CREATE TABLE table_24724 (
"Year" real,
"Film" text,
"Budget" text,
"Domestic Box Office" text,
"Foreign Box Office" text,
"Total" text,
"US DVD sales" text,
"Total (with DVD sales)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What wa... | SELECT "Domestic Box Office" FROM table_24724 WHERE "Film" = 'House on Haunted Hill' | wikisql |
CREATE TABLE table_431 (
"Rnd" real,
"Circuit" text,
"CA Winning Team" text,
"GT1 Winning Team" text,
"GT2 Winning Team" text,
"GT3 Winning Team" text,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of gt1 winnin... | SELECT COUNT("GT1 Winning Team") FROM table_431 WHERE "Rnd" = '5' | wikisql |
CREATE TABLE table_2803662_3 (
type VARCHAR,
town VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When stuttgart is the town what is the type?
| SELECT type FROM table_2803662_3 WHERE town = "Stuttgart" | sql_create_context |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number... | SELECT MAX(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 = 23858)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2... | mimic_iii |
CREATE TABLE table_43182 (
"Year" real,
"Class" text,
"Team" text,
"Machine" text,
"Points" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Team with a Machine that is nsr250 and has Points of 8?
| SELECT "Team" FROM table_43182 WHERE "Machine" = 'nsr250' AND "Points" = '8' | wikisql |
CREATE TABLE table_name_29 (
report VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the report for Challenge Stadium?
| SELECT report FROM table_name_29 WHERE venue = "challenge stadium" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT SUM(OVE_PAY) FROM t_kc24 WHERE PERSON_ID = '88637428' AND CLINIC_SLT_DATE BETWEEN '2001-02-02' AND '2019-04-19' | css |
CREATE TABLE table_13665809_2 (
season INTEGER,
byu_uu_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the maximum season with byu-uu score being 20 17 byu #19
| SELECT MAX(season) FROM table_13665809_2 WHERE byu_uu_score = "20–17 BYU #19" | sql_create_context |
CREATE TABLE table_name_58 (
total VARCHAR,
rank VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the sum of total where the rank is over 9 and the gold is less than 1?
| SELECT COUNT(total) FROM table_name_58 WHERE rank > 9 AND gold < 1 | sql_create_context |
CREATE TABLE table_28220778_21 (
high_rebounds VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people had high rebounds in game 14?
| SELECT COUNT(high_rebounds) FROM table_28220778_21 WHERE game = 14 | sql_create_context |
CREATE TABLE table_name_18 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score has October 31 as the date?
| SELECT score FROM table_name_18 WHERE date = "october 31" | sql_create_context |
CREATE TABLE table_77888 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Time/Retired of Carlos Reutemann who was driving a brabham - Alfa Romeo?
| SELECT "Time/Retired" FROM table_77888 WHERE "Constructor" = 'brabham - alfa romeo' AND "Driver" = 'carlos reutemann' | wikisql |
CREATE TABLE table_4820 (
"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.
-- What is the away team's score when the home team ... | SELECT "Away team" FROM table_4820 WHERE "Home team score" = '18.12 (120)' | wikisql |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnon... | SELECT Title, Body, PostId AS "post_link" FROM Votes JOIN VoteTypes ON VoteTypeId = VoteTypes.Id JOIN Posts ON PostId = Posts.Id WHERE UserId = '##UserId##' | sede |
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... | SELECT Name, Weight FROM people ORDER BY Weight DESC | nvbench |
CREATE TABLE table_name_88 (
games INTEGER,
number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Games is the lowest one that has a Number of 98?
| SELECT MIN(games) AS ↑ FROM table_name_88 WHERE number = 98 | sql_create_context |
CREATE TABLE table_dev_42 (
"id" int,
"gender" string,
"depression" bool,
"familial_hypercholesterolemia" bool,
"microalbuminuria" int,
"renal_disease" bool,
"diabetic" string,
"estimated_glomerular_filtration_rate_egfr" int,
"serum_creatinine" float,
"fbg" int,
"body_mass_in... | SELECT * FROM table_dev_42 WHERE diabetic = 'ii' AND depression = 1 AND body_mass_index_bmi < 44 AND (age >= 21 AND age <= 65) AND gender = 'female' | criteria2sql |
CREATE TABLE table_24440361_1 (
total_kurdistan_list INTEGER,
governorate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most kirdistan list for diyala
| SELECT MAX(total_kurdistan_list) FROM table_24440361_1 WHERE governorate = "Diyala" | sql_create_context |
CREATE TABLE table_26808178_3 (
series__number INTEGER,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which series # had 0.645 U.S. viewers(millions)?
| SELECT MAX(series__number) FROM table_26808178_3 WHERE us_viewers__millions_ = "0.645" | sql_create_context |
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 varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE Bookings_Services (
Order_ID INTEGER,
Product_ID INTEGER
)
CREATE TABLE Customer_Orders (
Order_ID INTEGER,
Customer_ID INTEGER,
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CRE... | SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name ORDER BY AVG(Product_Price) | 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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '葛安易' AND t_kc22.STA_DATE BETWEEN '2000-07-27' AND '2006-10-24' AND t_kc22.SELF_PAY_AMO > 1217.85 | css |
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE election (
... | SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller ORDER BY Comptroller DESC | nvbench |
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 ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TAB... | SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se... | advising |
CREATE TABLE table_name_13 (
publisher VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who published Weird War Tales?
| SELECT publisher FROM table_name_13 WHERE title = "weird war tales" | sql_create_context |
CREATE TABLE table_name_87 (
method VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What method had a record 12-2-3?
| SELECT method FROM table_name_87 WHERE record = "12-2-3" | sql_create_context |
CREATE TABLE table_77123 (
"Date" text,
"Opponent#" text,
"Site" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date when the site is memorial stadium minneapolis, mn, and the Attendance is 53,192?
| SELECT "Date" FROM table_77123 WHERE "Site" = 'memorial stadium • minneapolis, mn' AND "Attendance" = '53,192' | wikisql |
CREATE TABLE table_78499 (
"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.
-- Which away team scored 12.18 (90)?
| SELECT "Away team" FROM table_78499 WHERE "Away team score" = '12.18 (90)' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "LEFT FEMUR FRACTURE" AND procedures.icd9_code = "8848" | mimicsql_data |
CREATE TABLE Customers (
customer_id INTEGER,
payment_method_code VARCHAR(10),
customer_code VARCHAR(20),
customer_name VARCHAR(80),
customer_address VARCHAR(255),
customer_phone VARCHAR(80),
customer_email VARCHAR(80)
)
CREATE TABLE Department_Store_Chain (
dept_store_chain_id INTEGER,... | SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_6421 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the difference associated with more than 2 losses and more than 1 point?
| SELECT "Points difference" FROM table_6421 WHERE "Lost" > '2' AND "Points" > '1' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.... | css |
CREATE TABLE Ref_Hotel_Star_Ratings (
star_rating_code CHAR(15),
star_rating_description VARCHAR(80)
)
CREATE TABLE Theme_Parks (
Theme_Park_ID INTEGER,
Theme_Park_Details VARCHAR(255)
)
CREATE TABLE Shops (
Shop_ID INTEGER,
Shop_Details VARCHAR(255)
)
CREATE TABLE Visits (
Visit_ID INTEG... | SELECT hotel_id, star_rating_code FROM Hotels ORDER BY price_range | nvbench |
CREATE TABLE table_22122 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" real,
"Viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episode t... | SELECT "Directed by" FROM table_22122 WHERE "Title" = 'Smells Like Teen Sellout' | wikisql |
CREATE TABLE table_name_8 (
event VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tournement was held in Helsinki, Finland in 2005?
| SELECT event FROM table_name_8 WHERE venue = "helsinki, finland" | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 92788 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_51965 (
"State" text,
"Norwegian Americans (2000)" real,
"Percent (2000)" text,
"Norwegian Americans (2009)" real,
"Percent (2009)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which state has a Percent (2009) of 6.2%?
| SELECT "State" FROM table_51965 WHERE "Percent (2009)" = '6.2%' | wikisql |
CREATE TABLE table_name_51 (
laps VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps did Dick Rathmann complete when he ranked 14?
| SELECT laps FROM table_name_51 WHERE rank = "14" | sql_create_context |
CREATE TABLE table_21995420_9 (
stunts VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the school is Central Colleges of the Philippines CCP Bobcats, what is the stunts number?
| SELECT stunts FROM table_21995420_9 WHERE school = "Central Colleges of the Philippines CCP Bobcats" | sql_create_context |
CREATE TABLE table_1417184_1 (
canton VARCHAR,
commune VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many canton with commune being waldbillig
| SELECT COUNT(canton) FROM table_1417184_1 WHERE commune = "Waldbillig" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | SELECT TagName FROM Tags WHERE Count = 1 AND ExcerptPostId IS NULL AND WikiPostId IS NULL ORDER BY Id | sede |
CREATE TABLE table_name_60 (
story_title VARCHAR,
letterer_s VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Story Title that has Albers as the Letterer?
| SELECT story_title FROM table_name_60 WHERE letterer_s = "albers" | sql_create_context |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE... | 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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_... | atis |
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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.days_stay > "15" | mimicsql_data |
CREATE TABLE table_1745843_10 (
part_1 VARCHAR,
class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is part 1 of the verb in class 7b
| SELECT part_1 FROM table_1745843_10 WHERE class = "7b" | sql_create_context |
CREATE TABLE table_59828 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has an Attendance larger than 51,338, and an Opponent of manchester united?
| SELECT "Date" FROM table_59828 WHERE "Attendance" > '51,338' AND "Opponent" = 'manchester united' | wikisql |
CREATE TABLE table_name_53 (
opera VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percentage of browsers were using Opera in October 2010?
| SELECT opera FROM table_name_53 WHERE date = "october 2010" | sql_create_context |
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
... | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY Trade_Name | nvbench |
CREATE TABLE Engineer_Skills (
engineer_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Third_Party_Companies (
company_id INTEGER,
company_type VARCHAR(5),
company_name VARCHAR(255),
company_address VARCHAR(255),
other_company_details VARCHAR(255)
)
CREATE TABLE Engineer_Visits (
engineer... | SELECT COUNT(*), company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id = T2.supplier_company_id GROUP BY T1.company_id | nvbench |
CREATE TABLE table_204_976 (
id number,
"pos" text,
"driver" text,
"entrant" text,
"constructor" text,
"time/retired" text,
"grid" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many racers had cooper climax as their constructor ?
| SELECT COUNT("driver") FROM table_204_976 WHERE "constructor" = 'cooper-climax' | squall |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '鲁霞飞' AND hz_info.YLJGDM = '8557825' AND NOT zyjzjlb.JZKSMC LIKE '%导管%' | css |
CREATE TABLE table_25716397_1 (
title VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many titles does the episode written by Joe Toplyn have?
| SELECT COUNT(title) FROM table_25716397_1 WHERE written_by = "Joe Toplyn" | sql_create_context |
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_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE microbiologyevents (
row_id number,
su... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'ceftazidime' AND STRFTIME('%y', prescriptions.startdate) >= '2105' | mimic_iii |
CREATE TABLE table_204_250 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when is the first game ?
| SELECT "date" FROM table_204_250 WHERE id = 1 | squall |
CREATE TABLE table_name_46 (
rank INTEGER,
name VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average rank of Elise Matthysen in lanes under 8?
| SELECT AVG(rank) FROM table_name_46 WHERE name = "elise matthysen" AND lane < 8 | sql_create_context |
CREATE TABLE table_204_188 (
id number,
"rank" number,
"player" text,
"points" number,
"points defending" number,
"points won" number,
"new points" number,
"withdrew due to" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who came in firs... | SELECT "player" FROM table_204_188 ORDER BY "new points" DESC LIMIT 1 | squall |
CREATE TABLE table_33528 (
"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.
-- What was the average crowd size for the game whe... | SELECT AVG("Crowd") FROM table_33528 WHERE "Away team score" = '10.11 (71)' | wikisql |
CREATE TABLE table_name_81 (
status VARCHAR,
against VARCHAR,
opposing_teams VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the status when Wales is the opposing team and there are more than 13 against?
| SELECT status FROM table_name_81 WHERE against > 13 AND opposing_teams = "wales" | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE fare (
fare_id int,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | atis |
CREATE TABLE table_58535 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text,
"Apparent magnitude" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the c... | SELECT "Constellation" FROM table_58535 WHERE "NGC number" < '5457' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-16737')) AND treatment.treatmentname = 'surgery consultation' AND DATETI... | eicu |
CREATE TABLE table_name_65 (
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was fitzroy the away team?
| SELECT date FROM table_name_65 WHERE away_team = "fitzroy" | sql_create_context |
CREATE TABLE table_name_68 (
injured VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many are injured in Borneo?
| SELECT injured FROM table_name_68 WHERE location = "borneo" | sql_create_context |
CREATE TABLE table_name_44 (
year_made VARCHAR,
wheel_arrangement VARCHAR,
quantity_made VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year had a quantity made of 11 and a wheel arrangement of 4-6-2?
| SELECT year_made FROM table_name_44 WHERE wheel_arrangement = "4-6-2" AND quantity_made = "11" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.days_stay = "29" | mimicsql_data |
CREATE TABLE table_6022 (
"Rank" real,
"Rider" text,
"Manufacturer" text,
"Points" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Rider of st phane mertens had what lowest points?
| SELECT MIN("Points") FROM table_6022 WHERE "Rider" = 'stéphane mertens' | wikisql |
CREATE TABLE table_name_57 (
high_assists VARCHAR,
high_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is High Assists, when High Points is Keon Clark (19)?
| SELECT high_assists FROM table_name_57 WHERE high_points = "keon clark (19)" | sql_create_context |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester i... | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department LIKE '%KINESLGY%' AND program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id | advising |
CREATE TABLE table_name_7 (
interview INTEGER,
state VARCHAR,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most interview for minnesota and average more than 7.901
| SELECT MAX(interview) FROM table_name_7 WHERE state = "minnesota" AND average > 7.901 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND procedures.short_title = "Cnt intraart bld gas mon" | mimicsql_data |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | SELECT Time, ID FROM swimmer ORDER BY Time DESC | nvbench |
CREATE TABLE table_name_16 (
high_rebounds VARCHAR,
game VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the most rebounds in the game against Phoenix with a number over 76?
| SELECT high_rebounds FROM table_name_16 WHERE game > 76 AND team = "phoenix" | sql_create_context |
CREATE TABLE table_2114308_1 (
episode VARCHAR,
run_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the episode for run time of 22:50
| SELECT episode FROM table_2114308_1 WHERE run_time = "22:50" | sql_create_context |
CREATE TABLE table_name_69 (
new_classification VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the new classification for La Mirada, California?
| SELECT new_classification FROM table_name_69 WHERE location = "la mirada, california" | sql_create_context |
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 hz_info.person_info_XM FROM hz_info JOIN zyjzjlb JOIN jybgb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '59958686158' | css |
CREATE TABLE table_30267 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college did Francis Bellefroid go to?
| SELECT "College" FROM table_30267 WHERE "Player" = 'Francis Bellefroid' | wikisql |
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End_Date DATE
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,
Amount_Payment INTEGE... | SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Claimed > (SELECT AVG(Amount_Claimed) FROM Claims) ORDER BY COUNT(Date_Claim_Made) DESC | nvbench |
CREATE TABLE table_43745 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Grid, when Time is +43.191, and when Laps is less than 22?
| SELECT COUNT("Grid") FROM table_43745 WHERE "Time" = '+43.191' AND "Laps" < '22' | wikisql |
CREATE TABLE table_64373 (
"Chord" text,
"Root" text,
"Major third" text,
"Augmented fifth" text,
"Minor seventh" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The Major third of D has what for the Augmented fifth?
| SELECT "Augmented fifth" FROM table_64373 WHERE "Major third" = 'd' | wikisql |
CREATE TABLE pitstops (
driverid VARCHAR
)
CREATE TABLE results (
driverid VARCHAR
)
CREATE TABLE drivers (
surname VARCHAR,
driverid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the drivers' last names and id who had 11 pit stops and pa... | SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) = 11 INTERSECT SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5 | sql_create_context |
CREATE TABLE table_30789 (
"Player" text,
"Matches" real,
"Innings" real,
"Runs" real,
"Average" text,
"Highest Score" text,
"100s" real,
"50s" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many runs are there when the 50s column is... | SELECT MIN("Runs") FROM table_30789 WHERE "50s" = '3' | wikisql |
CREATE TABLE table_56542 (
"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.
-- What was the largest crowd that was in attendanc... | SELECT MAX("Crowd") FROM table_56542 WHERE "Home team" = 'fitzroy' | wikisql |
CREATE TABLE table_2076595_1 (
location_s_ VARCHAR,
control VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the public schools with a master's university?
| SELECT location_s_ FROM table_2076595_1 WHERE control = "Public" AND type = "Master's university" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '009-7776') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medicat... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.