instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE gwyjzb (
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 gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '8056118' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY... | css |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '3982610' AND JZKSRQ BETWEEN '2016-01-19' AND '2018-02-22' AND ZSEBZ > 0 | css |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicatio... | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-114154')) AND DATETIME(allergy.allergytime) <= DATETIME(CURRENT_TIME(), '-56... | eicu |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'c-reactive protein')) AND STRFTIME('%y', cost.chargetime) >= '2102' GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE table_69446 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type is the race with the vicenza to marostica course?
| SELECT "Type" FROM table_69446 WHERE "Course" = 'vicenza to marostica' | wikisql |
CREATE TABLE table_16654785_2 (
average_climb___percentage_ INTEGER,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average climb for Tenbosse?
| SELECT MIN(average_climb___percentage_) FROM table_16654785_2 WHERE name = "Tenbosse" | sql_create_context |
CREATE TABLE table_name_94 (
tied INTEGER,
points VARCHAR,
games VARCHAR,
goals_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least tied with games more than 70 and goals for less than 310 with points of 98
| SELECT MIN(tied) FROM table_name_94 WHERE games > 70 AND goals_for < 310 AND points = 98 | sql_create_context |
CREATE TABLE table_10577579_3 (
left VARCHAR,
women’s_nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the left of the Lady Pilots.
| SELECT left FROM table_10577579_3 WHERE women’s_nickname = "Lady Pilots" | 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 COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '4804151' AND mzjzjlb.JZKSRQ BETWEEN '2014-02-08' AND '2016-04-24' AND mzjzjlb.WDBZ > 0 | css |
CREATE TABLE table_name_22 (
season INTEGER,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most recent year with a finish in 2nd position?
| SELECT MAX(season) FROM table_name_22 WHERE position = "2nd" | sql_create_context |
CREATE TABLE table_21089 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the latitude of laima tessera
| SELECT "Latitude" FROM table_21089 WHERE "Name" = 'Laima Tessera' | wikisql |
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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int... | SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY Country | nvbench |
CREATE TABLE table_49394 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was part 4 when part 3 was *hleupun?
| SELECT "Part 4" FROM table_49394 WHERE "Part 3" = '*hleupun' | wikisql |
CREATE TABLE table_57288 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the college for carl hagelin
| SELECT "College/Junior/Club Team (League)" FROM table_57288 WHERE "Player" = 'carl hagelin' | wikisql |
CREATE TABLE table_12576536_1 (
population__maryborough_ VARCHAR,
population__woocoo_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the population of maryborough when population of woocoo is 2700
| SELECT population__maryborough_ FROM table_12576536_1 WHERE population__woocoo_ = 2700 | sql_create_context |
CREATE TABLE table_name_12 (
top_5 INTEGER,
events INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With events less than 0, what is the fewest Top-5?
| SELECT MIN(top_5) FROM table_name_12 WHERE events < 0 | sql_create_context |
CREATE TABLE table_58743 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Incumbent, when Results is 'Re-Elected', when Party is 'Democratic', and when District... | SELECT "Incumbent" FROM table_58743 WHERE "Results" = 're-elected' AND "Party" = 'democratic' AND "District" = 'minnesota 7' | wikisql |
CREATE TABLE table_name_33 (
week VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week has December 19, 2004 as the date?
| SELECT week FROM table_name_33 WHERE date = "december 19, 2004" | sql_create_context |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Name, Capacity FROM cinema | nvbench |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number... | SELECT DISTINCT T1.advisor FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.treasurer_vote WHERE T2.election_cycle = "Spring" | spider |
CREATE TABLE table_45058 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was hayley ericksen's score?
| SELECT "Score" FROM table_45058 WHERE "Partner" = 'hayley ericksen' | wikisql |
CREATE TABLE table_name_77 (
venue VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue of the 1990 Asian games?
| SELECT venue FROM table_name_77 WHERE competition = "1990 asian games" | sql_create_context |
CREATE TABLE table_203_671 (
id number,
"name" text,
"rank" text,
"age" number,
"years until mandatory retirement" text,
"appointed by" text,
"year appointed" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long did roberto feliberti ci... | SELECT "years until mandatory retirement" FROM table_203_671 WHERE "name" = 'roberto feliberti cintron' | squall |
CREATE TABLE table_20630462_1 (
tier_iv_in VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tier IV year for the tournament held in Tampa?
| SELECT tier_iv_in FROM table_20630462_1 WHERE tournament = "Tampa" | sql_create_context |
CREATE TABLE table_name_50 (
qual_1 VARCHAR,
best VARCHAR,
qual_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which qualifying 1 time has a best under 58.669 and a qualifying 2 time under 57.897?
| SELECT qual_1 FROM table_name_50 WHERE best < 58.669 AND qual_2 < 57.897 | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID ... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_22801165_1 (
date VARCHAR,
cowboys_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the Cowboys score 13 points in 1966?
| SELECT date FROM table_22801165_1 WHERE cowboys_points = 13 | sql_create_context |
CREATE TABLE table_24027047_1 (
population_density___km²_2011_ VARCHAR,
area__km²__2011 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the population density in km2 for 2011 in the division where area in km2 was 684.37 in 2011?
| SELECT population_density___km²_2011_ FROM table_24027047_1 WHERE area__km²__2011 * * = "684.37" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT demographic.insurance FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_8590 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With th... | SELECT "High assists" FROM table_8590 WHERE "Game" < '16' | wikisql |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Par... | SELECT p.AcceptedAnswerId AS "post_link", p.OwnerUserId AS "user_link" FROM Posts AS p WHERE NOT p.OwnerUserId IS NULL AND p.AcceptedAnswerId NOT IN (SELECT v.PostId FROM Votes AS v WHERE v.VoteTypeId = 1) AND p.AcceptedAnswerId NOT IN (SELECT q.Id FROM Posts AS q WHERE q.OwnerUserId = p.OwnerUserId) ORDER BY p.Accepte... | sede |
CREATE TABLE table_21321804_3 (
player VARCHAR,
cfl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player plays for the Winnipeg Blue Bombers?
| SELECT player FROM table_21321804_3 WHERE cfl_team = "Winnipeg Blue Bombers" | sql_create_context |
CREATE TABLE table_24856090_1 (
average INTEGER,
hk_viewers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest average for the episode with 1.97 million Hong Kong viewers?
| SELECT MAX(average) FROM table_24856090_1 WHERE hk_viewers = "1.97 million" | sql_create_context |
CREATE TABLE table_name_34 (
record VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record at the game that had a loss of Lemanczyk (0 1)?
| SELECT record FROM table_name_34 WHERE loss = "lemanczyk (0–1)" | sql_create_context |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '45714321' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2014-09-08') | css |
CREATE TABLE table_35261 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Nation of total has what sum of gold?
| SELECT SUM("Gold") FROM table_35261 WHERE "Nation" = 'total' | wikisql |
CREATE TABLE table_27940569_1 (
pts_bns VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points and bonuses did Kurt Busch get?
| SELECT pts_bns FROM table_27940569_1 WHERE driver = "Kurt Busch" | sql_create_context |
CREATE TABLE table_name_61 (
natural_change__per_1000_ VARCHAR,
crude_death_rate__per_1000_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the natural change (per 1000) when the crude death rate (per 1000) is 10?
| SELECT natural_change__per_1000_ FROM table_name_61 WHERE crude_death_rate__per_1000_ = 10 | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostLinks (
Id number,
Crea... | SELECT u.DisplayName, 'http://stackoverflow.com/users/' + CAST(u.Id AS TEXT(255)) AS "httplink", u.Reputation, COUNT(p.Title) AS "questions_answered" FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id INNER JOIN Posts AS ans ON p.Id = ans.ParentId INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags... | sede |
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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "49" AND diagnoses.icd9_code = "29590" | mimicsql_data |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794) AND icustays.outtime IS NULL)... | mimic_iii |
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_ID int,
Rank i... | SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY Headquarters DESC | nvbench |
CREATE TABLE table_203_513 (
id number,
"no." number,
"date" text,
"home team" text,
"visiting team" text,
"goals" text,
"score" text,
"result" text,
"venue" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what... | SELECT "competition" FROM table_203_513 WHERE id = 1 | squall |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb 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 WHERE person_... | css |
CREATE TABLE table_13836704_7 (
international_passengers VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of passengers of the airport ranked 15?
| SELECT international_passengers FROM table_13836704_7 WHERE rank = 15 | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ACC' AND course.number = 990 AND semester.semester = 'Winter' AND semester.semester_id = course_offering.semester AND semester.year = 2014 | advising |
CREATE TABLE table_204_961 (
id number,
"title" text,
"director" text,
"production" text,
"music" text,
"cast" text,
"release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what film was released before devakanya ?
| SELECT "title" FROM table_204_961 WHERE id = (SELECT id FROM table_204_961 WHERE "title" = 'devakanya') - 1 | squall |
CREATE TABLE races (
raceId INTEGER,
year INTEGER,
round INTEGER,
circuitId INTEGER,
name TEXT,
date TEXT,
time TEXT,
url TEXT
)
CREATE TABLE driverStandings (
driverStandingsId INTEGER,
raceId INTEGER,
driverId INTEGER,
points REAL,
position INTEGER,
positionTex... | SELECT year, COUNT(year) FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1.year > 2014 GROUP BY year ORDER BY year DESC | nvbench |
CREATE TABLE table_name_68 (
result VARCHAR,
goal VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Result where Goal is 9?
| SELECT result FROM table_name_68 WHERE goal = 9 | sql_create_context |
CREATE TABLE table_name_50 (
h_a_n VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is H/A/N, when Date is October 31?
| SELECT h_a_n FROM table_name_50 WHERE date = "october 31" | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
dep... | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 574 AND course_offering.semester = semester.semester_id AND semester.semester_id > (SELECT SEMESTERalias1.semester_id FROM semeste... | advising |
CREATE TABLE table_24682 (
"No" real,
"Driver" text,
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The Maserati 4cl's minimum no was?
| SELECT MIN("No") FROM table_24682 WHERE "Chassis" = 'Maserati 4CL' | wikisql |
CREATE TABLE camera_lens (
focal_length_mm INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many camera lenses have a focal length longer than 15 mm?
| SELECT COUNT(*) FROM camera_lens WHERE focal_length_mm > 15 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006')) AND intakeoutput.cellpath LIKE '%intake%... | eicu |
CREATE TABLE table_name_55 (
performer_1 VARCHAR,
performer_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Performer 2 of compilation 1 had what performer 1?
| SELECT performer_1 FROM table_name_55 WHERE performer_2 = "compilation 1" | sql_create_context |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATE... | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions ORDER BY COUNT(date_of_transaction) | nvbench |
CREATE TABLE table_45668 (
"Macedonian population in Vojvodina" text,
"1961" real,
"Number 1971" real,
"1981" real,
"1991" real,
"2002" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest 1971 number of the Macedonian population wi... | SELECT MIN("Number 1971") FROM table_45668 WHERE "2002" > '133' AND "1991" < '171' | wikisql |
CREATE TABLE table_60981 (
"Date" text,
"Opponent#" text,
"Rank #" text,
"Site" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT DATE HAD 6 RANK?
| SELECT "Date" FROM table_60981 WHERE "Rank #" = '6' | wikisql |
CREATE TABLE table_name_75 (
torque VARCHAR,
model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the torque@rpm of the sl 65 amg?
| SELECT torque AS @rpm FROM table_name_75 WHERE model = "sl 65 amg" | sql_create_context |
CREATE TABLE table_25020 (
"Year" real,
"1st Venue" text,
"2nd Venue" text,
"3rd Venue" text,
"4th Venue" text,
"5th Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many 5th venue cities were there when Doha was the 1st venue city?
| SELECT COUNT("5th Venue") FROM table_25020 WHERE "1st Venue" = 'Doha' | wikisql |
CREATE TABLE table_26533354_8 (
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the position for stanley havili
| SELECT position FROM table_26533354_8 WHERE player = "Stanley Havili" | sql_create_context |
CREATE TABLE table_36790 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of silver values that have bronze values under 4, golds over 2, and a rank o... | SELECT SUM("Silver") FROM table_36790 WHERE "Bronze" < '4' AND "Rank" = '3' AND "Gold" > '2' | wikisql |
CREATE TABLE table_16529 (
"Year" text,
"Champion" text,
"Score" text,
"Runner-Up" text,
"Location" text,
"Semi-Finalist #1" text,
"Semi-Finalist #2" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the runner-up where location is ellen... | SELECT "Runner-Up" FROM table_16529 WHERE "Location" = 'Ellenton, FL' AND "Year" = '2004' | wikisql |
CREATE TABLE table_48714 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game has an Attendance smaller than 18,2... | SELECT MAX("Game") FROM table_48714 WHERE "Attendance" < '18,277' AND "Points" = '64' | wikisql |
CREATE TABLE table_name_5 (
seats_2006 INTEGER,
parties_and_voter_communities VARCHAR,
_percentage_2006 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of Seats 2006 held by the communities of B rger F r Gro -Rohrheim Party/Vote... | SELECT MAX(seats_2006) FROM table_name_5 WHERE parties_and_voter_communities = "bürger für groß-rohrheim" AND _percentage_2006 < 21.3 | sql_create_context |
CREATE TABLE table_49584 (
"Nat." text,
"Name" text,
"Moving to" text,
"Type" text,
"Transfer window" text,
"Transfer fee" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the type of POR?
| SELECT "Type" FROM table_49584 WHERE "Nat." = 'por' | wikisql |
CREATE TABLE table_name_60 (
time_retired VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time/retired for alain prost?
| SELECT time_retired FROM table_name_60 WHERE driver = "alain prost" | sql_create_context |
CREATE TABLE table_30388 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was Betty's partner when the ... | SELECT "Partner" FROM table_30388 WHERE "Surface" = 'Hard' | wikisql |
CREATE TABLE table_name_60 (
pick INTEGER,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest pick for a player from auburn?
| SELECT MAX(pick) FROM table_name_60 WHERE school = "auburn" | sql_create_context |
CREATE TABLE table_8196 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team in the game with more than 1675, and Olimpia was the away side?
| SELECT "Home" FROM table_8196 WHERE "Attendance" > '1675' AND "Away" = 'olimpia' | wikisql |
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 WHERE demographic.gender = "F" AND demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" | mimicsql_data |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '柏安民' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-06-28' AND '2012-04-06' | css |
CREATE TABLE table_15315816_1 (
winners_share__$_ VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much are all winners share ($) in the year 2004?
| SELECT winners_share__$_ FROM table_15315816_1 WHERE year = "2004" | sql_create_context |
CREATE TABLE table_42213 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" real,
"Song" text,
"Artist" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Weeks on Top for the Volume:Issue 34:9-12?
| SELECT SUM("Weeks on Top") FROM table_42213 WHERE "Volume:Issue" = '34:9-12' | wikisql |
CREATE TABLE table_7464 (
"Ep No" text,
"Prod Code" text,
"Original Air Date" text,
"Episode Title" text,
"Ratings" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title of the episode with a production code of 1gowo04?
| SELECT "Episode Title" FROM table_7464 WHERE "Prod Code" = '1gowo04' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_... | SELECT LAST_NAME, DEPARTMENT_ID FROM employees ORDER BY LAST_NAME DESC | nvbench |
CREATE TABLE table_46019 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the game number when record is 59-15?
| SELECT MIN("Game") FROM table_46019 WHERE "Record" = '59-15' | wikisql |
CREATE TABLE table_name_38 (
rank INTEGER,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Hungary's highest Rank?
| SELECT MAX(rank) FROM table_name_38 WHERE country = "hungary" | sql_create_context |
CREATE TABLE table_26198709_1 (
original_air_date VARCHAR,
us_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many air dates does the episode with 15.50 million viewers have?
| SELECT COUNT(original_air_date) FROM table_26198709_1 WHERE us_viewers__million_ = "15.50" | sql_create_context |
CREATE TABLE table_name_85 (
high_points VARCHAR,
location_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At Time Warner Cable Arena 12,096, what was the high points?
| SELECT high_points FROM table_name_85 WHERE location_attendance = "time warner cable arena 12,096" | sql_create_context |
CREATE TABLE table_1231 (
"Station" text,
"Year opened" text,
"Metropolitan borough [c ]" text,
"Zone" real,
"Servedby Route maps:- [ dead link ] [ dead link ]" text,
"Station users 2006\u201307" real,
"Station users 2007\u201308" real
)
-- Using valid SQLite, answer the following question... | SELECT MAX("Zone") FROM table_1231 | wikisql |
CREATE TABLE table_name_55 (
red_cards INTEGER,
season VARCHAR,
games VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Red Cards has a Season of 1998/1999, and a Games larger than 41?
| SELECT MIN(red_cards) FROM table_name_55 WHERE season = "1998/1999" AND games > 41 | sql_create_context |
CREATE TABLE table_14174 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position for Discus in 2013?
| SELECT "Position" FROM table_14174 WHERE "Event" = 'discus' AND "Year" = '2013' | wikisql |
CREATE TABLE table_73914 (
"Outcome" text,
"No." text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the championship Indian Wells, Unit... | SELECT "Opponent in the final" FROM table_73914 WHERE "Championship" = 'Indian Wells, United States (2)' | wikisql |
CREATE TABLE table_name_7 (
lb VARCHAR,
scr_no VARCHAR,
sr_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the LB&SCR number that has SR number of 8597 8600
| SELECT lb & scr_no FROM table_name_7 WHERE sr_no = "8597–8600" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE proced... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 60515 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-3 year') | mimic_iii |
CREATE TABLE table_name_98 (
years VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the years for Kawerau Putauaki School?
| SELECT years FROM table_name_98 WHERE name = "kawerau putauaki school" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
... | SELECT * FROM Posts WHERE AnswerCount > 2 AND ViewCount > 20 AND ClosedDate IS NULL AND AcceptedAnswerId IS NULL AND Tags LIKE '%##Tag1##%' AND CreationDate > '2015-12-21' | sede |
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Intravenous infusion of clofarabine" | mimicsql_data |
CREATE TABLE artist (
artist_name varchar2(50),
country varchar2(20),
gender varchar2(20),
preferred_genre varchar2(50)
)
CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(10),
most_popular_in varchar2(50)
)
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(5... | SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages | nvbench |
CREATE TABLE table_25527255_2 (
average_squad_age VARCHAR,
shirt_sponsor VARCHAR,
kit_manufacturer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average squad age of the team whose shirt sponsor is Sho'rtan Gaz Mahsulot and whose kit manufac... | SELECT average_squad_age FROM table_25527255_2 WHERE shirt_sponsor = "Sho'rtan Gaz Mahsulot" AND kit_manufacturer = "Adidas" | sql_create_context |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTyp... | SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND CreationDate < DATEADD(day, '##Days##', '2008-07-15') | sede |
CREATE TABLE table_46708 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Week on September 5, 1993?
| SELECT "Week" FROM table_46708 WHERE "Date" = 'september 5, 1993' | wikisql |
CREATE TABLE table_name_45 (
player VARCHAR,
place VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Player who has a Place of t7 in Country of united states?
| SELECT player FROM table_name_45 WHERE place = "t7" AND country = "united states" | 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_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '鲁同济' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 8376.61) | css |
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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "1" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_28707 (
"Rank" real,
"Athlete" text,
"Country" text,
"Distance (metres)" text,
"Points" text,
"Adjusted Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country(s) where the points equal 723.075?
| SELECT "Country" FROM table_28707 WHERE "Points" = '723.075' | wikisql |
CREATE TABLE table_15187735_16 (
netflix VARCHAR,
segment_a VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Whats the season/episode of segment a digital dentistry
| SELECT netflix FROM table_15187735_16 WHERE segment_a = "Digital Dentistry" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.